Medium java docker

What is Helm, and how do charts work?

The 30 second answer

Helm is a package manager for Kubernetes: a chart is a set of templates plus a values file that render into ordinary YAML manifests. helm install (or upgrade) applies the release, records revision history, and can roll back. I use a chart when I need the same Deployment, Service and config in several environments, with only values changing. I still have to understand the rendered YAML; Helm does not remove that responsibility.

Could you say this in an interview?

Helm's documentation describes a chart as a packaged Kubernetes application: a Chart.yaml, a templates/ directory of Go templates, and values.yaml defaults. helm template or helm install fills the templates with values and produces standard Kubernetes objects.

A release is a particular installation of a chart in a cluster, with its own values and revision history. helm upgrade creates a new revision; helm rollback returns to an earlier one. That is the operational reason to use Helm rather than a one-off kubectl apply.

I keep environment differences in values files (values-prod.yaml), not in a fork of the templates. I look at helm diff or helm template in CI so a values change is reviewable. Third-party charts still need the same scrutiny as any YAML I did not write: image, RBAC, and default passwords.

# chart layout
checkout/
  Chart.yaml
  values.yaml
  templates/deployment.yaml
  templates/service.yaml
# templates/service.yaml
apiVersion: v1
kind: Service
metadata:
  name: {{ include "checkout.fullname" . }}
spec:
  selector:
    app: {{ include "checkout.name" . }}
  ports:
    - port: {{ .Values.service.port }}
      targetPort: 8080
helm upgrade --install checkout ./checkout -f values-prod.yaml
Sources (3)
  1. Helm: Chartshelm.sh
  2. Helm: Using Helm (install, upgrade, rollback)helm.sh
  3. Helm: Values fileshelm.sh