ArgoCD
개요
ArgoCD는 Lumie 플랫폼의 GitOps 연속 배포 도구입니다. Git 저장소에서 Kubernetes로 애플리케이션을 자동으로 동기화하며, App-of-Apps 패턴을 통해 다중 애플리케이션을 관리합니다.
아키텍처
설치 및 구성
ArgoCD Application 정의
# applications/argocd/argocd.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: argocd
namespace: argocd
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: default
sources:
# ArgoCD Helm Chart
- repoURL: https://argoproj.github.io/argo-helm
chart: argo-cd
targetRevision: 7.7.10
helm:
valueFiles:
- $values/applications/argocd/helm-values.yaml
# Common chart values
- repoURL: https://github.com/Lumie-Edu/lumie-infra.git
targetRevision: main
ref: values
path: charts/common
helm:
valueFiles:
- $values/applications/argocd/common-values.yaml
destination:
server: https://kubernetes.default.svc
namespace: argocd
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- ServerSideApply=true
- RespectIgnoreDifferences=true
핵심 설정
글로벌 설정
# helm-values.yaml
global:
priorityClassName: high-priority # 높은 우선순위 설정
ConfigMap 설정 (argocd-cm)
configs:
cm:
# Authelia 인증 통합
users.anonymous.enabled: "true"
# 폴링 비활성화 (웹훅만 사용)
timeout.reconciliation: "0"
# 리소스 상태 필드 차이 무시
resource.compareoptions: |
ignoreResourceStatusField: all
# Tekton 동적 리소스 제외
resource.exclusions: |
- apiGroups:
- tekton.dev
kinds:
- PipelineRun
- TaskRun
# Kustomize Helm 지원 활성화
kustomize.buildOptions: --enable-helm
# Ingress 커스텀 헬스 체크
resource.customizations.health.networking.k8s.io_Ingress: |
hs = {}
hs.status = "Healthy"
return hs
서버 파라미터 (argocd-cmd-params-cm)
configs:
params:
# TLS 비활성화 (Ingress에서 처리)
server.insecure: "true"
# 자가 치유 타임아웃
controller.self.heal.timeout.seconds: "5"
RBAC 설정 (argocd-rbac-cm)
configs:
rbac:
# 익명 사용자에게 admin 역할 부여 (Authelia가 인증 처리)
policy.csv: |
g, , role:admin
policy.default: role:admin
컴포넌트별 설정
1. Application Controller
controller:
# Prometheus 메트릭스
metrics:
enabled: true
service:
enabled: true
servicePort: 8082
serviceMonitor:
enabled: true
# 메모리 최적화
env:
- name: GOMEMLIMIT
value: "800MiB"
- name: GOGC
value: "50"
# 성능 최적화 인수
extraArgs:
- --app-resync=3600 # 앱 재동기화 간격
- --app-hard-resync=0 # 하드 재동기화 비활성화
- --status-processors=10 # 상태 프로세서 수
- --operation-processors=5 # 작업 프로세서 수
# 리소스 설정
resources:
requests:
cpu: 130m
memory: 1024Mi
limits:
memory: 1024Mi # CPU 제한 없음 (안정성)
2. API Server
server:
# Prometheus 메트릭스
metrics:
enabled: true
service:
enabled: true
servicePort: 8083
serviceMonitor:
enabled: true
# Ingress 비활성화 (Teleport 접근)
ingress:
enabled: false
# 리소스 설정
resources:
requests:
cpu: 15m
memory: 105Mi
limits:
memory: 105Mi
3. Repo Server
repoServer:
# Prometheus 메트릭스
metrics:
enabled: true
service:
enabled: true
servicePort: 8084
serviceMonitor:
enabled: true
# 리소스 설정 (Helm 차트 처리를 위한 메모리 증가)
resources:
requests:
cpu: 25m
memory: 512Mi
limits:
memory: 512Mi
# 프로브 타임아웃 증가
livenessProbe:
enabled: true
timeoutSeconds: 5
readinessProbe:
enabled: true
timeoutSeconds: 5
4. Redis
redis:
resources:
requests:
cpu: 15m
memory: 100Mi
limits:
memory: 100Mi
5. ApplicationSet Controller
applicationSet:
enabled: true
resources:
requests:
cpu: 10m
memory: 64Mi
limits:
memory: 64Mi
네트워킹 설정
폴링 모드 (Webhook 없음)
ArgoCD는 외부 Webhook Ingress를 사용하지 않습니다. common-values.yaml에 ingress: enabled: false가 설정되어 있으며, timeout.reconciliation: "0" 설정으로 폴링 대신 Gitea 저장소 변경 시 수동 또는 ArgoCD 내부 RefreshInterval로 동기화합니다.
# argocd-cm (helm-values.yaml)
configs:
cm:
timeout.reconciliation: "0" # 폴링 비활성화
UI 접근
- 내부 접근: Teleport를 통한 보안 터널 (
argocd.lumie-infra.com)