World map

 

BM: Baca dalam Bahasa Melayu

World K4: Notes, Lockers & Packages

Write a small chart

You will learn: what is inside a Helm chart, and how values fill its templates.

Checked with Kubernetes 1.37 on 31 Oct 2026

The problem

You are here: cluster kind-dev namespace default
helm template ./kedai with no release name prints a Service and a Deployment named release-name-kedai. Terminal output: $ helm template ./kedai --- # Source: kedai/templates/service.yaml apiVersion: v1 kind: Service metadata: labels: app.kubernetes.io/instance: release-name app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: kedai app.kubernetes.io/version: 1.0.0 helm.sh/chart: kedai-0.1.0 name: release-name-kedai spec: ports: - name: http port: 80 protocol: TCP targetPort: http selector: app.kubernetes.io/instance: release-name app.kubernetes.io/name: kedai type: ClusterIP --- # Source: kedai/templates/deployment.yaml apiVersion: apps/v1 kind: Deployment metadata: labels: app.kubernetes.io/instance: release-name app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: kedai app.kubernetes.io/version: 1.0.0 helm.sh/chart: kedai-0.1.0 name: release-name-kedai spec: replicas: 2 selector: matchLabels: app.kubernetes.io/instance: release-name app.kubernetes.io/name: kedai template: metadata: labels: app.kubernetes.io/instance: release-name app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: kedai app.kubernetes.io/version: 1.0.0 helm.sh/chart: kedai-0.1.0 spec: containers: - image: nginx:1.29-alpine imagePullPolicy: IfNotPresent name: kedai ports: - containerPort: 80 name: http protocol: TCP

Your team copies shop.yaml for every new stall. Only the name, the image and the tray count change. Write the YAML once, with holes.

Watch

Drag a card into a box. Or tap the card, then tap the box.

        A chart is a folder in three parts. Chart.yaml is the label. values.yaml holds the defaults. templates/ holds YAML with holes.

        Watch

        A piece of templates/deployment.yaml. Tap every line with a hole.

        0 of 3 found

        Each {{ }} is a hole. Helm fills .Values holes from values: The order form for a chart, like replicaCount or the image tag. values.yaml holds the defaults.: values.yaml, or your --set.

        Try it

        Fill the image hole with 1.30-alpine. Look at the image line.

        You are here: cluster kind-dev namespace default
        Stalls: 3. Trays: 0 (0 ready). Waiting for a stall: 0.
        dev-control-planeOpenManager

        No trays here.

        dev-workerOpen

        No trays here.

        dev-worker2Open

        No trays here.

        Time: +0s (sped up)

        Predict

        values.yaml says replicaCount: 2. You add --set replicaCount=4. What does the YAML say?

        Pick one answer.

        Check

        Good chart habit or not? Swipe each one.

        Swipe right for good, left for needs work. Or use the buttons.

        1 / 4

        Put the image tag in values.yaml, not in the template.

        Put the image tag in values.yaml, not in the template.

        Check

        You run helm template pasar ./kedai. What is the Deployment called?

        Pick one answer.

        You did it!

        You can now read a small chart and fill it with values.

        Go deeper (optional)

        helm create kedai makes a starter chart like this one. helm lint ./kedai finds mistakes. helm package ./kedai makes a .tgz to share. Templates use Go templates, so {{ .Values.name | quote }} wraps a value in quotes. Chart.yaml starts with apiVersion: v2.

        Real rep (optional), on your own machine with Helm 4:

        Real mission

        1. helm create kedai
        2. helm lint ./kedai
        3. helm template shop ./kedai --set replicaCount=3
        4. rm -r kedai

        0 of 5 steps done · Your ticks are saved.