towerops/k8s/poddisruptionbudget.yaml
Graham McIntire 9c2d95b55a
Add zero-downtime deployment configuration
Prevent WebSocket disconnections during deployments by:

1. Rolling Update Strategy:
   - maxSurge: 1 (allow 1 extra pod during rollout)
   - maxUnavailable: 0 (keep all pods running)
   - minReadySeconds: 10 (wait before continuing rollout)

2. Graceful Shutdown:
   - terminationGracePeriodSeconds: 30 (allow Phoenix to drain connections)

3. PodDisruptionBudget:
   - minAvailable: 1 (ensure at least 1 pod always available)
   - Prevents all pods from being terminated simultaneously

4. Improved Health Checks:
   - Faster readiness probe (5s initial, 3s period)
   - More aggressive success/failure thresholds
   - New pods marked ready faster

This ensures new pods are fully ready and serving traffic before old
pods are terminated, maintaining WebSocket connections and preventing
'something went wrong' errors during deployments.
2026-01-17 12:44:22 -06:00

11 lines
238 B
YAML

---
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