DevOps Peach

Docker & Kubernetes · Helm – The Package Manager for Kubernetes · Lesson 3 of 5

Chart Structure

A chart is a folder with Chart.yaml, values.yaml and templates/; helm create scaffolds one, helm lint checks it, helm template renders it.

Practice interactively →

mychart/
  Chart.yaml           # name, version (chart), appVersion (app), dependencies
  values.yaml          # default values
  values.schema.json   # (optional) JSON Schema that checks values
  charts/              # dependent subcharts
  crds/                # Custom Resource Definitions
  templates/
    deployment.yaml
    service.yaml
    _helpers.tpl       # helpers, renders no manifest
    NOTES.txt          # printed after install
    tests/             # test hooks
  .helmignore          # files skipped when packaging
flowchart LR
  V["values.yaml<br/>+ -f / --set"] --> E["Template engine"]
  T["templates/*.yaml"] --> E
  C["Chart.yaml"] --> E
  E --> M["Kubernetes manifests"]
  M --> K["kube-apiserver"]
# Chart.yaml
apiVersion: v2
name: mychart
version: 0.1.0        # chart version, bump on every chart change
appVersion: "1.27.0"  # version of the app inside

Common traps

Command Meaning
helm create mychart Scaffold a sample chart
helm lint mychart Check syntax errors and best practices
helm template myrel ./mychart Render manifests to the screen without installing
helm package mychart Package as mychart-0.1.0.tgz

More Chart.yaml fields

apiVersion: v2
name: mychart
description: Web front end for the shop
type: application          # or library
version: 0.3.1
appVersion: "1.27.0"
kubeVersion: ">=1.28.0-0"
keywords: [web, nginx]
maintainers:
- name: Platform Team
  email: platform@example.com

A library chart (type: library) holds only reusable template helpers and cannot be installed by itself; application charts depend on it to share labels, probes, or a standard Deployment layout. kubeVersion makes Helm refuse to install on clusters that are too old.

Designing good values

Validating values

A values.schema.json file rejects bad input before anything reaches the cluster:

{
  "type": "object",
  "required": ["image"],
  "properties": {
    "replicaCount": { "type": "integer", "minimum": 1 },
    "image": { "type": "object", "required": ["repository"] }
  }
}

helm install, upgrade, lint, and template all apply the schema.

Testing and publishing

Public charts are indexed on Artifact Hub, where you can compare maintainers, versions, and security reports before choosing one.

Practice interactively →