[BUG] Reloader don't restart pod on secret recreation.
hetii opened this issue · comments
HI.
I have a Deployment object with annotation:
secret.reloader.stakater.com/reload: "agg-client-certificate,apm-server-apm-token"
configmap.reloader.stakater.com/reload: "syncer-cm"
When I edit config map or data in apm-server-apm-token secret, all if fine and my deployment is restarted.
The apm-server-apm-token secret is created by elastic operator, when I add ApmServer kind object to my cluster.
The issue is when I remove ApmServer object, then the operator remove also corresponding apm-server-apm-token secret but
the Deployment is not restarted on create or delete events for that secret.
This issue happen on helm chart reloader-v0.0.109 and reloader-1.0.29.
Kubernetes version: (AKS v1.26.6).
As I think about it operator maybe should not react on on-delete events by default to not interrupt already working pods,
but should react by default on on-create events when new secrets popup to reflect this change in pods.
Ok I just discovered that reloader support reloadOnCreate and syncAfterRestart flags.
Seams now my deployments act as I expected, but wonder why reloadOnCreate is not true by default.
Also not fully understand the syncAfterRestart flags, I mean when this can be useful.
https://github.com/stakater/Reloader/blob/master/deployments/kubernetes/chart/reloader/values.yaml contains the default values for parameters but it is true that the README should ideally show them as well.
If this issue is just about documentation enhancement, I made a proposal here.