简体   繁体   中英

Helm override values.yaml with set in array

I have seen many questions surrounding this topic but no good answer for what I am seeing. We have a values file like so:

ingress:
  enabled: "false"
  className: ""
  annotations:
    {}
    # kubernetes.io/ingress.class: nginx
    # kubernetes.io/tls-acme: "true"
  hosts:
    - host: chart-example.local
      paths:
        - path: /
          pathType: ImplementationSpecific

We want to override the value of the list item "host". It was my expectation that --set ingress.hosts[0].host="www.myhost.com" would do this, but we are seeing an error stating no matches found: ingress.hosts[0].host=www.myhost.com .

What am I missing? This is Helm 3.9.2.

Square brackets in Zsh have special meanings, so if you use Zsh (based on your error, I think it's the case), you need just to escape them by putting \ (backslash) before them:

--set ingress.hosts\[0\].host="www.myhost.com"

or by adding noglob before your command:

noglob helm ...

You can also escape them by default by adding this alias to your .zshrc :

alias helm='noglob helm'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM