Helm Chart Reading
values.yaml, Go template expressions, upgrade --install, Chart.yaml versions, conditional rendering — reading Helm charts in plain English
Helm chart vocabulary
- values.yaml — default config; overridden with
-f file.yamlor--set key=value - {{ .Values.key }} — Go template expression; replaced with value from values.yaml at render time
- helm upgrade --install — idempotent: install if new, upgrade if exists; safe for CI/CD
- Chart.yaml: version = chart package version; appVersion = application version being packaged
- {{ if .Values.key }} — conditional rendering; the block only appears in the manifest if the value is truthy
Question 0 of 5
Read this Helm values.yaml. What does replicaCount: 2 do?# values.yaml
replicaCount: 2
image:
repository: myapp
tag: "1.5.0"
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 80
- values.yaml — the chart's default configuration; all values can be overridden by users
- Override methods:
--set replicaCount=5(CLI),-f custom-values.yaml(file), or--set-stringfor strings - Template reference — in templates, accessed as
{{ .Values.replicaCount }} - Hierarchy — default values.yaml < user -f file < --set flags (last wins)
What is {{ .Values.image.tag }} in this Helm template?# templates/deployment.yaml
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: {{ .Values.service.port }}
- {{ }} — Go template action; everything inside is evaluated and replaced with its result
- .Values — the root object containing all values from values.yaml and overrides
- .Values.image.tag — navigates the nested structure: image section, tag key
- .Chart.Name — built-in object; the chart's name from Chart.yaml
- helm template — renders templates locally without deploying; useful for debugging
image: "myapp:1.5.0". Override: helm upgrade myapp . --set image.tag=2.0.0What does helm upgrade --install do, compared to separate install and upgrade commands?helm upgrade --install myapp ./chart \
--namespace production \
--create-namespace \
-f values.prod.yaml \
--wait
- helm install — fails if the release already exists
- helm upgrade — fails if the release does not exist
- upgrade --install — handles both cases; safe to run repeatedly
- --create-namespace — creates the namespace if it doesn't exist
- -f values.prod.yaml — overrides default values with production-specific settings
- --wait — blocks until all Pods are ready (readinessProbe passes) before returning success
Read this Chart.yaml. What is the difference between appVersion and version?apiVersion: v2
name: myapp
description: My application Helm chart
type: application
version: 3.1.0
appVersion: "1.5.0"
- version — the chart's SemVer version; increment when the chart's templates, values, or structure change
- appVersion — the version of the application the chart deploys; used for display/documentation; doesn't affect chart behaviour
- Example: chart version 3.1.0 might package app version 1.5.0; a chart bug fix bumps chart to 3.1.1 but appVersion stays 1.5.0
- apiVersion: v2 — required for Helm 3 charts (v1 is Helm 2)
helm list shows both: the chart version in the "CHART" column and appVersion separately.What does the {{ if .Values.ingress.enabled }} block control in this Helm template?{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "myapp.fullname" . }}
spec:
rules:
- host: {{ .Values.ingress.host }}
{{- end }}
- {{- if .Values.key }} — renders the block only if the value is truthy (true, non-zero, non-empty)
- {{- end }} — closes the if block; the
-strips surrounding whitespace - use case — optional resources: ingress, horizontal pod autoscaler, service account, RBAC rules — include them only when the user sets the flag
- {{ include "myapp.fullname" . }} — calls a named template (defined in _helpers.tpl) to generate a consistent resource name
ingress.enabled: false in values.yaml; override with --set ingress.enabled=true --set ingress.host=myapp.example.com.