# AWOOOI 正式環境 Namespace 與資源配額
# 負責人: CIO
# 版本: v1.0
# 日期: 2026-03-20

apiVersion: v1
kind: Namespace
metadata:
  name: awoooi-prod
  labels:
    environment: prod
    system: awoooi
    # 用於 NetworkPolicy selector
    name: awoooi-prod

---
# 資源配額 - 限制 AWOOOI 使用叢集 40% 資源
apiVersion: v1
kind: ResourceQuota
metadata:
  name: awoooi-prod-quota
  namespace: awoooi-prod
spec:
  hard:
    # 計算資源上限
    requests.cpu: "4"
    requests.memory: 8Gi
    limits.cpu: "8"
    limits.memory: 16Gi
    # Pod 數量限制
    pods: "20"
    # 儲存限制
    persistentvolumeclaims: "10"
    requests.storage: "50Gi"

---
# LimitRange - 預設容器資源限制
apiVersion: v1
kind: LimitRange
metadata:
  name: awoooi-prod-limits
  namespace: awoooi-prod
spec:
  limits:
    # 預設容器限制
    - type: Container
      default:
        cpu: "500m"
        memory: "512Mi"
      defaultRequest:
        cpu: "100m"
        memory: "128Mi"
      max:
        cpu: "2"
        memory: "4Gi"
      min:
        cpu: "50m"
        memory: "64Mi"
    # Pod 總限制
    - type: Pod
      max:
        cpu: "4"
        memory: "8Gi"
