diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index 6effd4cb..54186ab2 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -6,6 +6,12 @@ metadata: namespace: towerops spec: replicas: 2 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 # Allow 1 extra pod during rollout + maxUnavailable: 0 # Keep all pods running during rollout + minReadySeconds: 10 # Wait 10s after pod is ready before continuing selector: matchLabels: app: towerops @@ -14,6 +20,7 @@ spec: labels: app: towerops spec: + terminationGracePeriodSeconds: 30 # Allow 30s for graceful shutdown imagePullSecrets: - name: gitlab-registry securityContext: @@ -95,9 +102,14 @@ spec: port: 4000 initialDelaySeconds: 30 periodSeconds: 10 + timeoutSeconds: 3 + failureThreshold: 3 readinessProbe: httpGet: path: /health port: 4000 - initialDelaySeconds: 10 - periodSeconds: 5 + initialDelaySeconds: 5 + periodSeconds: 3 + timeoutSeconds: 2 + successThreshold: 1 + failureThreshold: 2 diff --git a/k8s/kustomization.yaml b/k8s/kustomization.yaml index 37dff34c..1456b5b8 100644 --- a/k8s/kustomization.yaml +++ b/k8s/kustomization.yaml @@ -8,3 +8,4 @@ resources: - service-headless.yaml - certificate.yaml - ingressroute.yaml + - poddisruptionbudget.yaml diff --git a/k8s/poddisruptionbudget.yaml b/k8s/poddisruptionbudget.yaml new file mode 100644 index 00000000..c538e4bd --- /dev/null +++ b/k8s/poddisruptionbudget.yaml @@ -0,0 +1,11 @@ +--- +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: towerops-pdb + namespace: towerops +spec: + minAvailable: 1 # Keep at least 1 pod running during voluntary disruptions + selector: + matchLabels: + app: towerops