# Pod Disruption Budgets for High Availability
# These ensure minimum availability during voluntary disruptions (updates, node maintenance)

---
# Backend API Pod Disruption Budget
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: veza-backend-api-pdb
  namespace: veza-production
spec:
  minAvailable: 2  # At least 2 pods must be available
  selector:
    matchLabels:
      app: veza-backend-api
---
# Frontend Pod Disruption Budget
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: veza-frontend-pdb
  namespace: veza-production
spec:
  minAvailable: 1  # At least 1 pod must be available
  selector:
    matchLabels:
      app: veza-frontend
---
# Chat Server Pod Disruption Budget
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: veza-chat-server-pdb
  namespace: veza-production
spec:
  minAvailable: 1  # At least 1 pod must be available
  selector:
    matchLabels:
      app: veza-chat-server
---
# Stream Server Pod Disruption Budget
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: veza-stream-server-pdb
  namespace: veza-production
spec:
  minAvailable: 1  # At least 1 pod must be available
  selector:
    matchLabels:
      app: veza-stream-server

