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

Values Files and Default Values

Define configurable parameters in values.yaml and understand how defaults enable chart customization without template changes.

Values Files and Default Values

What you'll learn: How to define configurable parameters in values.yaml and use defaults to customize Helm charts without modifying templates.

The Core Idea

Think of a Helm chart as a customizable blueprint for your Kubernetes application. The values.yaml file is like a configuration menu where you set all the tuneable knobs—replica counts, image versions, resource limits—without touching the actual template code. Default values act as sensible presets, so users can deploy immediately or override just what they need.

When you create a chart, you define default values in the values.yaml file at the chart's root. These values are referenced in your templates using Go templating syntax (.Values.something). If a user doesn't provide custom values during installation or upgrade, Helm uses these defaults.

How It Works

Your chart's values.yaml might look like:

replicaCount: 2
image:
  repository: nginx
  tag: "1.21"
service:
  port: 80

Users can override any value:

  • At install time: helm install myapp ./mychart --set replicaCount=5
  • With custom values file: helm install myapp ./mychart -f custom-values.yaml

The beauty? Your templates remain unchanged. They simply reference {{ .Values.replicaCount }} and adapt automatically.

Why This Matters

Separating configuration from code means one chart can serve development, staging, and production environments with different values files. You maintain one set of templates, and users customize behavior declaratively without forking or editing your chart.

Key Takeaway: The values.yaml file defines default, customizable parameters that users can override during deployment, enabling flexible chart reuse without template modifications.