fix(k8s): add prod workload topology spread
All checks were successful
Code Review / ai-code-review (push) Successful in 12s
CD Pipeline / tests (push) Successful in 1m33s
CD Pipeline / build-and-deploy (push) Successful in 8m20s
CD Pipeline / post-deploy-checks (push) Successful in 2m11s

This commit is contained in:
Your Name
2026-06-13 00:21:23 +08:00
parent 03a2f8b962
commit acaae99986
3 changed files with 30 additions and 0 deletions

View File

@@ -33,6 +33,16 @@ spec:
system: awoooi
environment: prod
spec:
# 2026-06-13 Codex: 明確偏好跨 120 / 121 分散,但不在單節點維護時卡死 rollout。
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app: awoooi-web
environment: prod
system: awoooi
containers:
- name: web
# 映像標籤由 CI/CD 動態注入 (格式: {sha}-{run_id})

View File

@@ -35,6 +35,16 @@ spec:
system: awoooi
environment: prod
spec:
# 2026-06-13 Codex: 明確偏好跨 120 / 121 分散,但不在單節點維護時卡死 rollout。
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app: awoooi-api
environment: prod
system: awoooi
# Phase 7: 使用 RBAC ServiceAccount (最小權限)
serviceAccountName: awoooi-executor
automountServiceAccountToken: true

View File

@@ -41,6 +41,16 @@ spec:
environment: prod
component: signal-processor
spec:
# 2026-06-13 Codex: Worker 目前 min=1但 HPA 擴到多副本時優先跨節點分散。
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app: awoooi-worker
environment: prod
system: awoooi
# ADR-038/039: Graceful Shutdown (Worker 需要 75 秒完成清理)
serviceAccountName: awoooi-executor
automountServiceAccountToken: true