ops(prop): zero-downtime rolling update with single replica
maxUnavailable: 1 was killing the only pod before the new one was ready, taking the site down for the entire image pull + boot window on every deploy. Switch to maxSurge: 1 / maxUnavailable: 0 so K8s spins up the replacement and waits for its readinessProbe to pass before tearing down the old pod.
This commit is contained in:
parent
2de1b89efc
commit
b66024e0c3
1 changed files with 8 additions and 3 deletions
|
|
@ -4,15 +4,20 @@ metadata:
|
|||
name: prop
|
||||
namespace: prop
|
||||
spec:
|
||||
# replicas is owned by the HPA in hpa.yaml (min 2 / max 5).
|
||||
# Leaving it out here so Flux's periodic reconcile doesn't overwrite
|
||||
# replicas is owned by the HPA in hpa.yaml (currently pinned at 1).
|
||||
# Leaving it out here so the GitOps reconciler doesn't overwrite
|
||||
# whatever replica count the autoscaler has settled on.
|
||||
minReadySeconds: 5
|
||||
strategy:
|
||||
type: RollingUpdate
|
||||
rollingUpdate:
|
||||
# Zero-downtime rollout with a single replica: surge to 2 first,
|
||||
# wait for the new pod to pass its readinessProbe, THEN tear down
|
||||
# the old one. maxUnavailable: 1 (the K8s default) was killing the
|
||||
# only pod before the replacement was ready, taking the site down
|
||||
# for the entire image pull + boot window on every deploy.
|
||||
maxSurge: 1
|
||||
maxUnavailable: 1
|
||||
maxUnavailable: 0
|
||||
selector:
|
||||
matchLabels:
|
||||
app: prop
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue