How to create a Kubernetes Helm chart

· Category: Kubernetes

Short answer

Helm charts templatize Kubernetes manifests. Create a chart with helm create, define values in values.yaml, and install with helm install. For building container images first, see how to build a docker image. For multi-service deployments, see how to use docker compose.

Steps

  1. Create a chart: helm create mychart
  2. Edit Chart.yaml with metadata and dependencies
  3. Define templates in the templates/ directory
  4. Set defaults and overrides in values.yaml
  5. Install: helm install myrelease ./mychart

Tips

  • Use helm lint and helm template to validate before installing
  • Store sensitive values in Kubernetes secrets, not values.yaml
  • For Dockerfile creation, see how to write a dockerfile