Chart Structure and Templates

mkdir -p helm 29,435 && helm create helm/booknest scaffolds a chart for a generic web server. Chart.yaml carries the chart's own SemVer version and the appVersion it deploys; values.yaml holds the defaults, charts/ the dependencies, and templates/ what Helm renders, including an httproute.yaml for the Gateway API in Helm 3.22's scaffold. Files starting with _ render nothing: _helpers.tpl defines snippets reused with include.

BookNest's chart replaces the scaffold's templates with its manifests from k8s/, turning each value that differs between installations into a template action:

Part of the API Deployment in helm/booknest/templates/api.yamlYAML
metadata:
  name: {{ .Release.Name }}-api
  labels: {{- include "booknest.labels" . | nindent 4 }}
    tier: api
spec:
  {{- if not .Values.api.autoscaling.enabled }}
  replicas: {{ .Values.api.replicas }}
  {{- end }}
  # ... selector, Pod labels, the wait-for-db init container ...
      containers:
      - name: api
        image: "{{ .Values.api.image.repository }}:{{ .Values.api.image.tag }}"
        {{- include "booknest.dbEnv" . | nindent 8 }}
        resources: {{- toYaml .Values.api.resources | nindent 10 }}

The language is Go's text/template plus the Sprig functions, with built-in objects .Values, .Release, .Chart and .Capabilities; {{- trims whitespace, and nindent re-indents a block, the usual cure for broken YAML. Every name starts with .Release.Name, so two releases never clash.