# AwoooP 自動修復 live-fire canary
# 目的: 提供低風險 Deployment 目標，讓 T16 可驗證
# alert -> Playbook -> executor -> verifier -> learning/KM 的真實閉環。
# 注意: 此 Pod 不承接任何流量，不掛載 Secret，不自動暴露 Service。

apiVersion: apps/v1
kind: Deployment
metadata:
  name: awoooi-auto-repair-canary
  namespace: awoooi-prod
  labels:
    app: awoooi-auto-repair-canary
    system: awoooi
    environment: prod
    component: auto-repair-canary
spec:
  replicas: 1
  revisionHistoryLimit: 2
  selector:
    matchLabels:
      app: awoooi-auto-repair-canary
      environment: prod
      system: awoooi
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  template:
    metadata:
      labels:
        app: awoooi-auto-repair-canary
        system: awoooi
        environment: prod
        component: auto-repair-canary
    spec:
      automountServiceAccountToken: false
      containers:
        - name: canary
          image: 192.168.0.110:5000/library/api:IMAGE_TAG_PLACEHOLDER
          imagePullPolicy: Always
          command: ["/bin/sh", "-c"]
          args:
            - |
              trap 'exit 0' TERM INT
              while true; do sleep 3600 & wait $!; done
          env:
            - name: AWOOOP_CANARY_ROLE
              value: "auto-repair-live-fire-target"
          resources:
            requests:
              cpu: "50m"
              memory: "64Mi"
            limits:
              cpu: "50m"
              memory: "96Mi"
