-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[v1.8] k8s: delete CEPs for no running Pods #13263
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
7a193df
to
70934d3
Compare
} | ||
if err := ciliumClient.CiliumEndpoints(namespace).Delete(ctx, podName, meta_v1.DeleteOptions{}); err != nil { | ||
if !k8serrors.IsNotFound(err) { | ||
scopedLog.WithError(err).Warning("Unable to delete CEP") |
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 guess this is best effort, ie if there's another error like lack of permissions then we will just give up rather than returning an error to the controller to ensure it gets retried?
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.
The issue is that it doesn't look like the controller retires on stop functions. 😢 In any case, the operator will perform the GC of CEPs.
[ upstream commit b3adc4d ] If an endpoint is not able to be restored we should delete the Cilium Endpoint from Kubernetes to avoid having dangling Cilium Endpoints in Kubernetes. Signed-off-by: André Martins <andre@cilium.io>
…ted" [ upstream commit 0fbd2b4 ] This reverts commit 8068f1a. This reverted commit introduces a regression where Cilium Endpoints can be left around after the Cilium Endpoint was locally deleted. Although it was a scale optimization for non existing docker images, the security aspect will overlap the scalability concern initially thought. Signed-off-by: André Martins <andre@cilium.io>
[ upstream commit f1b61a7 ] To avoid wasting resources in Cilium and to avoid leftover CiliumEndpoints from populating the ipcache, we should not watch for CiliumEndpoints when disable-endpoint-crd is set to true. Signed-off-by: André Martins <andre@cilium.io>
Doing a return regardless of the error condition would prevent Cilium Endpoints to be GCed in a single run. Fixes: 37139c3 ("operator: remove pod list of an entire cluster") Signed-off-by: André Martins <andre@cilium.io>
70934d3
to
8e85f87
Compare
test-backport-1.8 |
Partial backport of #13220