I'm using leadership election to ensure that only one pod is allowed to write to a database even when multiple pods are running.
When the pod that holds leadership receives a SIGTERM (e.g. because the node it runs on is being drained, or during an upgrade to a new version) I want to stop auto-renewing the leadership. Is there a way to do this? Otherwise I need to wait for the pod to be killed (SIGKILL) then wait for the lease to time out and have to wait for the entire lease duration.
I can capture the signal easily but there doesn't seem to be a method on the API objects to do this. I can see the way this is handled in the tests is using a mock of the update method on the lock. Is there an existing feature for this?
I'm using leadership election to ensure that only one pod is allowed to write to a database even when multiple pods are running.
When the pod that holds leadership receives a SIGTERM (e.g. because the node it runs on is being drained, or during an upgrade to a new version) I want to stop auto-renewing the leadership. Is there a way to do this? Otherwise I need to wait for the pod to be killed (SIGKILL) then wait for the lease to time out and have to wait for the entire lease duration.
I can capture the signal easily but there doesn't seem to be a method on the API objects to do this. I can see the way this is handled in the tests is using a mock of the update method on the lock. Is there an existing feature for this?