2.5.4. 예: 환경 라벨과 진행 중인 동기화
다음 예제에서는 환경 라벨을 사용하여 애플리케이션을 점진적으로 동기화하는 방법을 보여줍니다.
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: cluster-apps
namespace: openshift-gitops
spec:
strategy:
type: RollingSync
rollingSync:
steps:
- matchExpressions:
- key: envLabel
operator: In
values:
- env-dev
- matchExpressions:
- key: envLabel
operator: In
values:
- env-prod
maxUpdate: 10%
generators:
- list:
elements:
- cluster: dev-cluster
url: https://dev-cluster.example.com
envLabel: env-dev
- cluster: prod-cluster
url: https://prod-cluster.example.com
envLabel: env-prod
template:
metadata:
name: '{{cluster}}-app'
labels:
envLabel: '{{envLabel}}'
spec:
project: default
source:
repoURL: https://github.com/example/repo.git
targetRevision: HEAD
path: apps
destination:
server: '{{url}}'
namespace: default
이 예제에서는 다음을 수행합니다.
-
1단계는
envLabel: env-dev레이블을 사용하여 애플리케이션을 업데이트합니다. -
2단계는
envLabel: env-prod레이블로 애플리케이션을 업데이트하고, 최대 10%의 프로덕션 애플리케이션이 동시에 업데이트됩니다.