πΉ Argo CDμμ μ ν리μΌμ΄μ μν λͺ¨λν°λ§μ΄ μ€μν μ΄μ
Argo CDλ GitOps κΈ°λ°μ λ°°ν¬ μλν λꡬλ‘, μ§μμ μΌλ‘ μ ν리μΌμ΄μ
μνλ₯Ό λͺ¨λν°λ§νκ³ λ°°ν¬ μνλ₯Ό μΆμ ν μ μμ΅λλ€.
μ΄μ νκ²½μμ Kubernetes μ ν리μΌμ΄μ
μ μ μμ μΈ λμμ 보μ₯νκΈ° μν΄μλ μ€μκ° λͺ¨λν°λ§κ³Ό μλ¦Ό(Notification) μ€μ μ΄ νμμ
λλ€.
β Argo CD μν λͺ¨λν°λ§ λ° μλ¦Ό μ€μ μ μ£Όμ λͺ©μ
β μ ν리μΌμ΄μ
λκΈ°ν μν(Sync Status) λ° ν¬μ€ μν(Health Status) λͺ¨λν°λ§
β λ°°ν¬ μ€ν¨ λλ OutOfSync μν λ°μ μ μ¦μ κ°μ§
β Slack, μ΄λ©μΌ, μΉν
(Webhook) λ±μ μλ¦Ό μμ€ν
κ³Ό μ°λ
β λ¬Έμ λ°μ μ μ μν λμ λ° λ‘€λ°± μν κ°λ₯
πΉ Argo CDμ μ ν리μΌμ΄μ μν λͺ¨λν°λ§ λ°©μ
Argo CDλ μ ν리μΌμ΄μ μ **λ κ°μ§ μ£Όμ μν(Sync Status & Health Status)**λ₯Ό λͺ¨λν°λ§ν©λλ€.
β 1. λκΈ°ν μν(Sync Status)
Git μ μ₯μμ Kubernetes ν΄λ¬μ€ν° κ°μ λκΈ°ν μνλ₯Ό λνλ λλ€.
Sync μν | μ€λͺ |
Synced | μ ν리μΌμ΄μ μ΄ Git μνμ λμΌ |
OutOfSync | μ ν리μΌμ΄μ μ΄ Git μνμ λΆμΌμΉ |
Unknown | μ ν리μΌμ΄μ μνλ₯Ό νμΈν μ μμ |
β 2. ν¬μ€ μν(Health Status)
Kubernetes 리μμ€μ μ μ λμ μ¬λΆλ₯Ό λνλ λλ€.
Health μν | μ€λͺ |
Healthy | λͺ¨λ 리μμ€κ° μ μμ μΌλ‘ λμ |
Degraded | μΌλΆ 리μμ€κ° μ μμ μΌλ‘ μ€νλμ§ μμ |
Progressing | μ ν리μΌμ΄μ μ΄ μ λ°μ΄νΈ μ€ |
Suspended | λ°°ν¬κ° μ€μ§λ μν |
Missing | μ μΈλ 리μμ€κ° ν΄λ¬μ€ν°μμ λ°κ²¬λμ§ μμ |
β CLIλ₯Ό μ¬μ©ν μ ν리μΌμ΄μ μν νμΈ:
argocd app get example-app
β μΆλ ₯ μμ:
Name: example-app
Project: default
Sync Status: OutOfSync
Health Status: Degraded
πΉ Argo CD μλ¦Ό(Notification) μμ€ν μ€μ
Argo CDλ λ€μν μλ¦Ό(Notification) μ±λμ μ§μνλ©°, μ΄λ₯Ό ν΅ν΄ λ°°ν¬ μν λ³κ²½μ μ€μκ°μΌλ‘ κ°μ§ν μ μμ΅λλ€.
μ§μλλ μ£Όμ μλ¦Ό μ±λμ λ€μκ³Ό κ°μ΅λλ€.
β
μ§μλλ μλ¦Ό(Notification) μ±λ
β Slack → λ°°ν¬ μν λ³κ²½μ μ€μκ°μΌλ‘ μλ¦Ό
β Email → μ€μν μλ¦Όμ μ΄λ©μΌλ‘ μ μ‘
β Webhook → νΉμ URLλ‘ HTTP μμ²μ μ μ‘νμ¬ μΈλΆ μμ€ν
κ³Ό μ°λ
β Microsoft Teams → MS Teams μ±λμμ μλ¦Ό μμ
β Telegram → ν
λ κ·Έλ¨ λ΄μ μ΄μ©ν μλ¦Ό μ μ‘
πΉ Argo CD Notifications μ€μΉ λ° μ€μ
β 1. Argo CD Notifications μ€μΉ
Argo CDμμ μλ¦Ό κΈ°λ₯μ νμ±ννλ €λ©΄ argocd-notificationsλ₯Ό μΆκ°λ‘ μ€μΉν΄μΌ ν©λλ€.
helm repo add argo https://argoproj.github.io/argo-helm
helm repo update
helm install argocd-notifications argo/argocd-notifications -n argocd
μ€μΉ ν, μλ¦Όμ΄ μ μμ μΌλ‘ λμνλμ§ νμΈν©λλ€.
kubectl get pods -n argocd | grep notifications
β μΆλ ₯ μμ:
argocd-notifications-controller-xyz 1/1 Running 0 1m
β 2. Slack μλ¦Ό μ€μ
Slackκ³Ό μ°λνμ¬ λ°°ν¬ μνλ₯Ό μλ¦Όλ°μ μ μμ΅λλ€.
λ¨Όμ Slack Webhook URLμ μμ±ν ν, Argo CD μ€μ νμΌμ μΆκ°ν©λλ€.
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-notifications-cm
namespace: argocd
data:
service.slack: |
token: xoxb-XXXXXXXXX
webhook: https://hooks.slack.com/services/XXXX/XXXX/XXXX
μ€μ μ μ© ν, μλ¦Όμ ν μ€νΈν©λλ€.
argocd-notifications template notify-test
β Slack μλ¦Ό μμ:
[ArgoCD] example-app: Application is OutOfSync
β 3. Email μλ¦Ό μ€μ
μ΄λ©μΌμ ν΅ν μλ¦Όμ μ€μ νλ €λ©΄ SMTP μλ² μ 보λ₯Ό μΆκ°ν΄μΌ ν©λλ€.
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-notifications-cm
namespace: argocd
data:
service.email: |
smtpServer: smtp.example.com
smtpPort: 587
username: user@example.com
password: password123
from: argocd@example.com
μ€μ μ μ© ν, ν μ€νΈ μ΄λ©μΌμ λ³΄λΌ μ μμ΅λλ€.
argocd-notifications template notify-test --email user@example.com
β 4. Webhook μλ¦Ό μ€μ
μΈλΆ μμ€ν κ³Ό μ°λνμ¬ μ΄λ²€νΈλ₯Ό μ²λ¦¬νλ €λ©΄ Webhookμ μ¬μ©ν μ μμ΅λλ€.
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-notifications-cm
namespace: argocd
data:
service.webhook: |
url: http://example.com/webhook
ν μ€νΈ Webhook νΈμΆ:
argocd-notifications template notify-test --webhook example-webhook
β Webhook μμ² μμ (JSON νμ):
{
"application": "example-app",
"status": "OutOfSync",
"message": "Application is OutOfSync"
}
πΉ Argo CD μλ¦Ό μ€μ CLI λͺ λ Ήμ΄ μ 리
λͺ λ Ήμ΄ | μ€λͺ |
argocd-notifications template notify-test | μλ¦Ό ν μ€νΈ μ€ν |
argocd app get <APP> | μ ν리μΌμ΄μ μν νμΈ |
argocd-notifications template notify-test --email <EMAIL> | μ΄λ©μΌ μλ¦Ό ν μ€νΈ |
argocd-notifications template notify-test --slack <CHANNEL> | Slack μλ¦Ό ν μ€νΈ |
argocd-notifications template notify-test --webhook <URL> | Webhook μλ¦Ό ν μ€νΈ |
πΉ κ²°λ‘ : μ΄λ² κΈμμ λ°°μ΄ ν΅μ¬ λ΄μ© μ 리
π’ Argo CDλ Sync μν λ° Health μνλ₯Ό μ§μμ μΌλ‘ λͺ¨λν°λ§νμ¬ λ°°ν¬ μνλ₯Ό κ΄λ¦¬
π’ μ ν리μΌμ΄μ
μ΄ OutOfSync λλ Degraded μνκ° λλ©΄ μ¦μ κ°μ§ κ°λ₯
π’ Slack, Email, Webhook λ± λ€μν μλ¦Ό μ±λμ μ€μ νμ¬ λ°°ν¬ λ¬Έμ λ₯Ό μ μν λμ κ°λ₯
π’ Argo CD Notificationsλ₯Ό νμ©νμ¬ λ°°ν¬ μ΄λ²€νΈλ₯Ό μλμΌλ‘ κ°μ§νκ³ μλ¦Όμ μ μ‘ κ°λ₯