dragonflydb / dragonfly-operator

A Kubernetes operator to install and manage Dragonfly instances.
https://www.dragonflydb.io/docs/managing-dragonfly/operator/installation
Apache License 2.0
132 stars 28 forks source link

fix(dragonfly): remove master label before configuration #51

Closed Pothulapati closed 1 year ago

Pothulapati commented 1 year ago

When a master is deleted, The termination could take a while which means there is a possibility of two pods with role=master to exist. If a pod trigger happens in this situation, Unnecessary reconcilation happens as the controller can assume thats its a corrupt state.

This commit essentially eliminates this case by removing this label before electing a new master and thus ensuring that there is only master all the time. We can be sure that the new master won't be the currently being deleted pod as we check for the deletion timestamp