-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
pkg/ciliumidentity: skip CID creation for unmanaged pods #36779
Conversation
c325f61
to
f07171f
Compare
b4d0a8f
to
7513aea
Compare
cc @ovidiutirla |
/test |
If we skip pods that don't have CEP/CES, then we lose the benefit of the CID controller creating CIDs as soon as pod objects are created. After a deeper look, it turns out that the way Cilium handles unmanaged pods, is that it just tries to restart them to be able to start managing them -- https://github.com/cilium/cilium/blob/main/operator/cmd/k8s_pod_controller.go#L68. We should verify if it's ok to create CIDs for all pods, because it's not expected to have any long running unmanaged pods. In that case we can close the issue without any code changes. cc @squeed |
Yeah I think it would help to have a bit more detail on the rationale for this change, for instance in which situation you are expecting there to be significant numbers of unmanaged Pods. Assuming we want to support both scenarios it may make sense to add a flag for this behavior. |
Marking this PR as draft until more details are provided on the rationale for this change, see Joe's comment. This will keep the PR out of reviewer's queues. Please feel free to move out of draft again once the rationale is provided and reviews are solicited. |
@ovidiutirla @dlapcevic I think the key question here was whether there are expected to be any long-lived unmanaged pods. My best understanding of the answer is that the expected long-lived unmanaged pods are hostNetwork pods, although I'm not sure if these would be created in a significant number. (Also, if this is the only case we care about, since other times, pods are restarted, it would be simpler to just skip hostNetwork pods rather than checking for a CEP/CES I think) It seems like in the current set-up, if you create a host networking pod, it tries to create a CID (15 times), which doesn't seem optimal in cases with more host networking pods.
whereas with this change we would neatly skip out
Just wanted to make sure this seems reasonable to you all before making changes and get your thoughts on this before making any changes :) Edit: Ah I realized I was missing a clusterrole, thanks Ovidiu :) |
7513aea
to
3692a62
Compare
Would be good to clarify this aspect, if it's not relevant, let's close the corresponding issue and unblock the progress for making operator managing CIDs GA. /cc @marseel @dlapcevic @bowei |
When operator manages identities, ignore pod events when pod is not managed by Cilium, in this case, using host networking. Signed-off-by: jshr-w <shjayaraman@microsoft.com>
3692a62
to
06cea2c
Compare
/test |
Operator should only create CiliumIdentities for pods managed by Cilium, specifically here, skip creating CIDs for pods using host networking.
Fixes: #35402