From 0cd549652dfe344f11468bb443851b2407e2f01b Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Wed, 29 Apr 2026 13:55:17 -0500 Subject: [PATCH] k8s: ensure zero-downtime deploys with 1 replica MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - maxSurge: 1 (explicit integer, avoid percentage rounding) - minReadySeconds: 30 (was 10) — new pod must be stable longer before old is killed - progressDeadlineSeconds: 600 — detect stuck rollouts - readinessProbe failureThreshold: 3 (was 2) — more tolerance after old pod is gone - Add PodDisruptionBudget minAvailable: 1 — prevents voluntary disruptions from dropping below 1 pod --- k8s/deployment.yaml | 7 ++++--- k8s/kustomization.yaml | 1 + k8s/pdb.yaml | 10 ++++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 k8s/pdb.yaml diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index a925d01..e39d6d5 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -8,9 +8,10 @@ spec: strategy: type: RollingUpdate rollingUpdate: - maxSurge: 100% + maxSurge: 1 maxUnavailable: 0 - minReadySeconds: 10 + minReadySeconds: 30 + progressDeadlineSeconds: 600 selector: matchLabels: app: aprs @@ -184,4 +185,4 @@ spec: periodSeconds: 5 timeoutSeconds: 2 successThreshold: 1 - failureThreshold: 2 + failureThreshold: 3 diff --git a/k8s/kustomization.yaml b/k8s/kustomization.yaml index ef23ab3..f04592e 100644 --- a/k8s/kustomization.yaml +++ b/k8s/kustomization.yaml @@ -6,3 +6,4 @@ resources: - deployment.yaml - service.yaml - service-headless.yaml + - pdb.yaml diff --git a/k8s/pdb.yaml b/k8s/pdb.yaml new file mode 100644 index 0000000..844ff3f --- /dev/null +++ b/k8s/pdb.yaml @@ -0,0 +1,10 @@ +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: aprs + namespace: aprs +spec: + minAvailable: 1 + selector: + matchLabels: + app: aprs