argoCD:如何在argoCD中部署和靶向特定群集?

发布于 2025-01-30 02:26:49 字数 40 浏览 3 评论 0原文

在ArgoCD中,如何将部署靶向多集群环境中的特定集群或一组集群?

In ArgoCD how to target a deployment into a specific cluster or a group of clusters in a multi-cluster environment ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

各空 2025-02-06 02:26:49

我发现,部署到多个簇的正确方法是使用发电机,与选择器相似的群集:

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-applicationsetsets

I found that the right way to deploy to multiple clusters is by using generators, clusters with selectors like below:

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

Full Example:

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

More details can be found here: https://cloud.redhat.com/blog/getting-started-with-applicationsets

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文