Replies: 3 comments 3 replies
-
@nolar Is it possible you could give some hint as how to (easily/possibly) manually remove finalizers from objects? Would we have to iterate on all monitored objects in all monitored namespaces and manually remove the finalizers in a shutdown hook, or is there a better way? Again, this is not for the general use-case, but for namespace deletion. We happen to use a number of short-lived namespaces for development, and currently there's no good way to shut them down without ending in a stuck state (start namespace deletion -> stop all pods -> try to delete CRDs -> blocked on finalizer -> namespace deletion stalled completely). |
Beta Was this translation helpful? Give feedback.
-
Hello.
Yes, this totally makes sense. If the only reason the finalizers are added is the daemon (and no other on-change handlers), then the operator should remove them when stopping/exiting. This logic is currently absent in the code. I am not sure when (and if) I will be able to add it, sorry. But you can contribute the code! ;-) PS: If there are other reasons (e.g. on-creation/deletion/update handlers), then the finalizers should remain. As a separate change, it might be a good idea to add a CLI option like |
Beta Was this translation helpful? Give feedback.
-
Hello, |
Beta Was this translation helpful? Give feedback.
-
When running a daemon; finalizers are added to ensure the kopf daemon is notified if the object is deleted. However, on operator exit finalizers are not removed from the object. Would it make sense to ensure that the call to
stop_daemon
removes finalizers on some set ofDaemonStoppingReason
, e.g. onOPERATOR_EXITING
?Currently we have an operator deployed to a namespace and it handles stuff in that namespace. Upon deletion of the namespace we often end up in the eternal Terminating state, because the operator has exited, but hasn't cleared finalizers which results in objects with installed finalizers are stuck as they are waiting for the operator to clear the finalizer.
The issue is somewhat described in https://kopf.readthedocs.io/en/stable/troubleshooting/, however, if the operator upon exiting would remove finalizers then it wouldn't be an issue. And if the operator is started again, daemons will register finalizers once again.
Beta Was this translation helpful? Give feedback.
All reactions