You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何配置ArgoCD Application从GitHub Release下载URL安装KubeBlocks CRDs?

用ArgoCD + Kustomize直接从URL安装KubeBlocks CRDs的配置方法

你可以通过以下两种方式实现,无需将CRD文件下载到本地仓库:

方法一:借助远程Git仓库存放Kustomize配置

  1. 创建一个仅包含kustomization.yaml的Git仓库(公共/私有均可),文件内容如下:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - https://github.com/apecloud/kubeblocks/releases/download/v0.9.0/kubeblocks_crds.yaml
  1. 配置ArgoCD Application对象,指向这个Git仓库:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: kubeblocks-crds
  namespace: argocd
spec:
  project: default
  source:
    repoURL: <你的Git仓库地址>
    targetRevision: main
    path: .  # 若kustomization.yaml在子目录,填写对应路径
    kustomize: {}
  destination:
    server: https://kubernetes.default.svc
    namespace: default  # CRD为集群级资源,此字段不生效,可填任意值
  syncPolicy:
    automated:
      prune: false  # 禁止自动删除CRD,避免误操作
      selfHeal: true
    syncOptions:
      - CreateNamespace=false

方法二:使用ArgoCD的Inline Kustomize配置(无需额外Git仓库)

如果你的ArgoCD版本在v2.4及以上,可以直接在Application中嵌入Kustomize配置,无需额外仓库:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: kubeblocks-crds
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://github.com/argoproj/argo-cd.git  # 占位用的Git仓库地址,可替换为任意可访问的Git仓库
    targetRevision: main
    path: .
    kustomize:
      inline:
        apiVersion: kustomize.config.k8s.io/v1beta1
        kind: Kustomization
        resources:
          - https://github.com/apecloud/kubeblocks/releases/download/v0.9.0/kubeblocks_crds.yaml
  destination:
    server: https://kubernetes.default.svc
    namespace: default
  syncPolicy:
    automated:
      prune: false
      selfHeal: true

注意事项

  • 确保ArgoCD控制平面能访问CRD文件的URL,无网络拦截或权限限制
  • CRD是集群级资源,同步时无需创建新命名空间
  • 若需更新CRD版本,仅需修改配置中的URL即可,ArgoCD会自动同步

内容的提问来源于stack exchange,提问作者mark

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.19 09:34:54