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