Reloader icon indicating copy to clipboard operation
Reloader copied to clipboard

Changes during Leader Election

Open dqle opened this issue 2 years ago • 2 comments

HI, I'm currently testing Reloader and I have a question regarding HA setup and changes during leader election. Right now, my setup is the following:

  1. A deployment with annotation secret.reloader.stakater.com/reload: test-secret
  2. A secret named test-secret
  3. Reloader with following config enabled:
    • HA with 3 replicas
    • ReloadOnCreate: True
    • syncAfterRestart: True

This is working normally. I got the pod to restart when updating the secret and on the creation of secret. However, when I delete a reloader leader pod to trigger leader election, and made a change to the secret / add the secret, my deployment pod did not get restarted during or after leader election took place.

However, after leader election, if I make any changes to test-secret, then it is working as normal.

From the README, this is in the ReloadOnCreate section:

If reloadOnCreate is set to true: If you are running Reloader in HA mode all workloads will have a rolling update performed when a new leader is elected.

If ReloadOnCreate is set to false: Updates to configMaps/Secrets that occur while there is no leader will not be picked up by the new leader until a subsequent update of the configmap/secret occurs. In the worst case the window in which there can be no leader is 15s as this is the LeaseDuration.

From my testing, changes during leader election does not get pick up. Is it a bug or am I doing something wrong?

Reloader version is v1.0.28

dqle avatar Jun 26 '23 17:06 dqle

You need to enable: syncAfterRestart

faizanahmad055 avatar Jun 26 '23 22:06 faizanahmad055

You need to enable: syncAfterRestart

syncAfterRestart is enabled

dqle avatar Jun 27 '23 05:06 dqle