How to set multiple values with helm?
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
Helm provides several ways to set multiple values: --set key=value flags (inline, one per flag), -f values.yaml files (bulk configuration), --set-string for explicit string values, and --set-json for complex structures. For production use, prefer values files (-f) for readability and version control. Use --set for quick overrides and CI/CD pipelines. Multiple -f files are merged left to right, with later files taking precedence.
Method 1: Multiple --set Flags
Each --set flag sets one key-value pair. Nested keys use dot notation.
Method 2: Comma-Separated --set
This is more compact but harder to read for many values.
Method 3: Values Files (-f)
Method 4: Multiple Values Files (Merged)
Method 5: --set with Complex Types
Arrays/Lists
--set-string for Explicit Strings
--set-json for Complex Structures
Method 6: --set with --values Combined
--set flags always take precedence over -f files.
Helm Upgrade with Values
Debugging Values
Common Pitfalls
- Values containing commas in a single
--setflag: Commas separate key-value pairs in--set. If a value contains a comma, it splits incorrectly. Escape commas with\,:--set annotation="app\,version=1", or use--set-jsoninstead. - Helm interpreting numeric strings as numbers:
--set image.tag=1.25sets the value to the float1.25, not the string"1.25". Use--set-string image.tag=1.25or quote in YAML:tag: "1.25"to ensure it stays a string. - Not quoting special characters in shell: Values with
!,$,{, or spaces need quoting:--set "password=my\!pass"or--set 'password=my!pass'. Without quotes, the shell interprets these characters. - Using
--reuse-valueswithout understanding merge behavior:--reuse-valuestakes the values from the last release and merges your new--setflags. If the chart added new default values in an update, those defaults are not applied because the old values take priority. - Overriding nested maps with
--setinstead of merging:--set resources.limits.cpu=500monly sets that one key. But--set-json 'resources={"limits":{"cpu":"500m"}}'replaces the entireresourcesmap, deleting any existingrequestssection. Be aware of set vs replace semantics.
Summary
- Use
-f values.yamlfor bulk configuration — readable, version-controlled, and mergeable - Use
--set key=valuefor quick overrides and CI/CD pipelines - Use
--set-stringto prevent numeric or boolean interpretation of string values - Use
--set-jsonfor complex structures like arrays and nested objects - Multiple
-ffiles merge left to right;--setalways takes highest precedence
Related reading
- How to set node taints using Terraform for Amazon EKS
- How to set secodary key for kubernetes ingress basic-auth
- How to set secret files to kubernetes secrets by yaml?
- How to set the workdir of a container launched by Kubernetes
- How to set the time zone in Amazon EC2?
- How to set up Spring Boot and log4j2 properly?
- How to set user name in container of kubernetes pod?
- how to setup basic rabbitmq on kubernetes

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.