--- name: kubernetes-helm-engineering description: "Engineering skill: Kubernetes with Helm — how to build and ship a library with Helm, YAML + Go templates, helm lint + helm template. Use when writing, reviewing, testing or releasing code in this stack, and when turning a Celestial design or experience skill into code." type: engineering stack: library core: "1.0" checked: 2026-10-26 --- # Kubernetes with Helm Services deployed to Kubernetes through versioned Helm charts with health probes, resource limits and safe rollouts by default. For teams running several containerised services on a shared Kubernetes cluster who want one consistent way to package and release them. Charts live in git, values differ per environment, and releases are applied by CI or a GitOps controller rather than by hand. ## Stack - **Language:** YAML + Go templates Kubernetes 1.30+ — Kubernetes manifests with templating for per-environment values. - **Framework:** Helm ^3.16 — Packages manifests as a versioned chart with install, upgrade and rollback. - **State:** Helm release history in the cluster + desired state in git — Git says what should run; release history allows instant rollback. - **Data:** values.schema.json for chart inputs JSON Schema draft-07 — Invalid values fail at install time, not at runtime. - **Build:** helm package + OCI registry push ^3.16 — Charts are immutable, versioned artifacts like container images. - **Hosting:** Managed Kubernetes cluster per environment 1.30+ — Staging and production are isolated; upgrades are tested in staging first. - **Package manager:** Helm dependencies with Chart.lock committed — Subchart versions are pinned. - **Testing:** helm lint + helm template ^3.16 — Charts render for every values file before anything reaches a cluster. - **Testing:** kubeconform ^0.6 — Rendered manifests are validated against the target Kubernetes API version. - **Testing:** helm-unittest ^0.6 — Asserts that templates produce the expected probes, limits and labels. ## Commands - dev: `helm template charts/ -f environments/staging/.yaml` - lint: `helm lint charts/ -f environments/prod/.yaml && helm template charts/ | kubeconform -strict -summary` - test: `helm unittest charts/` - build: `helm package charts/` - deploy: `helm upgrade --install charts/ -f environments/prod/.yaml --atomic --wait --timeout 10m` - install: `helm dependency build charts/` ## Structure - `charts//Chart.yaml` — Chart metadata, version and appVersion - `charts//values.yaml` — Safe defaults: probes on, limits set, one replica, no secrets - `charts//values.schema.json` — Schema for every value the chart accepts - `charts//templates/` — Deployment, Service, HPA, PodDisruptionBudget, NetworkPolicy and _helpers.tpl - `charts//tests/` — helm-unittest suites for the templates - `environments//.yaml` — Per-environment overrides: replicas, image tag, resources, hostnames - `charts/library/` — Shared library chart with the common labels and pod spec helpers ## Naming - Files: kebab-case.yaml; templates named after the kind (deployment.yaml, service.yaml) - Tests: charts//tests/