Interview Prep/Helm/Values & Precedence

How do you set nested keys, list items and keys containing dots with `--set`?

IntermediateConceptValues & Precedence
Answer
--set api.resources.limits.memory=512Mi                        # nested
--set ingress.hosts[0].host=shop.example.com                   # list index
--set 'ingress.hosts={a.example.com,b.example.com}'            # list of scalars
--set podAnnotations."prometheus\.io/scrape"=true              # escaped dot in key
--set-string 'podAnnotations.prometheus\.io/port=3000'
--set api.extraArgs=null                                        # delete a default

Commas separate multiple assignments, so a value containing a comma must be escaped (a\,b) or passed via a file. Beyond trivial overrides, a values file is more readable and reviewable.

All Helm questions Roadmap: Helm

More on Values & Precedence