-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Ztunnel/populate service account #41276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
pkg/k8s/apis/cilium.io/client/crds/v2alpha1/ciliumendpointslices.yaml
Outdated
Show resolved
Hide resolved
6769fe6
to
b7dd66a
Compare
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of minor comments inline, but overall makes sense to me.
f414c3e
to
a4092fc
Compare
a4092fc
to
adbff1b
Compare
adbff1b
to
aa15582
Compare
In preparation for ztunnel integration, make a CEP's service account visible to the k8s CEP watcher. ZTunnel identifies workloads by their namespace/service account pair. It also requires the Cilium agent to forward CEP add/delete events to it, so it can keep its own proxy cache. Therefore, we need the service account of a CEP present to forward this information to ztunnel. While we can obtain the namespace from the object's meta, the service account is not available. Therefore, populate the service account information during endpoint manager synchornization. This pushes the CEP CRD up to the control plane with the service account field populated. Signed-off-by: Louis DeLosSantos <louis.delos@isovalent.com>
To support ztunnel integration with Cilium in CiliumEndpointSlice mode we must populate the service account field in the CoreCiliumEndpoint structure. This allows agents to obtain the service account of a endpoint when the endpoint is encoded as a CoreCiliumEndpoint within a CiliumEndpointSlice. The agent will require this field when integrating ztunnel, since ztunnel considers this a key component of an Endpoint's identifier. Note: the 'omitempty` json tag on the Encryption field within this patchset was done to silence a linting error stating is was redundant for struct field members Signed-off-by: Louis DeLosSantos <louis.delos@isovalent.com>
In preparation for ztunnel integration when Cilium is in kvstore mode we populate the distributed identity structures with a servivce account. This allows an agent to understand the service account of a remote identity, which is a requirement for ztunnel. Signed-off-by: Louis DeLosSantos <louis.delos@isovalent.com>
aa15582
to
5d60c7b
Compare
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm lacking some amount of context on this change - is there a CFP or something that I can read to understand the design a bit more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
concerns addressed, thanks!
Adding the discussion label for the upgrade discussion which is ongoing - feel free to remove once that's resolved. (Also the mergeability check was stuck, this should get it unstuck 😁)
I'd suggest adjusting the release note to just something like "Add Kubernetes ServiceAccount to CiliumEndpoint and CiliumEndpointSlice structures" since this is a generic change. |
@joestringer done! |
This PR is a precursor for integrating with the ztunnel mTLS proxy.
Ztunnel's control plane expects a cluster-wide view of endpoints. It groups endpoints into trust anchors via their namespace and service account details.
Historically, the service account details for remote endpoints were not communicated via the agent.
In this PR we update the necessary identity structures to push the service account's visible into the agent.
In the ztunnel integration proper, the ztunnel control plane component will hook into the K8s watcher to inform ztunnel of created or deleted endpoints. Support for kvstore involves more work around the Identity watcher and will be deferred for the time being.