Project 6 of 12 · project brief
Package Everything as Helm Charts
Turn the Kubernetes manifests into a reusable, tested, versioned Helm chart with per-environment values.
The scenario
Copy-pasting YAML for dev, staging, and prod is already causing drift: prod has a probe that dev doesn't. Your brief: package the services as Helm charts with sensible defaults and environment values files, test them, and publish them to a chart repository.
Before you start
- Kubernetes · Helm fundamentals
Charts, values, releases.
- Kubernetes · Writing a chart
Templates, helpers, and values design.
- Kubernetes · Hooks & dependencies
Subcharts and migration hooks.
Stack
Target architecture
Deliverables and requirements
You will hand in
- A generic
shoplite-servicechart used by api, worker, and frontend (DRY) - An umbrella chart with dependencies and per-environment values files
- Unit tests (helm-unittest) and CI that lints, validates, and installs the chart
- Charts published to an OCI registry with semantic versions
Functional
helm install shoplite charts/shoplite -f values-dev.yamldeploys the whole app- Prod values change replicas, resources, and hostnames only, without template changes
helm rollbackrestores the previous release
Non-functional
- Templates use helpers for names/labels (
app.kubernetes.io/*) values.schema.jsonvalidates inputs- Chart version bumped on every change
Milestones
- 1
A generic service chart
Done when: One chart that renders Deployment, Service, HPA, PDB, and ServiceAccount from values.
helm createand prune; standard labels in_helpers.tpl- Values for image, env, probes, resources, autoscaling, PDB
values.schema.jsonrequiring image.repository and image.tag
Prove it works
terminal$ helm template api charts/shoplite-service -f examples/api.yaml | kubeconform -strict -summary── expected output ──Summary: 5 resources found in 1 file - Valid: 5, Invalid: 0, Errors: 0, Skipped: 0 - 2
Umbrella chart and environments
Done when: The whole app as one release, with dev/prod values.
charts/shoplite/Chart.yamldependencies: 3 × shoplite-service (aliases api, worker, frontend) + postgresql/redis subcharts (dev only viacondition)values-dev.yamlandvalues-prod.yaml(prod uses managed databases: subcharts disabled, external hosts set)helm dependency update
Prove it works
terminal$ helm upgrade --install shoplite charts/shoplite -n shoplite -f charts/shoplite/values-dev.yaml --wait && helm list -n shoplite── expected output ──NAME NAMESPACE REVISION STATUS CHART APP VERSIONshoplite shoplite 1 deployed shoplite-0.4.0 1.4.0 - 3
Tests and CI
Done when: Chart changes are validated automatically.
- helm-unittest: assert replicas, probes present, PDB rendered when enabled
- GitHub Actions:
helm lint,helm unittest, kubeconform,ct installon kind helm testhook that curls the API health endpoint
Prove it works
terminal$ helm unittest charts/shoplite-service── expected output ──Charts: 1 passed, 1 totalTest Suites: 3 passed, 3 totalTests: 11 passed, 11 total - 4
Publish and roll back
Done when: Versioned charts in an OCI registry; practised rollback.
helm packageandhelm push oci://ghcr.io/<you>/charts- Upgrade with a bad value (wrong image tag), then
helm rollback shoplite 1 - Record
helm history
Prove it works
terminal$ helm history shoplite -n shoplite── expected output ──REVISION STATUS CHART DESCRIPTION1 superseded shoplite-0.4.0 Install complete2 superseded shoplite-0.4.1 Upgrade complete3 deployed shoplite-0.4.0 Rollback to 1
Would you run this in production?
- ☐Schema-validated values
- ☐No secrets in values files (use External Secrets or sealed secrets)
- ☐Chart and app versions tracked separately
- ☐CI validates rendering and installation
- ☐Pinned subchart versions
Stretch goals
- Deploy the chart with Argo CD instead of
helm install(Project 9) - Sign charts with Cosign
- Compare with a Kustomize version of the same app
Show it off
Résumé bullet
Packaged a multi-service application into reusable Helm charts with schema validation, unit tests, CI install tests on kind, and OCI publishing; eliminated config drift across dev and prod.
Demo script
- Diff dev vs prod rendering (
helm templatetwice + diff) - Break a value and show schema validation failing
- Roll back a bad release
Interview questions about this project
How do you structure Helm charts for many microservices?
What's the difference between chart version and appVersion?