From b66024e0c3a3446f7258dfd1fc1f693ba28dd934 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Wed, 29 Apr 2026 13:50:14 -0500 Subject: [PATCH] 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. --- k8s/deployment.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index cde7f81e..ac510baf 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -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