apiVersion: argoproj.io/v1alpha1 kind: ApplicationSet metadata: name: victoria-metrics namespace: platform spec: goTemplate: true goTemplateOptions: ["missingkey=error"] generators: - list: # 각 element: 차트 경로 + 베이스값(카탈로그 custom-values 재사용) + 환경 오버레이(값 repo) + syncWave elements: # ── syncWave 0: 저장소·무의존 ──────────────────────────────────── - name: vmcluster chartPath: manifests/helm/victoria-metrics-cluster/0.43.0 baseValues: custom-values.yaml valuesPath: victoria-metrics/vmcluster-values.yaml syncWave: "0" - name: vlogs chartPath: manifests/helm/victoria-logs-cluster/0.1.5 baseValues: custom-values.yaml valuesPath: victoria-metrics/vlogs-values.yaml syncWave: "0" - name: kube-state-metrics chartPath: manifests/helm/kube-state-metrics/7.4.0 baseValues: custom-values.yaml valuesPath: victoria-metrics/kube-state-metrics-values.yaml syncWave: "0" - name: node-exporter chartPath: manifests/helm/prometheus-node-exporter/4.55.0 baseValues: custom-values.yaml valuesPath: victoria-metrics/node-exporter-values.yaml syncWave: "0" - name: alertmanager chartPath: manifests/helm/alertmanager/1.37.0 baseValues: custom-values.yaml valuesPath: victoria-metrics/alertmanager-values.yaml syncWave: "0" # ── syncWave 1: 저장소·alertmanager 의존 ───────────────────────── - name: vmauth chartPath: manifests/helm/victoria-metrics-auth/0.33.0 baseValues: custom-values.yaml valuesPath: victoria-metrics/vmauth-values.yaml syncWave: "1" - name: vmagent chartPath: manifests/helm/victoria-metrics-agent/0.40.0 baseValues: custom-values.yaml valuesPath: victoria-metrics/vmagent-values.yaml syncWave: "1" - name: otelcol chartPath: manifests/helm/opentelemetry-collector/0.156.2 baseValues: custom-values.yaml valuesPath: victoria-metrics/otelcol-values.yaml syncWave: "1" - name: otelcol-events chartPath: manifests/helm/opentelemetry-collector/0.156.2 baseValues: custom-values-events.yaml valuesPath: victoria-metrics/otelcol-events-values.yaml syncWave: "1" - name: vmalert chartPath: manifests/helm/victoria-metrics-alert/0.41.0 baseValues: custom-values.yaml valuesPath: victoria-metrics/vmalert-values.yaml syncWave: "1" # ── syncWave 2: vmauth 의존 ────────────────────────────────────── - name: perses chartPath: manifests/helm/perses/0.21.0 baseValues: custom-values.yaml valuesPath: victoria-metrics/perses-values.yaml syncWave: "2" template: metadata: name: "{{ .name }}" namespace: platform annotations: argocd.argoproj.io/sync-wave: "{{ .syncWave }}" spec: project: default sources: # Source 1: 카탈로그 repo (Helm 차트) - repoURL: https://gitea.example.org/dip/service-catalog targetRevision: master path: "{{ .chartPath }}" helm: releaseName: "{{ .name }}" valueFiles: - "{{ .baseValues }}" # 카탈로그 차트의 정적 베이스값(custom-values) - $values/{{ .valuesPath }} # Source 2의 환경 오버레이 (나중 = 우선) # Source 2: 값(values) repo — dip-console이 렌더한 환경별 값 - repoURL: https://gitea.example.org/dip/tenant-catalog targetRevision: master ref: values destination: server: https://kubernetes.default.svc namespace: monitoring # StatefulSet volumeClaimTemplates는 immutable + K8s가 volumeMode 등 기본값을 자동 주입 → # 영구 OutOfSync 방지(vmstorage/vlstorage). VCT 변경은 어차피 적용 불가라 무시. ignoreDifferences: - group: apps kind: StatefulSet jsonPointers: - /spec/volumeClaimTemplates syncPolicy: automated: prune: true selfHeal: true syncOptions: - CreateNamespace=true - ServerSideApply=true retry: limit: 5 backoff: duration: 10s factor: 2 maxDuration: 3m