Course contentsShow
← Cloud and Infrastructure
Lesson 1553 of 2,98931. Helm Package ManagerFree lesson

Subchart Overrides and Global Values

Override subchart values and use global values to share configuration across parent and child charts.

Subchart Overrides and Global Values

What you'll learn: How to configure subcharts from parent charts and share values across your entire Helm chart hierarchy.

When your Helm chart includes dependencies (subcharts), you often need to customize their behavior without editing their source. Helm provides two mechanisms for this: subchart overrides and global values.

Subchart Overrides

To override values in a subchart, nest them under the subchart's name in your parent chart's values.yaml:

# Parent chart values.yaml
myapp:
  replicas: 3

postgresql:  # subchart name
  auth:
    username: myuser
    database: mydb
  primary:
    persistence:
      size: 10Gi

The parent chart can pass specific configuration down to the postgresql subchart without modifying the subchart itself. This is like providing custom settings to a plugin—you're configuring it for your use case while keeping it reusable.

Global Values

Global values are shared across all charts in the hierarchy—parent and all subcharts. Define them under the global key:

# Parent chart values.yaml
global:
  environment: production
  registry: myregistry.io
  
myapp:
  image: app:1.0
  
redis:
  image: redis:alpine

Both parent templates and subchart templates can access {{ .Values.global.environment }}. This prevents repetition when multiple charts need the same configuration (like a container registry URL or cluster region).

Key Takeaway: Use subchart overrides to customize individual dependencies and global values to share common configuration across your entire chart hierarchy—keeping your Helm deployments DRY (Don't Repeat Yourself) and maintainable.