2.5.2. 예: 동시 배포를 위한 AllAtOnce 생성 전략
다음 예제에서는 AllAtOnce 생성 전략을 구성하여 여러 클러스터에 모든 애플리케이션을 동시에 배포하는 방법을 보여줍니다.
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: monitoring-apps
namespace: openshift-gitops
spec:
strategy:
type: AllAtOnce
generators:
- list:
elements:
- cluster: us-east-cluster
url: https://us-east-cluster.example.com
region: us-east
- cluster: us-west-cluster
url: https://us-west-cluster.example.com
region: us-west
- cluster: eu-central-cluster
url: https://eu-central-cluster.example.com
region: eu-central
template:
metadata:
name: 'monitoring-{{cluster}}'
labels:
region: '{{region}}'
spec:
project: default
source:
repoURL: https://github.com/example/monitoring-stack.git
targetRevision: HEAD
path: manifests
destination:
server: '{{url}}'
namespace: monitoring
syncPolicy:
automated:
prune: true
selfHeal: true
이 예제에서는 다음을 수행합니다.
- 모든 애플리케이션은 3개의 클러스터 모두에서 동시에 생성되고 업데이트됩니다.
- AllAtOnce 전략은 모든 클러스터 모니터링 인스턴스가 독립적이며 서로 종속되지 않기 때문에 이 모니터링 스택 배포에 적합합니다.
- ApplicationSet이 업데이트되면 모든 지역의 모든 모니터링 애플리케이션이 동시에 업데이트를 수신합니다.
- 이 방법을 사용하면 지연 없이 모든 클러스터에 일관된 모니터링 적용 범위를 배포할 수 있습니다.