From 4cb83caffb20813405d9d8f2dd728735f7a84274 Mon Sep 17 00:00:00 2001 From: Devan Goodwin Date: Thu, 24 Sep 2020 15:49:32 -0300 Subject: [PATCH] Bug 1882505: Fix stalled leader election after Deployment updates. The revamped leader election in 4.6 is not working correctly if the Deployment is modified. Under the default Deployment strategy of rolling update, a new pod is brought up before the old is terminated. The new pod leader election has already determined someone else is leader before the old releases it's lock, and will wait the full renew interval of 270 seconds before checking again. To fix we switch to the recreate strategy which will delete the old pod first, then create the new. This seems the desired strategy for leader election based operators. --- manifests/03-deployment.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manifests/03-deployment.yaml b/manifests/03-deployment.yaml index 78424d5f4..c0f627a70 100644 --- a/manifests/03-deployment.yaml +++ b/manifests/03-deployment.yaml @@ -13,6 +13,8 @@ spec: matchLabels: control-plane: controller-manager controller-tools.k8s.io: "1.0" + strategy: + type: Recreate template: metadata: labels: