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

Graceful shutdown for controller's namespace deletion #2522

Open
csviri opened this issue Aug 29, 2024 · 0 comments · Fixed by #2528
Open

Graceful shutdown for controller's namespace deletion #2522

csviri opened this issue Aug 29, 2024 · 0 comments · Fixed by #2528
Assignees
Milestone

Comments

@csviri
Copy link
Collaborator

csviri commented Aug 29, 2024

Is your feature request related to a problem? Please describe.

This situation is a typical problem in integration tests (but not just). If the controller manages resources with finalizers in its namespace and the namespace gets deleted, in this case, the namespace deletion can get stuck since the pods of the operator are deleted before it can adequately finalize the resource (thus remove the finalizers).

Describe the solution you'd like

The ideal situation would be, that it waits until all the custom resources in the same namespace are cleaned up. (It might be also be possible to have such an intelligent shutdown hook).

Alternative would be just a simple shutdown hook to add that waits some time before it stops the controller. This might be trivial to add, does not require coding, but would be good to do add an integration test.

Additional context
see also: #1876 - The finalizers would be needed if the operator has namespace scoped roles and rolebindings.

Notes:

For leader election, we might actually halt() instead of exit, which bypasses the shutdown hooks.

@csviri csviri added this to the 5.1 milestone Aug 29, 2024
@csviri csviri changed the title Graceful shutdown, processing resources in same namespace Graceful shutdown for controllers namespace deletion Aug 29, 2024
@csviri csviri changed the title Graceful shutdown for controllers namespace deletion Graceful shutdown for controller's namespace deletion Aug 29, 2024
@csviri csviri self-assigned this Aug 29, 2024
@csviri csviri linked a pull request Sep 17, 2024 that will close this issue
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 a pull request may close this issue.

1 participant