10.07 Customizing Chart Parameters
Abstract
Helm charts come with default configuration values, but real deployments usually need customization.
Helm allows customization using:
--setcommand-line parameters- custom values files with
--valuesor-f - editing the chart locally after
helm pull --untar
In production, prefer version-controlled values files for repeatable and auditable deployments.
Why Customize Chart Parameters?
When you install a chart, Helm uses the chart's default values.yaml.
Example WordPress chart values:
wordpressUsername: user
wordpressPassword: ""
wordpressEmail: user@example.com
wordpressFirstName: FirstName
wordpressLastName: LastName
wordpressBlogName: User's Blog!
These values are injected into Kubernetes manifests using Helm templates.
Example deployment template:
env:
- name: WORDPRESS_USERNAME
value: {{ .Values.wordpressUsername | quote }}
- name: WORDPRESS_EMAIL
value: {{ .Values.wordpressEmail | quote }}
- name: WORDPRESS_BLOG_NAME
value: {{ .Values.wordpressBlogName | quote }}
Note
The chart template does not hardcode every value.
It reads values from values.yaml and renders final Kubernetes YAML during installation.
How Helm Values Work
Helm uses values in this order:
Chart default values.yaml
↓
Custom values file
↓
--set command-line overrides
↓
Rendered Kubernetes manifests
Tip
Values passed with --set override values from the default values.yaml.
Method 1: Customize with --set
Use --set for quick command-line overrides.
helm install my-release bitnami/wordpress --set wordpressBlogName="Helm Tutorials" --set wordpressEmail="john@example.com"
This overrides:
With:
Example
Use --set for small changes, quick labs, or one-time testing.
Method 2: Customize with a Values File
Create a custom values file.
Install using the custom file:
Short form:
Success
In production, use a custom values file because it is easier to review, reuse, and store in Git.
Method 3: Pull and Edit the Chart Locally
Sometimes you may want to inspect or modify the chart before installing it.
Pull the chart:
Pull and extract it:
List files:
Example chart contents:
wordpress/
├── Chart.yaml
├── values.yaml
├── values.schema.json
├── templates/
├── charts/
├── README.md
└── .helmignore
Edit the chart's values.yaml:
Install from the local chart directory:
Warning
Editing downloaded charts directly is useful for learning, but it is not the best production workflow unless the chart is maintained in your own source control.
Comparing the Three Methods
| Method | Best For | Production Recommendation |
|---|---|---|
--set |
Quick overrides | Use only for small non-sensitive values |
--values / -f |
Repeatable configuration | Preferred |
helm pull --untar |
Inspecting or modifying chart source | Use only when maintaining your own chart copy |
Example: WordPress Blog Name
Default value:
Override using --set:
Override using values file:
Note
Both approaches update the rendered Kubernetes manifests before Helm applies them to the cluster.
Example: Multiple Custom Parameters
wordpressBlogName: Helm Tutorials
wordpressEmail: john@example.com
wordpressUsername: admin
Install:
Dry run before applying:
Tip
Always test values with --dry-run --debug before applying changes to production.
View Chart Values Before Installing
Show default values:
Save default values to a file:
Edit the file:
Install with the customized file:
Success
This is a clean workflow for production because your final configuration is visible in one file.
Upgrade with Custom Values
If the release already exists, use helm upgrade.
Install if missing, upgrade if existing:
Tip
helm upgrade --install is commonly used in CI/CD pipelines.
Value Precedence
When multiple values are provided, Helm applies the later override with higher priority.
Example:
If custom-values.yaml contains:
Final value:
Warning
--set has higher priority than values files. Be careful in CI/CD pipelines where command-line overrides may silently replace file values.
Handling Secrets
Avoid this:
Why?
- It may appear in shell history
- It may be visible in process lists
- It may be stored in CI/CD logs
Better options:
Or use an existing Kubernetes Secret when the chart supports it:
Danger
Do not store production passwords, tokens, or private keys in plain text Git repositories.
Production Workflow
Recommended production workflow:
Review chart documentation
↓
Export default values
↓
Create environment-specific values file
↓
Run helm template / dry-run
↓
Install or upgrade release
↓
Store values file in Git
Example:
helm show values bitnami/wordpress > values-prod.yaml
helm template my-release bitnami/wordpress -f values-prod.yaml
helm upgrade --install my-release bitnami/wordpress -f values-prod.yaml --namespace wordpress --create-namespace
Environment-Specific Values
Use separate files per environment.
Install development:
Install production:
Success
Separate values files reduce accidental production changes.
Do's
- Use
helm show valuesbefore installing a chart - Use
-f custom-values.yamlfor repeatable deployments - Store non-sensitive values files in Git
- Use
--dry-run --debugbefore production changes - Use
helm templateto inspect generated manifests - Use separate values files for dev, test, and prod
- Pin chart versions for production
- Use existing Kubernetes Secrets for sensitive values when supported
Don'ts
- Don't rely only on default chart values
- Don't pass secrets using
--set - Don't edit downloaded charts manually without source control
- Don't use the same values file for every environment
- Don't upgrade production charts without reviewing rendered manifests
- Don't assume every chart uses the same value names
- Don't skip chart documentation
Useful Commands
| Task | Command |
|---|---|
| Show default values | helm show values <chart> |
Install with --set |
helm install <release> <chart> --set key=value |
| Install with values file | helm install <release> <chart> -f values.yaml |
| Pull chart | helm pull <chart> |
| Pull and extract chart | helm pull --untar <chart> |
| Install local chart | helm install <release> ./chart-dir |
| Render templates | helm template <release> <chart> -f values.yaml |
| Dry run install | helm install <release> <chart> -f values.yaml --dry-run --debug |
| Upgrade with values | helm upgrade <release> <chart> -f values.yaml |
| Upgrade or install | helm upgrade --install <release> <chart> -f values.yaml |
Troubleshooting
Question
Values are not changing after install?
Check:
- Did you use the correct value key?
- Did you pass the correct file with
-f? - Did
--setoverride your file value? - Did you run
helm upgradeinstead ofhelm installfor an existing release? - Did you inspect rendered YAML with
helm template?
Summary
Quote
- Helm charts use
values.yamlfor configurable parameters --setis useful for quick command-line overrides--valuesor-fis better for productionhelm pull --untarlets you inspect and edit charts locally- Use dry-run and rendered manifests before production deployment
- Avoid passing secrets directly through command-line parameters