# Pod Disruption Budgets — prevent node maintenance from killing all replicas
# API: at least 2 of 3 replicas must stay up during voluntary disruptions
# Web: same (3 replicas, at least 2 up) — production web client availability
# Worker: singleton (Asynq scheduler) — must allow drain, minAvailable: 0

apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: api-pdb
  namespace: honeydue
  labels:
    app.kubernetes.io/name: api
    app.kubernetes.io/part-of: honeydue
spec:
  minAvailable: 2
  selector:
    matchLabels:
      app.kubernetes.io/name: api

---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: web-pdb
  namespace: honeydue
  labels:
    app.kubernetes.io/name: web
    app.kubernetes.io/part-of: honeydue
spec:
  minAvailable: 2
  selector:
    matchLabels:
      app.kubernetes.io/name: web

---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: worker-pdb
  namespace: honeydue
  labels:
    app.kubernetes.io/name: worker
    app.kubernetes.io/part-of: honeydue
spec:
  minAvailable: 0
  selector:
    matchLabels:
      app.kubernetes.io/name: worker
