ApplicationSets
목차
ApplicationSet 개요
기본 구조
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: my-applicationset
namespace: argocd
spec:
# 생성기: Application 생성에 사용할 데이터 소스
generators:
- list:
elements:
- name: dev
namespace: dev
- name: staging
namespace: staging
# 템플릿: 생성될 Application의 템플릿
template:
metadata:
name: 'myapp-{{name}}'
spec:
project: default
source:
repoURL: https://github.com/myorg/myapp.git
targetRevision: main
path: 'environments/{{name}}'
destination:
server: https://kubernetes.default.svc
namespace: '{{namespace}}'
syncPolicy:
automated:
prune: true
selfHeal: true
# 동기화 정책
syncPolicy:
preserveResourcesOnDeletion: false # ApplicationSet 삭제 시 Application도 삭제
# 전략
strategy:
type: RollingSync
rollingSync:
steps:
- matchExpressions:
- key: env
operator: In
values:
- dev
- matchExpressions:
- key: env
operator: In
values:
- staging생성기 (Generators)
1. List Generator
2. Cluster Generator
3. Git Generator - Directory
4. Git Generator - File
5. Matrix Generator
6. Merge Generator
7. SCM Provider Generator
8. Pull Request Generator
9. Cluster Decision Resource Generator
10. Plugin Generator
Go 템플릿
Go 템플릿 함수
Progressive Syncs
Progressive Sync 흐름
멀티 클러스터 배포 패턴
패턴 1: 환경별 배포
패턴 2: 리전별 배포
패턴 3: 테넌트별 배포
템플릿 오버라이드
생성기별 템플릿 오버라이드
템플릿 병합 동작
다음 단계
참고 자료
퀴즈
마지막 업데이트