Skip to main content

Assignment 2: Package your app as a chart

Goal: turn the app you deployed in Module 7 into your own reusable Helm chart — templated, linted, installed, and upgradeable.

Where: author the chart on the Jumpbox; install it to your own namespace on the live cluster. Use the image you pushed to the lab registry (10.100.100.6) in Module 6.

Tasks

  1. Scaffold a chart with helm create, then trim it to the essentials (Chart.yaml, values.yaml, a Deployment and Service template, _helpers.tpl, NOTES.txt).
  2. Make these things configurable via values.yaml: image repository + tag, replica count, service type and port. Point the image at your Module 6 image in the lab registry.
  3. Template the Deployment and Service to read those values (use the _helpers.tpl naming/label snippets).
  4. Run the author's loop: helm lint clean → helm template and read the output → helm install into your namespace → kubectl get all shows it Ready.
  5. Change a value (e.g. replicas 2 → 3) and helm upgrade; confirm the change took effect. Bump the chart version in Chart.yaml for the change.
  6. helm package the chart into a versioned .tgz. (Optional stretch: push it to the lab registry as an OCI chart.)

Deliverable

Your chart directory (committed to Gitea — Module 4), plus a short note with: your values.yaml, the helm lint result, a snippet of helm template output showing values substituted in, and kubectl get all proving it ran. Include the produced .tgz filename.

Acceptance criteria — you're done when:

  • helm lint ./<chart> passes with no errors.
  • helm template output shows your values.yaml values actually substituted (image, replicas, port) — not placeholders.
  • helm install produced a running release; kubectl get all -n <your-ns> shows Ready Pods and a Service.
  • A helm upgrade changed a value live, and you bumped Chart.yaml version for it.
  • helm package produced <chart>-<version>.tgz, and the chart is committed to Gitea.
  • Nothing that should be configurable is hardcoded in the templates (image tag, replicas, port all come from values).

Hints

  • helm create, helm lint, helm template, helm install, helm upgrade, helm package; kubectl get all -n <ns>.
  • Reuse the Deployment/Service shapes from Module 7 — you're templating manifests you already understand.
  • Remember nindent for blocks pulled in from _helpers.tpl.
  • Blocked for >~30 min after re-reading the lessons? Bring what you've tried to your mentor.