# AWOOOI PodDisruptionBudget
# 確保滾動更新和節點維護時服務不中斷
# 建立者: Claude Code (首席架構師)
# 日期: 2026-03-28 (台北時間)
# 版本: v1.0

apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: awoooi-api-pdb
  namespace: awoooi-prod
  labels:
    app: awoooi-api
    system: awoooi
spec:
  # 至少保持 1 個 Pod 運行
  minAvailable: 1
  selector:
    matchLabels:
      app: awoooi-api

---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: awoooi-web-pdb
  namespace: awoooi-prod
  labels:
    app: awoooi-web
    system: awoooi
spec:
  minAvailable: 1
  selector:
    matchLabels:
      app: awoooi-web

---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: awoooi-worker-pdb
  namespace: awoooi-prod
  labels:
    app: awoooi-worker
    system: awoooi
spec:
  # 設計選擇: replica=1 + maxUnavailable=1 允許維護時完全停止 Worker
  # Worker 處理 Redis Streams，短暫中斷可接受 (訊息會在 Stream 中等待)
  # 首席架構師審查 2026-03-28: 確認此為預期設計
  maxUnavailable: 1
  selector:
    matchLabels:
      app: awoooi-worker
