fix(ops): bring drift scanner under gitops
Some checks failed
CD Pipeline / tests (push) Successful in 59s
Code Review / ai-code-review (push) Successful in 11s
CD Pipeline / build-and-deploy (push) Successful in 8m52s
CD Pipeline / post-deploy-checks (push) Has been cancelled

This commit is contained in:
Your Name
2026-05-05 23:20:12 +08:00
parent 1cc215ec30
commit 405b8b8ef9
3 changed files with 18 additions and 3 deletions

View File

@@ -6,6 +6,17 @@
---
## 2026-05-05 | drift-scanner CronJob 納入 ArgoCD baseline
**背景**重開機恢復後K8s Deployments 與三個新納入的 CronJob 已跟到最新 image`drift-scanner` 仍是手動套用的舊固定 SHA會造成「服務健康、排程吃舊版」的冷啟動盲區。
**本次修補**
-`drift-scanner` manifest 移入 `k8s/awoooi-prod/12-cronjob-drift-scanner.yaml`,由 `k8s/awoooi-prod/kustomization.yaml` 納入 ArgoCD 管理。
- `drift-scanner` image 改用 `192.168.0.110:5000/library/api:IMAGE_TAG_PLACEHOLDER`,讓 CD 的 kustomize image 注入同時覆蓋 drift 排程。
**驗證**
- `kubectl kustomize k8s/awoooi-prod` 通過build output 中 `drift-scanner` image 會被解析為目前 kustomization 的 `awoooi/api:c4854bb3...`
## 2026-05-05 | 重開機後排程與 startup baseline 修復
**背景**:四台主機非預期重開機後,統帥要求確認所有服務、網站、工具、資料庫與排程都能正常恢復,不能只看容器 `healthy`

View File

@@ -6,7 +6,7 @@
# 關聯設計: docs/superpowers/specs/2026-04-04-nemotron-active-defense-design.md 方向三
# 關聯 ADR: 待起草 ADR-057
#
# 部署: kubectl apply -f k8s/drift-cronjob.yaml -n awoooi-prod
# 部署: 由 ArgoCD 套用 k8s/awoooi-prod/kustomization.yaml
# 手動觸發: kubectl create job --from=cronjob/drift-scanner drift-scan-manual -n awoooi-prod
# 查看 log: kubectl logs -l job-name=drift-scanner -n awoooi-prod
@@ -48,8 +48,11 @@ spec:
containers:
- name: drift-scanner
# 使用 awoooi-api 鏡像(含 kubectl + Python 環境)
# 2026-04-09 Claude Sonnet 4.6: 改用內網 registry + 固定 SHA tag (禁止 latest)
image: 192.168.0.110:5000/awoooi/api:21567a7a6dbee7db2c0f59c265f80713ff5e6fe4
# 2026-05-05 Codex: keep the API image placeholder so CD
# injects the same immutable tag used by API/worker. Leaving
# this CronJob on a fixed old tag made the schedule drift after
# reboot even when Deployments were healthy.
image: 192.168.0.110:5000/library/api:IMAGE_TAG_PLACEHOLDER
imagePullPolicy: Always
command:
- python

View File

@@ -31,6 +31,7 @@ resources:
- 13-cronjob-k3s-report.yaml
- 14-cronjob-weekly-report.yaml
- 15-cronjob-km-vectorize.yaml
- 12-cronjob-drift-scanner.yaml
# 映像配置 (Tag 由 CI 動態注入)
# Harbor 金庫: 110 主機 (192.168.0.110:5000)