Skip to content
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

uninstall: when --wait is specified, use foreground deletion. #2344

Merged
merged 2 commits into from
Feb 28, 2024

Conversation

tommyp1ckles
Copy link
Contributor

By default, the helm libraries will use background cascading delete which means the call to do helm uninstall returns following the deployment being removed.

This means that running workloads, such as hubble-relay, may continue to be in the terminating state following cilium uninstall --wait exiting.

We depend on this behavior in CI E2E to clean up and reuse clusters for testing Cilium in different configurations.

In flakes such as: cilium/cilium#30993 it seems like the old Hubble Pods are bleeding into the "fresh" install. These should be harmless, however this is triggering failures of the [no-error-logs] assertion in the following connectivity tests.

This change will provide a more thorough uninstall procedure in this case.

Copy link
Contributor

@michi-covalent michi-covalent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks innocent enough

By default, the helm libraries will use background cascading delete which
means the call to do helm uninstall returns following the deployment being removed.

This means that running workloads, such as hubble-relay, may continue to be in the terminating state
following `cilium uninstall --wait` exiting.

We depend on this behavior in CI E2E to clean up and reuse clusters for testing Cilium in different configurations.

In flakes such as: cilium/cilium#30993 it seems like the old Hubble Pods are bleeding into the "fresh" install.
These should be harmless, however this is triggering failures of the [no-error-logs] assertion in the following connectivity tests.

This change will provide a more thorough uninstall procedure in this case.

Signed-off-by: Tom Hadlaw <tom.hadlaw@isovalent.com>
The last commit added using foreground cascading delete when doing uninstall with --wait.
However, other issues that can occur when reusing clusters following uninstall are:

* Old endpoint state written to disk being restored upon reinstall.
* CNI deletes can be written to disk in a local queue if Cilium Agent CNI is down, resulting in potential error logs when re-installing cilium and replaying queued CNI DEL commands.

When uninstalling with --wait, put disabling Hubble into a seperate uninstall step, which then blocks until there are no more Hubble Pods running.
This ensures that Hubble Pods can fully terminate via Cilium without the above situations happening.
Because Helm hubble disable uses Helm upgrade, we cannot rely on cascading foreground delete - so we just poll k8s until all Hubble Pods are gone.

Signed-off-by: Tom Hadlaw <tom.hadlaw@isovalent.com>
Copy link
Contributor

@derailed derailed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tommyp1ckles Nice work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants