Skip to content

Commit

Permalink
Bug 1882505: Fix stalled leader election after Deployment updates.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dgoodwin committed Sep 24, 2020
1 parent fdb274b commit 4cb83ca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions manifests/03-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ spec:
matchLabels:
control-plane: controller-manager
controller-tools.k8s.io: "1.0"
strategy:
type: Recreate
template:
metadata:
labels:
Expand Down

0 comments on commit 4cb83ca

Please sign in to comment.