0
0
KubernetesConceptBeginner · 3 min read

What is values.yaml in Helm: Explained Simply

In Helm, values.yaml is a file that stores default configuration settings for a chart. It lets you customize your Kubernetes app by changing values without editing the main templates.
⚙️

How It Works

Think of values.yaml as a menu where you pick options for your Kubernetes app. Instead of changing the recipe (templates) every time, you just select different ingredients (values) from this menu.

When you install a Helm chart, Helm reads values.yaml to fill in the blanks in the templates. You can override these defaults by providing your own values, making it easy to reuse charts for different setups.

💻

Example

This example shows a simple values.yaml file and how it controls the app's configuration.

yaml
replicaCount: 3
image:
  repository: nginx
  tag: stable
  pullPolicy: IfNotPresent
service:
  type: ClusterIP
  port: 80
Output
Helm uses these values to create Kubernetes objects like Deployments with 3 replicas of the nginx image tagged 'stable' and a ClusterIP service on port 80.
🎯

When to Use

Use values.yaml whenever you want to make your Helm charts flexible and reusable. It is perfect for setting default app settings like image versions, replica counts, or service ports.

For example, if you deploy the same app to development and production, you can keep one chart but use different values.yaml files to customize each environment easily.

Key Points

  • Central place: Stores default config for Helm charts.
  • Overrides: Users can override values at install time.
  • Reusable: Makes charts adaptable for different environments.
  • Simple: Uses YAML format, easy to read and edit.

Key Takeaways

values.yaml holds default settings for Helm charts in YAML format.
It allows easy customization without changing chart templates.
Use it to adapt charts for different environments or needs.
Overrides can be provided during Helm install or upgrade.
It makes Helm charts reusable and flexible.