Open jfiedler-jaconi opened 9 months ago
This is a conceptual problem, as we do not require a shutdown hook (which would take care for the cleanup if the pod is dropped). However, this is also not a perfect solution, as the pod might get killed without graceful termination. As a quickfix, I would propose to provide a new version of this sidecar, where the secret-deletion handling is optional. For the long-term solution we might need some more thoughts...
Proposal: We remove the finalizer handling completely and therefore get rid of the problem at all.
Instead we can use a sync job (running e.g. every 10 minutes) to sync the cluster state with the filesystem-state, to make sure we did not loose any deletion event.
The secret-file-provider seems to add finalizers to secrets that it collected at one point. We ended up with lots of finalizers at the secret level (see below). These finalizers prevented us from deleting the secrets.