ArgoCD:如何在ArgoCD中部署和定位特定的集群?



在ArgoCD中如何在多集群环境中将部署目标定位到特定集群或一组集群中?

我发现部署到多个集群的正确方法是使用生成器,集群与选择器,如下所示:

generators:
- clusters:
selector:
matchLabels:
staging: true

完整的示例:

apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: bgd
namespace: openshift-gitops
spec:
generators:
- clusters:
selector:
matchLabels:
bgd: dev
template:
metadata:
name: '{{name}}-bgd'
spec:
project: default
syncPolicy:
automated:
prune: true
selfHeal: true
source:
repoURL: https://github.com/christianh814/gitops-examples
targetRevision: master
path: applicationsets/cluster-generator/overlays/dev/
destination:
server: '{{server}}'
namespace: bgd

更多细节可在这里找到:https://cloud.redhat.com/blog/getting-started-with-applicationsets

相关内容

  • 没有找到相关文章

最新更新