How to pass variables from parent to child in helm?
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
In Helm, parent charts do not call child charts like functions. Instead, the parent passes values by placing them under the child chart's key in the parent values.yaml, or by using the special global section for values that should be visible across multiple charts.
Pass child-specific values under the child chart name
If a parent chart depends on a child chart named redis, values for that child go under the redis key in the parent chart.
Inside the child chart, those values are accessed normally as .Values.replicaCount and .Values.image.tag. The child does not write .Values.redis.replicaCount because Helm already scopes the child chart to its own subtree.
That scoping rule is the core idea. The parent shapes the values tree, and Helm passes the relevant branch into the child as that child's .Values.
Use global for shared values
When several subcharts need the same value, place it under global.
Then any chart can read the shared values:
This is useful for shared registry prefixes, domain names, environment labels, or other settings that should stay consistent across multiple dependencies.
Example parent and child flow
Suppose the parent declares a dependency in Chart.yaml and wants to set the child service type:
The child template stays clean because it reads the value as if it were local. Helm handles the wiring from the parent.
Aliases and command-line overrides
If a dependency is aliased, the alias name becomes the key that the parent uses for values. That is an easy place to make mistakes when a chart dependency was renamed for readability.
The same scoping rule applies to command-line overrides. For example, --set metrics.service.type=LoadBalancer targets the child through the parent values tree, not through some special subchart API.
What a child cannot do directly
A child chart should not assume it can read arbitrary parent values outside its own scope. That would make the chart tightly coupled and difficult to reuse. If a child needs something, expose it through its own values interface or use global deliberately.
This is an important design constraint. Good subcharts behave like reusable components with documented inputs, not like templates that reach upward into undocumented parent internals.
Common Pitfalls
- Writing parent values under the wrong key, so the child never receives them.
- Trying to access
.Values.parent.someValueinside a child chart instead of using scoped child values orglobal. - Overusing
globalfor everything and turning chart configuration into a hard-to-maintain shared namespace. - Forgetting that aliased dependencies use the alias name for values scoping.
- Failing to document the child chart inputs, which makes parent configuration brittle.
Summary
- Parent-to-child values are passed by nesting them under the child chart's key in the parent values file.
- Inside the child, those values appear as normal
.Valuesentries. - Use
globalonly for settings that are intentionally shared across charts. - Keep child charts reusable by defining explicit inputs rather than reaching into parent-only state.
- Helm value scoping is predictable once you think in terms of chart boundaries instead of template inheritance.
Related reading
- How to patch a ConfigMap in Kubernetes
- how to patch configmap field using python client library
- How to persist data using a postgres database, Docker, and Kubernetes?
- How to prevent scale down of newly scaled up pod for specific period of time which was created by HPA in Kubernetes?
- How to properly recover a K8s cluster after reboot?
- How to publicly expose Traefik ingress controller on Google Cloud Container Engine?
- How to pull docker images hosted on Google Container Registry via Kubernetes kubernetes included on docker for desktop
- How to pull environment variables with Helm charts

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.