IT 3300 : Virtualization

Kubernetes — Helm

The problem

  • A real app is many manifests: Deployment, Service, Ingress,
    ConfigMap, Secret, PVC...
  • Copy/pasting and hand-editing per environment doesn't scale
  • You need packaging and templating

Helm = the package manager for k8s

  • Chart — a packaged app: templated YAML + defaults
  • Values — the knobs you set per install
  • Release — one installed instance of a chart

Install a public chart

    helm repo add bitnami https://charts.bitnami.com/bitnami
    helm repo update
    helm install mydb bitnami/mysql
    helm list
    helm uninstall mydb
  • One command installs a whole, production-shaped app

Values

  • Charts expose settings via values.yaml

  • Override on the command line or with a file:

      helm install web ./mychart --set replicaCount=3
      helm install web ./mychart -f prod-values.yaml
    
  • Same chart, different config per environment

Chart structure

mychart/
  Chart.yaml        # name, version
  values.yaml       # default settings
  templates/        # templated k8s manifests
    deployment.yaml
    service.yaml
  • Templates use {{ .Values.replicaCount }} style placeholders

Upgrade & rollback

    helm upgrade web ./mychart -f prod-values.yaml
    helm history web
    helm rollback web 1
  • Versioned releases, clean rollbacks — like Deployments, for whole apps

Why it matters

  • It's how most software ships to Kubernetes today
  • One command to deploy Prometheus, Ingress-NGINX, databases, etc.
  • Turns "50 YAML files" into "one release with values"

Lab goals

  • Install an app (e.g. a database) from a public chart with custom values
  • Upgrade it, then roll it back
  • (Stretch) Package your own app as a simple chart