operator-framework / operator-framework/java-operator-sdk

Graceful shutdown for controller's namespace deletion

Open
#2,522 0 comments 0 reactions 1 assignee View on GitHub

@csviri is already working on this.

Since Aug 29, 2024.

  • #2528 by @csviri — merged
Dominant language
Java
Stars
944
Forks
242
Avg merge
1d 4h
Merged PRs (30d)
43

Description

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: https://github.com/operator-framework/java-operator-sdk/issues/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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.