Files
awoooi/docs/adr/ADR-034-gitops-argocd-adoption.md
OG T 1a4be7b18a feat(k-mon): K3s monitoring integration (Phase K-MON)
- Add Velero metrics NodePort service (30885)
- Add K3s infrastructure alert rules:
  - VIP 6443 availability
  - Node ICMP checks
  - AWOOOI API/Web TCP checks
  - SignOz/Sentry availability
- Add Velero backup alerts (failed/missing)
- Add ADR-034 for ArgoCD GitOps adoption

Deployed to:
- K3s: velero-metrics service
- 188: Prometheus + Alertmanager configs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-28 21:57:57 +08:00

87 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ADR-034: GitOps 採用策略 (ArgoCD)
| 欄位 | 值 |
|------|-----|
| **狀態** | ✅ 已採用 |
| **日期** | 2026-03-28 (台北) |
| **決策者** | 首席架構師 |
| **影響範圍** | K3s 部署流程 |
---
## 背景
AWOOOI 目前使用 GitHub Actions 進行 CI/CD部署流程為
1. Push to main
2. GitHub Actions 建構映像檔
3. kubectl apply 部署到 K3s
此流程的問題:
- 無法追蹤部署狀態
- 手動 rollback 困難
- 配置漂移無法偵測
---
## 決策
採用 **ArgoCD** 作為 GitOps 工具,實現:
- Git 作為單一真實來源
- 自動同步 K3s 狀態
- 視覺化部署管理
### 部署架構
```
GitHub (main) → ArgoCD → K3s Cluster
自動同步 / 手動同步
```
### 存取資訊
| 項目 | 值 |
|------|-----|
| URL | https://192.168.0.125:30443 |
| 帳號 | admin |
| 版本 | v3.3.6 |
---
## 選項評估
| 選項 | 優點 | 缺點 | 決策 |
|------|------|------|------|
| **ArgoCD** | CNCF 畢業專案、UI 完整 | 學習曲線 | ✅ 採用 |
| Flux | 輕量、Git-native | 無 UI | ❌ |
| 維持 kubectl | 簡單 | 無追蹤、漂移風險 | ❌ |
---
## 實施階段
| 階段 | 內容 | 狀態 |
|------|------|------|
| 1 | ArgoCD 部署 | ✅ 完成 |
| 2 | Sealed Secrets 整合 | ✅ 完成 |
| 3 | AWOOOI Application 建立 | 📋 待執行 |
| 4 | 自動同步啟用 | 📋 待評估 |
---
## 風險與緩解
| 風險 | 緩解措施 |
|------|---------|
| 自動同步造成意外部署 | 初期使用手動同步 |
| Secrets 外洩 | 使用 Sealed Secrets |
| 單點故障 | ArgoCD HA 模式 (待評估) |
---
## 相關文件
- ArgoCD 官方文檔: https://argo-cd.readthedocs.io/
- Sealed Secrets: https://github.com/bitnami-labs/sealed-secrets
- K3S-OPTIMIZATION-RUNBOOK.md Section 7