【问题标题】:Argo helm chart does not apply my custom values.yml fileArgo helm chart 不应用我的自定义 values.yml 文件
【发布时间】:2021-04-23 18:15:58
【问题描述】:

我将带有 Helm 3 的 Argo 部署到我的集群

helm upgrade --install argo argo/argo-cd -n argocd -f argovalues.yaml

我的argovalues.yml 文件如下

global.image.tag: "v2.0.1"
server.service.type: "NodePort"
server.name: "kabamaru"
server.ingress.enabled: true
server.metrics.enabled: true
server.additionalApplications: |
  - name: guestbook
    namespace: argocd
    additionalLabels: {}
    additionalAnnotations: {}
    project: default
    source:
      repoURL: https://github.com/argoproj/argocd-example-apps.git
      targetRevision: HEAD
      path: guestbook
      directory:
        recurse: true
   destination:
      server: https://kubernetes.default.svc
      namespace: argocd
   syncPolicy:
     automated:
       prune: false
       selfHeal: false

并且....这些值都没有应用。这非常令人沮丧。

如果我执行以下操作

helm upgrade --install argo argo/argo-cd -n argocd --set server.name=hello

它工作并成功更改! 到底是怎么回事?

【问题讨论】:

  • 您是否尝试使用全名标志--values 而不是仅使用-f
  • Tbh no .... 我试试看!
  • 不,没有任何反应。没有错误,但也没有变化。

标签: kubernetes-helm argocd


【解决方案1】:

我正在使用带有选项 --set-file 的 helm chart upgrade 命令,它工作正常:

helm upgrade --install argo argo/argo-cd -n argocd --set-file argovalues.yaml

还有像 --set--set-string 这样的其他选项: 我认为这可以帮助您解决问题。

【讨论】:

  • 错误:解析失败 --set-file 数据:键映射“argovalues”没有值
【解决方案2】:

解决方案

我设法让它像这样工作:

argovalues.yaml

server:

  service:
    type: "NodePort" #by default 80:30080/TCP,443:30443/TCP

  image:
    tag: "v2.0.1"

  autoscaling:
    enabled: true

  ingress:
    enabled: true

  metrics:
    enabled: true

  additionalApplications:
   - name: bootstrap
     namespace: argocd
     additionalLabels: {}
     additionalAnnotations: {}
     project: default
     source:
       repoURL: https://github.com/YOUR_REPO/argotest.git
       targetRevision: HEAD
       path: bootstrap
       directory:
         recurse: true
     destination:
       server: https://kubernetes.default.svc
       namespace: argocd
     syncPolicy:
      automated:
        prune: true
        selfHeal: false

注意:错误的缩进会让你发疯!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-04-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-31
    • 2021-05-09
    • 2021-09-15
    相关资源
    最近更新 更多