Helm Hour 5: Automation — CI/CD and GitOps
- Build PR-level CI for the chart repository:
helm lint --strict→ct lint(including version bump checks, yamllint, and the Chart.yaml schema) →helm template | kubeconform(including CRD schemas) → on kindct install(optional--upgrade), and test only the charts changed in this PR. - Two release channels: chart-releaser (GitHub Release +
gh-pagesonindex.yaml) and OCI (GHCR / ACR / ECR,helm push); explainversionandappVersion's division of labor, and the rule that “a published version is immutable: changing content requires a version bump.” - Use helm-docs from
values.yaml's# --comments to generate the README; you'll also usehelm package --signto generate.provandhelm verify; you'll also use cosign to sign OCI charts keylessly and verify them on clients and in Flux. - Understand Argo CD only uses Helm to render (
helm template, releases do not appear inhelm list), write the helm source, valueFiles / valuesObject, and multi-source Applications ($values), and map Helm hooks to Argo CD sync phases / waves. - Understand The Flux helm-controller uses the Helm SDK to perform the actual install/upgrade (releases appear in
helm list), write OCIRepository + HelmRelease, install/upgrade remediation, drift detection,dependsOn. - Use Helmfile to declare multiple releases, environments, and
needs, and usehelmfile diff/applyfor “push-style” orchestration, and explain the trade-offs between it and GitOps. - Define an upgrade strategy:
--rollback-on-failure,--wait(kstatus watcher),--timeout, pre-upgradehelm diffchecks; know when Argo Rollouts / Flagger are needed for canary or blue-green deployments.
1-hour time allocation
| # | Time | Module | Core content | Animation / interactive | Lab (kind cluster lab + GitHub repository helm-charts) |
|---|---|---|---|---|---|
| 0 | Before class | Prep: chart repository and pipeline | Repository layout charts/myapp, tool versions, GHCR permissions, kind cluster | Environment self-check checklist | Push the repository skeleton |
| 1 | 00–08 | Chart CI | lint --strict, ct lint/install, ct.yaml, ci/*-values.yaml, kubeconform + CRD schema, test changes only | Staged simulation of the PR pipeline (failures can be injected) | lint-test.yaml workflow |
| 2 | 08–15 | Publish charts | chart-releaser + gh-pages; helm push to GHCR/ACR/ECR; version vs appVersion; immutable releases | Version decision tool | release.yaml dual-channel publishing |
| 3 | 15–22 | Docs and signing | helm-docs, .prov and helm verify, cosign keyless signing of OCI charts | Signing and verification chain animation | Sign and verify myapp 0.5.0 |
| 4 | 22–30 | GitOps: Argo CD managing Helm | helm source, valueFiles/valuesObject, multi-source, render instead of install, hooks ↔ sync waves | Argo CD sync phase and wave sorter | Argo CD deploys myapp |
| 5 | 30–38 | GitOps: Flux HelmRelease | OCIRepository/HelmRepository, remediation, drift detection, dependsOn, visible in helm list | Core animation: GitOps reconciles a HelmRelease (failures can be injected) | Flux deploys myapp + failure rollback |
| 6 | 38–45 | Helmfile orchestration | helmfile.yaml(.gotmpl), environments, needs, diff/apply, trade-offs vs GitOps | Topological sort of the needs dependency graph | Two releases: redis + myapp |
| 7 | 45–53 | Upgrade strategy and automatic rollback | --rollback-on-failure, --wait strategy, --timeout, helm diff, Argo Rollouts / Flagger | Upgrade timeline: success / failure rollback | Rehearse a failed upgrade |
| 8 | 53–60 | Recap, self-check, and cleanup for the first five hours | Lessons 1–5 knowledge map, self-check, cleanup | Interactive troubleshooting tree | Clean up kind / GHCR / gh-pages |
| — | After class | Cheat sheet · Capstone lab | Full CI + release signing + dual Argo CD and Flux deployment + automatic rollback drill | Final quiz (12 questions) | Capstone lab |
Knowledge Coverage Matrix
| Target skills | M1 | M2 | M3 | M4 | M5 | M6 | M7 | M8 | Key commands | Lab |
|---|---|---|---|---|---|---|---|---|---|---|
| PR-level chart validation | ✓ | · | ✓ | · | · | · | · | ✓ | ct lint,kubeconform | lint-test.yaml |
| Install and upgrade testing in kind | ✓ | · | · | · | · | · | ✓ | ✓ | ct install --upgrade | helm/kind-action |
| Publish to an HTTP repository and OCI | · | ✓ | ✓ | ✓ | ✓ | · | · | ✓ | cr,helm push | release.yaml |
| Version policy and immutable releases | ✓ | ✓ | · | · | ✓ | · | ✓ | ✓ | --check-version-increment | Version decision tool |
| Doc generation and signature verification | · | · | ✓ | · | ✓ | · | · | ✓ | helm-docs,cosign verify | Sign 0.5.0 |
| Argo CD managing Helm | · | · | · | ✓ | · | ✓ | ✓ | ✓ | argocd app diff/sync | Application |
| Flux HelmRelease | · | · | ✓ | · | ✓ | ✓ | ✓ | ✓ | flux reconcile hr --reset | HelmRelease |
| Multi-release orchestration | · | · | · | ✓ | ✓ | ✓ | · | · | helmfile diff/apply | helmfile.yaml.gotmpl |
| Upgrade strategy and automatic rollback | · | · | · | ✓ | ✓ | ✓ | ✓ | ✓ | --rollback-on-failure --wait | Failed upgrade drill |
Topics not covered in this lesson (and where to learn them)
| Topic | Why it's not in this lesson | Where to learn it |
|---|---|---|
| Installing Argo CD / Flux, the OpenGitOps four principles, basic Application fields, selfHeal/prune | The K8s course's Lesson 6 only gives a conceptual overview, with full coverage in the next course; this lesson only covers “how they handle Helm” | K8s Lesson 6 · Module 1 · GitOps and Argo CD, 8 hours |
| GitHub Actions syntax, triggers, permissions, OIDC, environments and approvals | Covered systematically in the GitHub course | GitHub, 8 hours |
| chart templates, values.schema.json, helm test, dependencies | Lesson 2 topics | Helm Lesson 2 |
| ACR / ECR authentication details and cloud pipelines | Lesson 3 and 4 topics | Lesson 3 (Azure) · Lesson 4 (AWS) |
| hook execution order, releases stuck in pending-upgrade | Lesson 6 and 7 topics | Lesson 6 · Lesson 7 |
Using Terraform helm_release to manage charts | belongs to the IaC topic | Terraform, 8 hours |
How to use this courseware
Principles · diagrams · animation · commands · labs · production cases · troubleshooting · quiz · voice · video. Read “Principles” and “Animation” first, then do the “Lab”. All labs in this lesson can be completed with a local kind cluster and a free GitHub repository, with no cloud cost (except the optional ACR / ECR section).
Progress counts once the quiz score is ≥ 70% or you click “Mark module complete”. It is saved in this browser (cleared on refresh if local storage is disabled).
The “Voice” tab uses the browser's built-in Web Speech API (en-US) to read the script aloud; if no Chinese voice pack is installed, you can read the script directly.
--atomic → --rollback-on-failure (sets --wait as the default watcher); when not specified --wait , the default strategy is hookOnly.Module 0 · Prep: chart repository and pipeline (complete before class)
- Complete Lesson 1 and Lesson 2: have locally
~/helmlab/myappchart (Flask + gunicorn + Redis counter,/healthz), withvalues.schema.jsonandtemplates/tests/test-connection.yaml,helm lintpassing. - myapp image source code
~/helmlab/myapp-src(Docker course). This lesson will push the image toghcr.io/<your-username>/myapp. - A GitHub account (a personal account is fine) that can create public repositories and enable GitHub Pages; for GitHub Actions usage see the GitHub course.
- Local tools: Docker, kind v0.33.0, kubectl 1.37, Helm 4.3.2, git, Python 3 (ct lint depends on yamllint / yamale), jq.
Costs, permissions, and security risks
| Resource | Cost | Permissions / risks |
|---|---|---|
| GitHub public repository + Actions + Pages | Public repositories use standard hosted runners for free | The workflow needs contents: write (chart-releaser),packages: write (GHCR),id-token: write (cosign keyless). Grant only the jobs that need them. |
| GHCR (ghcr.io) | Public packages are free | Packages on first push default to private; for anonymous pulls, change it to Public in the package settings. Do not use a personal PAT in place of GITHUB_TOKEN. |
| kind cluster lab | Local, no cost | Installing Argo CD + Flux together in one kind cluster needs about 4 GB of memory; if resources are tight, do it in two separate passes. |
| Optional: ACR / ECR | See Lessons 3 and 4 | Only used in the “Push to OCI” comparison section of Module 2; can be skipped. |
Security note: cosign keyless signing writes the signer identity (workflow path, repository, branch) to the public Rekor transparency log. For private projects that do not want to expose this metadata, evaluate using a private Sigstore instance or key-pair signing instead.
Step 1: Check tools
helm version --short kind version kubectl version --client python3 -m pip install --user yamllint yamale # Download the ct, kubeconform, helm-docs, cosign, helmfile, flux, and argocd binaries from each project's GitHub Releases (see table below) ct version kubeconform -v helm-docs --version cosign version helmfile version flux version --client argocd version --client
v4.3.2+g... kind v0.33.0 go1.x linux/amd64 Client Version: v1.37.1 Version: v3.15.0 v0.8.0 helm-docs version 1.14.2 GitVersion: v3.1.4 helmfile version v1.8.4 flux: v2.10.0 argocd: v3.6.1+...
| Tool | Version | Install |
|---|---|---|
| chart-testing (ct) | v3.15.0 | brew install chart-testing or Releases; or use the image quay.io/helmpack/chart-testing:v3.15.0 (already includes helm, yamllint, yamale, kubectl) |
| kubeconform | v0.8.0 | Releases or go install github.com/yannh/kubeconform/cmd/kubeconform@v0.8.0 |
| helm-docs | v1.14.2 | Releases,brew install norwoodj/tap/helm-docs or image jnorwood/helm-docs |
| cosign | v3.1.4 | Releases (in CI use sigstore/cosign-installer@v4.1.3) |
| Helmfile + helm-diff | v1.8.4 / v3.15.15 | Releases; helmfile init installs helm-diff (Helm 4 verifies plugin sources by default, see Module 6) |
| flux / argocd CLI | v2.10.0 / v3.6.1 | Same as Lesson 6 of the K8s course |
Step 2: Create the helm-charts repository and organize the directory
export GH_USER=<your GitHub username> mkdir -p ~/helmlab/helm-charts/charts && cd ~/helmlab/helm-charts git init -b main cp -r ~/helmlab/myapp charts/myapp mkdir -p charts/myapp/ci .github/workflows tree -L 3 -a -I .git
. ├── .github/workflows/ ← lint-test.yaml (Module 1), release.yaml (Modules 2, 3) ├── charts/ │ └── myapp/ │ ├── Chart.yaml │ ├── values.yaml │ ├── values.schema.json │ ├── README.md.gotmpl ← Module 3 (helm-docs template, optional) │ ├── ci/ ← each *-values.yaml is installed once during ct install │ └── templates/ ├── ct.yaml ← Module 1 ├── cr.yaml ← Module 2 (optional) └── gitops/ ← Modules 4, 5: Argo CD and Flux manifests, environment values
apiVersion: v2
name: myapp
description: Flask + Redis counter demo used across the Helm course
type: application
version: 0.4.0 # chart version: bump on any change to templates or default values
appVersion: "1.0" # app version: default image tag, informational/default value only
maintainers:
- name: andy
url: https://github.com/<GH_USER>
home: https://github.com/<GH_USER>/helm-charts
sources:
- https://github.com/<GH_USER>/helm-charts/tree/main/charts/myapp
git add . && git commit -m "chore: import myapp chart 0.4.0" gh repo create helm-charts --public --source . --push
Step 3: Prepare the kind cluster and images
kind get clusters | grep -q '^lab$' || kind create cluster --name lab --config ~/helmlab/kind-lab.yaml kubectl config use-context kind-lab cd ~/helmlab/myapp-src docker build -t ghcr.io/$GH_USER/myapp:1.0 --build-arg APP_VERSION=1.0 . docker build -t ghcr.io/$GH_USER/myapp:1.1 --build-arg APP_VERSION=1.1 . echo $GH_PAT_PACKAGES | docker login ghcr.io -u $GH_USER --password-stdin # local only: the PAT needs write:packages docker push ghcr.io/$GH_USER/myapp:1.0 && docker push ghcr.io/$GH_USER/myapp:1.1
After pushing, in GitHub → Packages → myapp → Package settings, change visibility to Public and add the helm-charts repository under “Manage Actions access”, so that later workflows use GITHUB_TOKEN to push charts. You can also use only kind load docker-image for local experiments, skipping the GHCR image.
Warm-up: answer from memory (30 seconds)
helm upgrade --install What record does it leave in the cluster?
A Secret in the release namespace sh.helm.release.v1.<name>.v<N> (Lesson 1). In this lesson you will see that Flux leaves the same record, while Argo CD does not.
When pushing to OCI, helm push myapp-0.4.0.tgz oci://ghcr.io/$GH_USER/charts which repository and tag does it end up writing to?
Repository ghcr.io/$GH_USER/charts/myapp, tag 0.4.0. The push target does not include the chart name and tag (Lessons 1, 3, 4).
In Helm 4, what replaces --atomic 's parameter?
--rollback-on-failure; it sets --wait default to watcher (kstatus).
Module 1 · Chart CI: lint, ct, and kubeconform
- Explain what each of the four kinds of checks catches and what it misses: Static (lint, yamllint, Chart.yaml schema, version bump),post-render schema (kubeconform, including CRDs),real cluster (ct install + helm test).
- Write
ct.yamlandcharts/myapp/ci/*-values.yaml, and understand how ct usesgit diff <remote>/<target-branch>to find the changed charts. - Build a PR workflow with helm/chart-testing-action + helm/kind-action, and load the CI-built image into kind.
What: what chart CI needs to verify
A chart is a “program that generates YAML.” Like ordinary code, it needs compile-time checks (templates render, values conform to the schema),contract checks (rendered objects conform to the Kubernetes / CRD OpenAPI schema), and integration tests (it actually installs, Pods become ready,helm test tests pass, and it can upgrade from the previous version).
| Gate | Tool | What it checks | What it misses | Time |
|---|---|---|---|---|
| ① helm lint --strict | Helm 4.3 | Required Chart.yaml fields, template syntax, values.schema.json; --strict treats warnings (such as a missing icon) as errors too | whether rendered objects are valid | seconds |
| ② ct lint | chart-testing | For changed charts: whether the version is bumped (check-version-increment, default true), the Yamale schema for Chart.yaml, yamllint, and for each ci/*-values.yaml run helm lint, optional maintainer validation | Same as above | seconds |
| ③ kubeconform | kubeconform v0.8.0 | helm template output is checked object by object against the JSON Schema: misspelled field names, wrong types, missing required fields; CRDs via CRDs-catalog or self-generated schemas | runtime behavior, admission policies | seconds |
| ④ ct install | ct + kind | Each ci/*-values.yaml is installed once (in its own namespace) → wait for readiness → helm test → uninstall; --upgrade when upgrade is enabled, it also upgrades in place from the previous version | cloud dependencies (LB, IAM) | minutes |
Why: why “test only changed charts”
- In a monorepo with many charts, a full install is slow; ct compares by default
<remote>/<target-branch>(defaultorigin/main) against the current HEAD and only processes charts whose directories changed. So checkout mustfetch-depth: 0, or it cannot find the merge base. --chartsor--alldisables change detection and version bump checks (suitable for nightly full regression).- The version bump check enforces “bump the version when content changes,” a prerequisite for Module 2's “immutable releases.”
How: ct configuration and conventions
- Configuration precedence: command line >
CT_*environment variables > config file; if not specified--config, ct auto-loads from the current directory (or$HOME/.ct,/etc/ct) under the namect.yaml. ct lintThe yamllint config (lintconf.yaml) and the Yamale schema (chart_schema.yaml), searched from the current directory →.ct/→$HOME/.ct→/etc/ct; sample files ship with the official image and release packages.ci/*-values.yaml: each file represents one test scenario (e.g., default, redis-disabled, ingress), and ct install installs the chart once per scenario.type: librarycharts are only linted, not installed.- When
--namespaceis not set, each release is installed in a random namespace and cleaned up afterward;--skip-clean-upmakes debugging easier.
When: where each check runs
- Locally in pre-commit: helm lint, helm-docs (Module 3).
- PR: ①②③④ all (④ only for changed charts).
- Nightly:
ct install --all --upgrade+ multiple Kubernetes versions (kind-action'snode_imagematrix). - Merged to main: publish (Module 2), no repeated install.
contianers: so such spelling errors must be caught by kubeconform or --dry-run=server. ② “kubeconform can't handle CRDs” — you can use -schema-location pointing to CRDs-catalog or a self-generated schema; only use -ignore-missing-schemas and list the skipped kinds in the report. ③ “ct install uses the image from main” — ct only installs the chart; the image must first be built by the workflow and kind load, or in ci/ values, point to a published image.Flowchart: chart CI for a single PR
Reference: typical errors each gate can catch
| Error | lint --strict | ct lint | kubeconform | ct install |
|---|---|---|---|---|
Template syntax error (unclosed {{ if }}) | ✓ | ✓ | — | ✓ |
Changed the template but did not bump version | — | ✓ | — | — |
| values.yaml indentation problems / duplicate keys | Partially | ✓ (yamllint) | — | — |
spec.template.spec.contianers | — | — | ✓ (strict mode reports extra fields) | ✓ (SSA field validation reports the error) |
ServiceMonitor's endpoints[0].interval: 30 (should be a string) | — | — | ✓ (CRD schema) | needs the CRD installed on the cluster |
| Wrong readinessProbe path means it never becomes ready | — | — | — | ✓ (timeout) |
| New version cannot upgrade from the old one (e.g., changed Deployment selector) | — | — | — | ✓ (--upgrade) |
Interactive: staged PR pipeline simulation
Select the changes in this PR (you can select several to inject issues), then click “Run pipeline”. Each stage shows realistic ct / kubeconform output; it stops on failure and suggests a fix.
Core commands
| Command | Purpose | Notes |
|---|---|---|
helm lint charts/myapp --strict --kube-version 1.37.0 | Strict lint | --with-subcharts also lint dependencies; -f scenario values can be specified |
ct list-changed --target-branch main | List changed charts | if output is empty, later steps are skipped |
ct lint --config ct.yaml | version bump + yamllint + Yamale + helm lint | for each ci/*-values.yaml lint separately |
ct install --config ct.yaml --upgrade | install, test, upgrade test | requires access to a cluster; --helm-extra-args '--timeout 300s' |
helm template … | kubeconform -strict -summary | schema validation of rendered output | -kubernetes-version 1.37.0; for CRDs add a second -schema-location |
remote: origin target-branch: main chart-dirs: - charts # chart-repos: # - bitnami=https://charts.bitnami.com/bitnami # only needed when the chart depends on an external HTTP repository helm-extra-args: --timeout 300s check-version-increment: true validate-maintainers: false # when true, validates that maintainers.name is a real GitHub account upgrade: true # ct install tests an in-place upgrade from the previous version # excluded-charts: # - experimental-chart
image: repository: myapp tag: ci # local image built with docker build and loaded with kind load in the workflow pullPolicy: Never redis: enabled: true
image: { repository: myapp, tag: ci, pullPolicy: Never }
metrics:
serviceMonitor:
enabled: true # requires the ServiceMonitor CRD to be pre-installed in kind (see lab)
cd ~/helmlab/helm-charts
helm lint charts/myapp --strict --kube-version 1.37.0
ct lint --config ct.yaml
for f in charts/myapp/ci/*-values.yaml; do
helm template ci charts/myapp -f "$f" --kube-version 1.37.0 \
| kubeconform -strict -summary -kubernetes-version 1.37.0 \
-schema-location default \
-schema-location 'https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json'
done
==> Linting charts/myapp 1 chart(s) linted, 0 chart(s) failed Linting charts in directories [charts] Using config file: ct.yaml ------------------------------------------------------------------------------------------------------------------------ Charts to be processed: ------------------------------------------------------------------------------------------------------------------------ myapp => (version: "0.4.1", path: "charts/myapp") ------------------------------------------------------------------------------------------------------------------------ Linting chart "myapp => (version: \"0.4.1\", path: \"charts/myapp\")" Checking chart "myapp => (version: \"0.4.1\", path: \"charts/myapp\")" for a version bump... Old chart version: 0.4.0 New chart version: 0.4.1 Chart version ok. Validating /root/.ct/chart_schema.yaml... Validation success! 👍 Validating maintainers... ==> Linting charts/myapp [INFO] Chart.yaml: icon is recommended 1 chart(s) linted, 0 chart(s) failed ------------------------------------------------------------------------------------------------------------------------ ✔︎ myapp => (version: "0.4.1", path: "charts/myapp") ------------------------------------------------------------------------------------------------------------------------ All charts linted successfully Summary: 5 resources found parsing stdin - Valid: 5, Invalid: 0, Errors: 0, Skipped: 0 Summary: 6 resources found parsing stdin - Valid: 6, Invalid: 0, Errors: 0, Skipped: 0
How to verify: Deliberately change the containers in the Deployment to contianers then run again; kubeconform should output stdin - Deployment myapp is invalid: problem validating schema … additional properties 'contianers' not allowed (wording varies by version). Note: The [INFO] icon is recommended in the output above is INFO level; --strict only treat WARNING as a failure. Common errors: When running ct locally, origin/main is too old — first git fetch origin.
Lab 1: set up a PR workflow for helm-charts (about 6 min)
name: lint-test
on:
pull_request:
paths: ["charts/**", "ct.yaml", ".github/workflows/lint-test.yaml"]
permissions: {}
jobs:
lint-test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0 # ct needs full history to compute changes
- uses: azure/setup-helm@v5.1.0
with:
version: v4.3.2
- uses: actions/setup-python@v7
with:
python-version: "3.x"
- uses: helm/chart-testing-action@v2.9.0 # installs ct 3.15.0 by default
- id: list-changed
run: |
changed=$(ct list-changed --config ct.yaml --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
echo "charts=$(echo $changed | tr '\n' ' ')" >> "$GITHUB_OUTPUT"
fi
- name: helm lint --strict
if: steps.list-changed.outputs.changed == 'true'
run: for c in ${{ steps.list-changed.outputs.charts }}; do helm lint "$c" --strict --kube-version 1.37.0; done
- name: ct lint
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --config ct.yaml --target-branch ${{ github.event.repository.default_branch }}
- name: kubeconform
if: steps.list-changed.outputs.changed == 'true'
run: |
curl -sSL https://github.com/yannh/kubeconform/releases/download/v0.8.0/kubeconform-linux-amd64.tar.gz | tar xz -C /usr/local/bin kubeconform
for c in ${{ steps.list-changed.outputs.charts }}; do
for f in "$c"/ci/*-values.yaml; do
echo "::group::$f"
helm template ci "$c" -f "$f" --kube-version 1.37.0 | kubeconform -strict -summary \
-kubernetes-version 1.37.0 -schema-location default \
-schema-location 'https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json'
echo "::endgroup::"
done
done
- uses: helm/kind-action@v1.15.2
if: steps.list-changed.outputs.changed == 'true'
# default cluster name chart-testing, kind v0.33.0, kubectl v1.37.1
- name: build & load image, install test CRDs
if: steps.list-changed.outputs.changed == 'true'
run: |
docker build -t myapp:ci ./app # if the image source is in the same repo; otherwise reference a published image in ci/ values
kind load docker-image myapp:ci --name chart-testing
kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/main/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml
- name: ct install
if: steps.list-changed.outputs.changed == 'true'
run: ct install --config ct.yaml --target-branch ${{ github.event.repository.default_branch }}
In production, pin the ServiceMonitor CRD URL to a specific prometheus-operator release tag instead of main.
git switch -c feat/probe-timeout sed -i 's/^version: 0.4.0/version: 0.4.1/' charts/myapp/Chart.yaml # e.g., add timeoutSeconds: 2 to readinessProbe in templates/deployment.yaml git commit -am "feat(myapp): add readiness timeout" && git push -u origin HEAD gh pr create --fill gh pr checks --watch
lint-test/lint-test pass 2m31s https://github.com/…/actions/runs/…
Checking chart "myapp => (version: \"0.4.1\", path: \"charts/myapp\")" for a version bump... Old chart version: 0.4.1 New chart version: 0.4.1 Error: failed linting charts: failed processing charts
charts/demo (helm create), then in another PR change only charts/demo, and confirm that the log for Charts to be processed shows only demo.lint-test (GitHub course, Lesson 3).Case 1: missed selector change
Problem: A refactor changed the Deployment's selector.matchLabels by adding a label; lint and kubeconform both passed, but after merge and release, upgrades failed in all environments (selectors are immutable). Fix: In ct.yaml, turn on upgrade: true, so ct installs the previous version first, then upgrades to the current one. For changes that truly break compatibility, bump the major version (ct only tests upgrades within the SemVer range where breaking changes should not be introduced).
Case 2: CI duration for 40 charts in a monorepo
Problem: Every PR does a full install, taking 40 minutes. Fix: PRs test only ct install changed charts; nightly uses a matrix node_image: [kindest/node:v1.35.x, v1.36.x, v1.37.0] to run --all. kubeconform uses -n for concurrency and caches schemas in the Actions cache (-cache directory).
Case 3: CRD schema fetches rate-limited
Problem: kubeconform occasionally gets 429 when fetching schemas from raw.githubusercontent.com. Fix: Download the K8s and CRD schemas used into the repository in advance schemas/ (or an internal mirror),-schema-location 'schemas/{{.ResourceKind}}{{.KindSuffix}}.json'; for CRDs, use openapi2jsonschema to generate from the installed CRDs; versions match the cluster.
Common errors and fixes
Error: failed identifying charts to process: failed creating diff: Error running process: exit status 128 … fatal: bad revision 'origin/main...HEAD'
Cause: Shallow clone or missing target branch reference.
git fetch --unshallow || true git fetch origin main:refs/remotes/origin/main ct list-changed --target-branch main
Fix: Set in actions/checkout: fetch-depth: 0; if the target branch is not main, pass --target-branch.
Error: failed linting charts: failed processing charts (the log above shows "Chart version not ok. Needs a version bump!")
Cause:check-version-increment Enabled by default; the chart directory changed but version the version was not increased.
Fix: Bump the version per SemVer. When only files that do not affect package content, such as README, change, you can enable use-helmignore and add the files to .helmignore, so ct treats the chart as unchanged.
Error validating data: … schema_error: Validating 'chart_schema.yaml' … / lintconf.yaml: no such file or directory
Cause: When running the ct binary locally, the default Yamale schema and yamllint config cannot be found.
mkdir -p ~/.ct && tar -xzf chart-testing_3.15.0_linux_amd64.tar.gz -C /tmp && cp /tmp/etc/* ~/.ct/
kubeconform: could not find schema for ServiceMonitor
Cause: Only the default schema location is used, and the CRD has no schema.
Fix: Add -schema-location pointing to CRDs-catalog ({{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json), or a self-converted schema; if none exists, use -skip ServiceMonitor to explicitly skip it, rather than skipping globally -ignore-missing-schemas.
ct install: Error: INSTALLATION FAILED: context deadline exceeded / resource Deployment/myapp-xxxx/myapp not ready
Cause: The image cannot be pulled (pullPolicy: Never not loaded into kind, or a private GHCR image), probes fail, or resources are insufficient.
ct install --config ct.yaml --skip-clean-up --debug kubectl get pods -A | grep myapp kubectl describe pod -n <ns> -l app.kubernetes.io/name=myapp | tail -20
When ct fails, it automatically prints Pod logs and events; check these first.
1. Run ct install only for charts/myapp, and keep the resources for easier debugging.
ct install --charts charts/myapp --skip-clean-up
Note --charts disables change detection and version bump checks.
2. Use kubeconform to validate the rendered output, output as JSON, and skip ServiceMonitor.
helm template t charts/myapp | kubeconform -strict -summary -output json -skip ServiceMonitor -kubernetes-version 1.37.0
The team wants to catch “new chart version cannot upgrade from the live version” before a PR is merged, while keeping CI under 10 minutes. The repository has 12 charts. How would you design it?
In PRs: ct change detection + ct install --upgrade (only for changed charts, upgrading from the previous version to the current one); each chart's ci/ values files keep only the 1–2 most representative scenarios; kubeconform and lint run as parallel jobs. Nightly: --all + multi-K8s-version matrix. For changes that truly need to break compatibility, bump the major version and document the migration steps in the release notes.
Verified teaching videos
No verified dedicated videos were found for chart-testing / kubeconform; see the storyboard script below.
Official documentation
- helm/chart-testing(including doc/ct_install.md, ct_lint.md)
- helm/chart-testing-action
- helm/kind-action
- yannh/kubeconform · datreeio/CRDs-catalog
- helm lint
Video storyboard script (about 75 seconds)
Visual: a chart package on a conveyor belt passes through four gates, labeled lint, ct lint, kubeconform, and kind in turn.
Narration: a chart is a program that generates YAML, and CI should check it from fastest to slowest.
Visual: git diff highlights the charts/myapp directory; other charts turn gray.
Narration: ct compares against the target branch and only processes changed charts; if the content changed but the version was not bumped, the second gate blocks it.
Visual: the kind cluster creates a namespace for each ci values file; Pods turn green, helm test passes, and the namespace disappears.
Narration: finally, install, test, and upgrade in a real cluster, then clean up automatically.
Module 2 · Publish charts: chart-releaser and OCI
- Explain the three things chart-releaser does: package changed charts → create a GitHub Release for each version (tag
<name>-<version>) and upload the tgz → update thegh-pagesindex file on theindex.yamlbranch. - Use
helm push(or the action'soci_registry_url) to push the same package to GHCR, and compare the login methods for ACR / ECR. - Define a version policy: chart
versionandappVersionwhen each is bumped, pre-release versions, stamping version numbers in CI; understand “immutable releases.”
What: two distribution channels
| HTTP chart repository (chart-releaser + GitHub Pages) | OCI registry (GHCR / ACR / ECR / Harbor) | |
|---|---|---|
| Stored as | tgz files as GitHub Release assets; index.yaml in the gh-pages branch (optional, packages_with_index also put the tgz in the Pages branch) | OCI manifest: config (application/vnd.cncf.helm.config.v1+json) + chart layer + optional provenance layer |
| Consume | helm repo add myrepo https://<user>.github.io/helm-charts → helm install myrepo/myapp | helm install oci://ghcr.io/<user>/charts/myapp --version 0.5.0, no repo add required |
| Index | a constantly growing index.yaml, clients need helm repo update | no index; addressed directly by tag / digest |
| Integrity | digest in the index + optional .prov | content-addressed digest; optional .prov layer; cosign signature (Module 3) |
| GitOps support | Argo CD and Flux (HelmRepository) both support it | Argo CD (repoURL without oci://), Flux (OCIRepository recommended) |
Why: why “immutable releases”
- Helm, Argo CD, and Flux all cache charts; if the same version number maps to different content, different clusters may get different bytes, and incidents cannot be reproduced.
- chart-releaser fails by default when a release already exists (
skip_existingcan be skipped); since cr v1.10, you can useCR_REPLACE_EXISTINGto replace mutable GitHub Release, but the official README also cautions that consumers may cache old bytes and that publishing a new version is usually preferable; repositories with GitHub immutable releases enabled cannot replace them. - OCI tags can be overwritten by default; ECR can be set to IMMUTABLE (Lesson 4), while GHCR / ACR require process controls (or ACR's lock attribute) to guarantee it; in production, pin by digest (Lesson 3).
How: version policy
| Field | Meaning | When to bump | Rule |
|---|---|---|---|
version | Version of the chart package itself (SemVer 2, required) | In the chart package,any file change (templates, default values, dependencies, even the default image tag) | breaking values compatibility (renaming/removing keys, selector changes) → major; new optional features → minor; fixes → patch |
appVersion | The application version deployed by default; an informational field, often used as image.tag the default value of | when the application is released | SemVer is not required; remember to quote it ("1.10" otherwise YAML parses it as 1.1) |
- If appVersion changes, version must also change— because the package content changed (ct also requires this).
- Pre-releases:
0.5.0-rc.1;helm installpre-release versions are not selected by default; you need--develor explicitly--version. - OCI tags do not allow
+, and when Helm pushes, it replaces build metadata+with_(covered in Lesson 3). - CI stamping:
helm package --version 0.5.0 --app-version "$(git rev-parse --short HEAD)"You can set the version without changing Chart.yaml; but then the Chart.yaml in Git does not match the package, so the team must agree that “the tag / package is authoritative.” This lesson uses “Chart.yaml is the single source of truth,” with versions bumped via PRs.
When: which channel to choose
- Open-source public charts, and user habits
helm repo add→ chart-releaser + Pages (pushing to OCI as well is better). - Internal enterprise, existing image registry and permission system, GitOps → OCI first (no index to maintain; permissions match images).
- To get both: the chart-releaser-action's
oci_registry_urlpublishes to both destinations at once.
{{ .Values.image.tag | default .Chart.AppVersion }} does so. ② “Once pushed to GHCR, others can pull it” — new GHCR packages are private by default. ③ “helm push will create index.yaml for me” — OCI has no index; helm search repo also cannot find OCI charts.Flowchart: dual-channel publishing after merge to main
Version comparison
| This change | version | appVersion |
|---|---|---|
| myapp releases 1.1 (default tag changed to 1.1) | 0.4.1 → 0.5.0 (minor) or patch, per team convention | "1.0" → "1.1" |
| Add optional ServiceMonitor | 0.5.0 → 0.6.0 | unchanged |
service.port renamed to service.http.port | 0.6.0 → 1.0.0 (major) | unchanged |
| Only README changed (in .helmignore) | unchanged | unchanged |
Interactive: version decision tool
Select the type of change in this PR to see the recommended version / appVersion, the behavior of ct and chart-releaser, and what happens when a published version is changed.
Core commands
| Command | Purpose | Notes |
|---|---|---|
cr package charts/myapp | Package into .cr-release-packages/ | supports --sign --key --keyring |
cr upload -o <owner> -r helm-charts --skip-existing | create GitHub Release and upload | requires CR_TOKEN |
cr index -o <owner> -r helm-charts --push | update index.yaml on gh-pages | default branch gh-pages |
cr push --registry-url oci://ghcr.io/<owner>/charts --skip-existing | push the package to OCI | the same-directory .prov push together |
helm push myapp-0.5.0.tgz oci://ghcr.io/<owner>/charts | Helm native push | first helm registry login ghcr.io |
helm show chart oci://ghcr.io/<owner>/charts/myapp --version 0.5.0 | verify the published | output includes Digest |
# Manually publish OCI once locally to understand what the action does cd ~/helmlab/helm-charts helm package charts/myapp -d /tmp/pkg echo "$GH_PAT_PACKAGES" | helm registry login ghcr.io -u "$GH_USER" --password-stdin helm push /tmp/pkg/myapp-0.5.0.tgz oci://ghcr.io/$GH_USER/charts helm show chart oci://ghcr.io/$GH_USER/charts/myapp --version 0.5.0 | head -5
Successfully packaged chart and saved it to: /tmp/pkg/myapp-0.5.0.tgz Login Succeeded Pushed: ghcr.io/andy/charts/myapp:0.5.0 Digest: sha256:3b1f0c…e9a2 Pulled: ghcr.io/andy/charts/myapp:0.5.0 Digest: sha256:3b1f0c…e9a2 apiVersion: v2 appVersion: "1.1" description: Flask + Redis counter demo used across the Helm course name: myapp
Login comparison for three OCI registries (see Lessons 3 and 4 for details)
# GHCR (in Actions)
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u "${{ github.actor }}" --password-stdin
# ACR (requires azure/login first, OIDC)
az acr login -n $ACR --expose-token --query accessToken -o tsv \
| helm registry login $ACR.azurecr.io -u 00000000-0000-0000-0000-000000000000 --password-stdin
# ECR (requires configure-aws-credentials first, OIDC; the repository charts/myapp must already exist)
aws ecr get-login-password --region ca-central-1 \
| helm registry login --username AWS --password-stdin $ACCT.dkr.ecr.ca-central-1.amazonaws.com
Common errors:helm registry login The push target can only be a hostname; it cannot include oci:// a scheme or path (Helm 4 will reject it).
Lab 2: release.yaml dual-channel publishing (about 6 min)
gh-pages branch), then in Settings → Pages → Source choose “Deploy from a branch”, branch gh-pages / root.name: release
on:
push:
branches: [main]
paths: ["charts/**"]
concurrency:
group: chart-publishing-${{ github.repository }}
cancel-in-progress: false
permissions: {}
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write # GitHub Release + gh-pages
packages: write # GHCR
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
persist-credentials: true # cr pushes gh-pages using git worktree, so credentials must be kept
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- uses: azure/setup-helm@v5.1.0
with: { version: v4.3.2 }
- uses: docker/login-action@v4.8.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: cr
uses: helm/chart-releaser-action@v1.9.0
with:
charts_dir: charts
skip_existing: true
oci_registry_url: oci://ghcr.io/${{ github.repository_owner }}/charts
env:
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CR_GENERATE_RELEASE_NOTES: "true"
- name: summary
run: |
echo "changed: ${{ steps.cr.outputs.changed_charts }}"
echo '${{ steps.cr.outputs.releases }}' | jq .version to 0.5.0,appVersion to "1.1", and merge after passing the Module 1 checks.
gh run watch gh release list | head -3 curl -s https://$GH_USER.github.io/helm-charts/index.yaml | head -20
myapp-0.5.0 Latest myapp-0.5.0 about 1 minute ago
apiVersion: v1
entries:
myapp:
- apiVersion: v2
appVersion: "1.1"
created: "2026-11-15T10:12:33.12Z"
digest: 9d1c…
name: myapp
urls:
- https://github.com/andy/helm-charts/releases/download/myapp-0.5.0/myapp-0.5.0.tgz
version: 0.5.0charts/myapp to Public):
helm repo add andy https://$GH_USER.github.io/helm-charts && helm repo update helm search repo andy/myapp --versions helm template t andy/myapp --version 0.5.0 | sha256sum helm template t oci://ghcr.io/$GH_USER/charts/myapp --version 0.5.0 | sha256sum # the two should match
skip_existing that the upload is skipped and the Release is unchanged; leave this case to Module 1's ct version check to block at the PR stage.Case 1: two different contents under the same version number
Problem: A maintainer manually deleted a Release and republished 1.4.2 to fix a bug. Some users' Argo CD still had the old package cached, while others got the new one, so the problem could not be reproduced. Fix: Publish 1.4.3; enable GitHub immutable releases for the repository; on the OCI side, list the digest in the release notes, and have the GitOps repository reference it by digest or a pinned version.
Case 2: index.yaml too large
Problem: Thousands of versions accumulated over several years, and the index.yaml file reached several MB, making helm repo update updates slow. Fix: Migrate primarily to OCI; keep only recent versions in the HTTP repository (cr does not prune automatically, so a separate script is needed, and users must be notified).
Case 3: publish internal charts to ACR + ECR across two clouds
Problem: A multi-cloud team needs two registries kept in sync. Fix: Package once in the same job,helm push push to both registries (each with its own OIDC login), and compare whether the two Digests match; cosign signs each reference separately (the signature is bound to the digest, so identical content gives the same digest).
Common errors and fixes
fatal: could not read Username for 'https://github.com': No such device or address
Cause: chart-releaser uses git worktree to push gh-pages, but checkout did not keep credentials (or a problematic actions/checkout v6.0.0 was used).
Fix: Use actions/checkout v6.0.1+ / v7 and keep persist-credentials: true, and make sure the job has contents: write.
Error: error creating GitHub release myapp-0.5.0: … already_exists
Cause: The version did not change, but the chart was packaged again.
Fix: Set skip_existing: true; the root fix is to block it at the PR stage with the ct version check.
Error: failed to authorize: failed to fetch oauth token: unexpected status: 401 Unauthorized (helm push ghcr.io)
Cause: Not logged in, the job lacks packages: write, the package already exists and this repository was not added to its Actions access, or a PAT without write:packages is used.
cat ~/.config/helm/registry/config.json | jq '.auths | keys' gh api /user/packages/container/charts%2Fmyapp --jq '.visibility'
After helm repo add, helm install andy/myapp fails with 404 Not Found
Cause: Pages is not enabled or points to the wrong branch; or the Release asset that the URL in index points to was deleted.
curl -sI https://$GH_USER.github.io/helm-charts/index.yaml | head -1 gh release view myapp-0.5.0 --json assets --jq '.assets[].name'
1. Push myapp-0.5.0.tgz to the charts namespace in GHCR, and install that version.
helm push myapp-0.5.0.tgz oci://ghcr.io/$GH_USER/charts helm install myapp oci://ghcr.io/$GH_USER/charts/myapp --version 0.5.0
2. Without changing Chart.yaml, set the version to 0.5.1-rc.1 and appVersion to the current commit's short hash when packaging.
helm package charts/myapp --version 0.5.1-rc.1 --app-version "$(git rev-parse --short HEAD)"
Your chart is used by 30 teams through Argo CD. This change changes resources 's default from empty to requests 100m/128Mi. How should the version be set and the release published?
A change to default values alters every deployment that does not override that value. It is a behavior change but does not break the values interface: bump the minor version (e.g., 0.6.0), state the impact clearly in the Release notes, and do not overwrite old versions. Since Argo CD applications pin the targetRevision version, each team upgrades on its own schedule; if some teams use a 0.* version range, remind them that they will automatically receive the new defaults.
Verified teaching videos
Official documentation
- helm/chart-releaser-action · helm/chart-releaser
- Use OCI-based registries
- The Chart.yaml file (version / appVersion)
- Chart Releaser Action to Automate GitHub Page Charts
Video storyboard script (about 70 seconds)
Visual: the merge button is pressed, and one tgz splits into two copies; one flies to GitHub Release + Pages, the other flies to GHCR.
Narration: merging publishes; the same package travels two channels.
Visual: the version and appVersion counters in Chart.yaml, which tick up respectively on “template changes” and “application releases.”
Narration: version describes the chart package, appVersion describes the application; if the package content changes, version must change.
Visual: someone tries to overwrite 0.5.0, and is stamped “Published, cannot be modified.”
Narration: don't change a published version; release a new one.
Module 3 · Docs and signing: helm-docs, provenance, cosign
- Use
# --comments to document values,helm-docsto generate the values table in the README; in CI, usegit diff --exit-codeto block “forgot to regenerate.” - Explain
.prov's contents (Chart.yaml + the package's SHA256, PGP-signed) andhelm package --sign/helm verify/helm install --verifythe usage and limitations of - Use cosign to sign the chart pushed to GHCR by digest perform keyless signing and verify with identity constraints (certificate identity + OIDC issuer); enable verification in the Flux OCIRepository.
What: documentation and provenance
| Mechanism | Question answered | Artifact | Who verifies |
|---|---|---|---|
| helm-docs | What parameters, default values, and meanings does this chart have? | README.md (generated by README.md.gotmpl + values comments) | People; CI checks whether it is up to date |
| Helm provenance (PGP) | Was this tgz published by the holder of a certain PGP private key, and has it not been tampered with? | myapp-0.5.0.tgz.prov (PGP clearsign of Chart.yaml contents + package SHA256) | helm verify,helm install --verify |
| cosign / Sigstore | Was this OCI digest signed by a workflow in a certain repository? | The signature is stored in the same OCI repository (cosign v3 uses the new bundle format by default and stores it as an OCI 1.1 referring artifact) + a Rekor transparency log entry | cosign verify, Flux OCIRepository.spec.verify, admission controllers |
Why
- A hand-written README always goes stale; values comments sit right next to the code, so the generated table and defaults always match values.yaml.
- A chart creates objects in the cluster with high privileges, so a supply-chain attack (a compromised repository or a replaced tag) can be severe; signing lets consumers before deploying verify the source.
- Keyless signing requires no long-term private key: GitHub OIDC token → Fulcio issues a 10-minute short-lived certificate (with the workflow identity embedded) → signs and records to Rekor.
How: key details of the three
- helm-docs: Write above values
# -- description;# @default -- textto override the displayed default value;--chart-search-root=chartssearched recursively; if none isREADME.md.gotmplpresent, the built-in template is used. Provides pre-commit hooks (helm-docs,helm-docs-built,helm-docs-container). - provenance:
helm package --sign --key '<uid substring>' --keyring <private key file>;--keymust be a substring of the uid,fingerprints cannot be used; GnuPG 2.1+ private keys must first begpg --export-secret-keysexported to a file; Helm 4.3.0+ can read it directly when verifyingpubring.kbx. In CI, use--passphrase-file..provWhen in the same directory as the tgz,helm pushandcr pushwill be uploaded together, and chart-releaser also uploads.provas a Release asset. - cosign: The signing target must be digest (
…/myapp@sha256:…), not a tag; when verifying, also constrain--certificate-identity(or-regexp) and--certificate-oidc-issuer, otherwise “anything signed with any GitHub workflow” will pass. The official Helm docs also mentionhelm-sigstorea plugin as an alternative; this lesson uses the general-purpose cosign.
When
- Public HTTP repositories: .prov (Artifact Hub and similar sites display signing status).
- OCI + GitOps: cosign keyless; Flux verifies on pull. Argo CD itself does not verify cosign signatures when pulling charts, but can verify via admission policies (such as Kyverno or Sigstore policy-controller) for images; chart-level verification follows each tool's documentation.
- The two can be used together: push the tgz with .prov to OCI, then cosign-sign the digest.
--verify it only verifies PGP .prov.Mechanism diagram: cosign keyless signing and verification
Comparison: .prov vs cosign
| Helm provenance (.prov) | cosign keyless | |
|---|---|---|
| Keys | Long-term PGP private key; must be stored and rotated | No long-term private key; short-lived certificate + OIDC identity |
| Binds to | tgz SHA256 + Chart.yaml | OCI manifest digest |
| Distribution | .prov file next to the tgz / OCI provenance layer | Signature artifact in the same repository + Rekor |
| Client | helm verify,--verify | cosign verify Flux, admission controllers |
| Suited for | HTTP repositories, offline environments | OCI, CI automation, GitOps |
Animation: signing and verification chain (tampering can be injected)
Step through keyless signing and verification; choose an attack or mistake and observe at which step it is detected.
Core commands
| Command | Purpose |
|---|---|
helm-docs --chart-search-root charts | Generate README.md for all charts |
helm package --sign --key 'Helm Lab' --keyring ~/.gnupg/secring.gpg --passphrase-file - charts/myapp | Package and generate .prov |
helm verify myapp-0.5.0.tgz --keyring pub.asc | Verify .prov |
cosign sign --yes ghcr.io/u/charts/myapp@sha256:… | keyless signing (automatically uses OIDC in CI) |
cosign verify … --certificate-identity … --certificate-oidc-issuer … | Verification with identity constraints |
# -- replica count; ignored when autoscaling is enabled replicaCount: 2 image: # -- image repository repository: ghcr.io/andy/myapp # -- image tag # @default -- same as appVersion in Chart.yaml tag: "" redis: # -- whether to deploy the bundled Redis subchart enabled: true
cd ~/helmlab/helm-charts helm-docs --chart-search-root charts sed -n '/## Values/,$p' charts/myapp/README.md | head -8
INFO[…] Found Chart directories [myapp] INFO[…] Generating README Documentation for chart charts/myapp ## Values | Key | Type | Default | Description | |-----|------|---------|-------------| | image.repository | string | `"ghcr.io/andy/myapp"` | image repository | | image.tag | string | same as appVersion in Chart.yaml | image tag | | redis.enabled | bool | `true` | whether to deploy the bundled Redis subchart |
PGP provenance
gpg --quick-generate-key "Helm Lab <helm-lab@example.com>" rsa3072 sign 1y gpg --export-secret-keys "Helm Lab" > /tmp/secring.gpg # Helm signing needs the private key as a file gpg --export --armor "Helm Lab" > helm-lab-pub.asc helm package --sign --key 'Helm Lab' --keyring /tmp/secring.gpg charts/myapp -d /tmp/pkg cat /tmp/pkg/myapp-0.5.0.tgz.prov | head -12 helm verify /tmp/pkg/myapp-0.5.0.tgz --keyring helm-lab-pub.asc
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 apiVersion: v2 appVersion: "1.1" description: Flask + Redis counter demo used across the Helm course name: myapp version: 0.5.0 ... files: myapp-0.5.0.tgz: sha256:9d1c… Signed by: Helm Lab <helm-lab@example.com> Using Key With Fingerprint: 5A1E… Chart Hash Verified: sha256:9d1c…
cosign: sign and verify OCI charts
REF=ghcr.io/$GH_USER/charts/myapp
DIGEST=$(helm show chart oci://$REF --version 0.5.0 2>&1 | awk '/^Digest:/{print $2}')
# verify (the signature is created by release.yaml on main)
cosign verify "$REF@$DIGEST" \
--certificate-identity "https://github.com/$GH_USER/helm-charts/.github/workflows/release.yaml@refs/heads/main" \
--certificate-oidc-issuer https://token.actions.githubusercontent.com | jq '.[0].optional.Subject // .'
Verification for ghcr.io/andy/charts/myapp@sha256:3b1f… -- The following checks were performed on each of these signatures: - The cosign claims were validated - Existence of the claims in the transparency log was verified offline - The code-signing certificate was verified using trusted certificate authority certificates
Output format varies with the cosign version; use exit code 0 as the criterion. Common errors: Signing a tag :0.5.0 (cosign resolves it to a digest and warns, but the release process should use the digest explicitly).
Lab 3: add a helm-docs check and cosign signing to release.yaml (about 6 min)
- name: helm-docs up to date
run: |
docker run --rm -v "$PWD:/helm-docs" -u "$(id -u)" jnorwood/helm-docs:v1.14.2 --chart-search-root charts
git diff --exit-code -- charts/*/README.md || { echo "::error::README is stale, run helm-docs"; exit 1; }id-token: write, and append after chart-releaser:
permissions:
contents: write
packages: write
id-token: write # required for cosign keyless
steps:
# ...(Module 2 steps)...
- uses: sigstore/cosign-installer@v4.1.3 # installs the matching cosign v3.x by default
- name: sign charts by digest
if: steps.cr.outputs.changed_charts != ''
run: |
echo '${{ steps.cr.outputs.releases }}' | jq -r '.[] | "\(.chart) \(.version)"' | while read c v; do
REF=ghcr.io/${{ github.repository_owner }}/charts/$c
DIGEST=$(helm show chart oci://$REF --version "$v" 2>&1 | awk '/^Digest:/{print $2}')
cosign sign --yes "$REF@$DIGEST"
echo "### $c $v → $REF@$DIGEST" >> "$GITHUB_STEP_SUMMARY"
donecosign verify verify, then deliberately change --certificate-identity 's branch to refs/heads/dev, and confirm that verification fails (none of the expected identities matched).apiVersion: source.toolkit.fluxcd.io/v1
kind: OCIRepository
metadata: { name: myapp, namespace: flux-system }
spec:
interval: 5m
url: oci://ghcr.io/andy/charts/myapp
ref: { semver: "0.5.x" }
layerSelector:
mediaType: "application/vnd.cncf.helm.chart.content.v1.tar+gzip"
operation: copy
verify:
provider: cosign
matchOIDCIdentity:
- issuer: "^https://token.actions.githubusercontent.com$"
subject: "^https://github.com/andy/helm-charts/.github/workflows/release.yaml@refs/heads/main$"
kubectl get ocirepository myapp -n flux-system -o jsonpath='{.status.conditions[?(@.type=="SourceVerified")].message}'
verified signature of revision 0.5.1@sha256:…
Case 1: README and default value mismatch cause misconfiguration
Problem: The README says persistence.enabled defaults to false, but it is actually true, so users get a Pending PVC on kind. Approach: helm-docs + PR check; in README.md.gotmpl add an “Upgrade notes” section maintained by hand.
Case 2: signature verification bypassed by relying on tags
Problem: An attacker with package write access re-pushes 0.5.0 a tag; consumers deploy by tag only. Approach: Sign only the digest; enable verify (unsigned new digests are rejected,SourceVerified=False); GitOps repos reference images by digest (Flux ref.digest).
Case 3: PGP private key leak
Problem: A long-lived private key stored in CI secrets was not rotated for years. Approach: Keep .prov on the public HTTP repository, but store the private key only in a protected environment (GitHub environment with required approval); at the same time, introduce keyless signing for OCI and gradually move verification to cosign.
Common errors and fixes
Error: private key not found / openpgp: key not found (helm package --sign)
Cause: keyring points to pubring.kbx or an old secring.gpg has no private key; or --key specifies a fingerprint.
gpg --list-secret-keys --keyid-format long gpg --export-secret-keys "Helm Lab" > /tmp/secring.gpg
Error: openpgp: signature made by unknown entity (helm verify)
Cause: The keyring used for verification does not contain the signer's public key. Fix:--keyring helm-lab-pub.asc; Helm 4.3 can read ASCII-armored public keys and kbx files directly.
Error: signing [...]: getting signer: getting key from Fulcio: … no provider found / could not get OIDC token
Cause: the job is missing id-token: write, or it runs on a PR from a fork (no OIDC token available). Fix: Sign only in the main release job, and grant id-token: write.
Error: no matching signatures: none of the expected identities matched what was in the certificate
Cause:--certificate-identity does not match the actual signing workflow (path, branch, or tag ref).
cosign verify "$REF@$DIGEST" --certificate-identity-regexp '.*' \ --certificate-oidc-issuer https://token.actions.githubusercontent.com -o json | jq -r '.[].optional.Subject'
Use only for diagnosis to see the actual identity; switch back to exact matching after confirming.
1. Generate the README only for charts/myapp, and check for uncommitted changes.
helm-docs --chart-search-root charts/myapp && git diff --exit-code charts/myapp/README.md
2. Use cosign to verify that myapp 0.5.1 was signed by release.yaml on any branch of the helm-charts repository.
cosign verify "$REF@$DIGEST" \ --certificate-identity-regexp "^https://github.com/$GH_USER/helm-charts/.github/workflows/release.yaml@refs/heads/.+$" \ --certificate-oidc-issuer https://token.actions.githubusercontent.com
The security team requires that “production clusters may only deploy charts signed by the release pipeline on the main branch of the main repository.” The GitOps tool is Flux. Provide an end-to-end design.
Release: only in release.yaml on main, package, push to GHCR, and sign by digest with cosign keyless (id-token: write), enable concurrency and environment protection. Consumption: set in the Flux OCIRepository verify.provider: cosign + matchOIDCIdentity (issuer exactly matches GitHub, subject exactly matches …/release.yaml@refs/heads/main), HelmRelease uses chartRef to reference it; flux-system RBAC forbids teams from modifying OCIRepository. Audit: alert on SourceVerified=False. Images are also verified for signatures by an admission controller.
Verified instructional videos
No verified dedicated videos were found for helm-docs and Helm provenance; see the storyboard script.
Official docs
- norwoodj/helm-docs
- Helm Provenance and Integrity
- Sigstore: Signing Containers
- sigstore/cosign-installer
- Flux OCIRepository verification
Video storyboard (about 75 seconds)
Visual: the # -- comments in values.yaml become table rows that flow into the README.
Narration: docs are written next to the parameters, generated by helm-docs, and CI checks that they are up to date.
Visual: next to the tgz, a seal labeled SHA256 appears (.prov), and a key icon represents the PGP private key.
Narration: the traditional approach uses PGP signing, and verifiers need your public key.
Visual: the workflow takes its OIDC ID card to Fulcio to get a 10-minute certificate; after signing, it is logged on the Rekor transparency board; Flux checks the workflow path on the ID card and lets it through.
Narration: keyless signing has no long-lived private key, so verification must always constrain the identity.
Module 4 · GitOps: managing Helm with Argo CD
- Write an Application with a helm source (three types: HTTP repository / OCI / Git directory
repoURL), and understand the precedence ofreleaseName,valueFiles,valuesObject, andparameters. - Use a multi-source Application: the chart comes from GHCR, and environment values come from Git (
ref: values+$values/…). - Explain the consequences of “Argo CD renders rather than installs”:
helm listis empty,lookupis unavailable,helm rollbackis invalid, and hook mapping rules and exceptions (test hooks are not supported; defining any Argo CD hook causes all Helm hooks to be ignored).
What: how Argo CD handles a Helm chart
Official docs quote: Helm is used only to helm template render the chart; the application lifecycle is managed by Argo CD, not Helm. The repo-server fetches the chart → runs helm template with values (Helm v4 since 3.5) → yields manifests → application-controller diffs them against the live cluster state → applies in phase / wave order → health assessment.
| Aspect | helm upgrade --install | Argo CD helm source |
|---|---|---|
| release Secret | sh.helm.release.v1.* | None; state lives in the Application object, and resources carry Argo CD tracking labels/annotations |
helm list / history / rollback | Available | Not applicable; use argocd app history / rollback or git revert |
| Cluster information | lookup query live objects | rendering does not connect to the cluster,lookup returns empty; .Capabilities supplied by Argo CD (available as helm.kubeVersion / helm.apiVersions override, per the official docs) |
| Random values | regenerated on every upgrade (randAlphaNum) | differ on every render → permanent OutOfSync; change the chart or use fixed values |
| hooks | Executed per Helm events | mapped to PreSync / Sync / PostSync / PreDelete / PostDelete; install and upgrade are not distinguished |
| Failure handling | --rollback-on-failure | no automatic rollback; a failed sync stays failed; can be configured with retry, rollback relies on Git |
values sources and precedence
Official precedence: parameters > valuesObject > values > valueFiles > chart's own values.yaml. valueFiles Passed in the order listed to helm template --values (later ones override earlier ones); supports globs (expanded in lexical order); ignoreMissingValueFiles: true allows missing files.
Why: multi-source Application
When the chart is pulled from a Helm repository / OCI,valueFiles it can only reference files inside the chart package; environment values usually live in another Git repository. A multi-source Application lets one source provide the chart and another Git source use ref: values to provide $values prefix; paths are relative to that repo's root. A source that does not set path only provides files and generates no resources.
How: mapping of hooks to sync waves (Argo CD official table)
| Helm annotation | In Argo CD |
|---|---|
pre-install,pre-upgrade | PreSync (both run on every sync; Argo CD does not distinguish install from upgrade) |
post-install,post-upgrade | PostSync |
pre-delete / post-delete | PreDelete / PostDelete |
hook-weight | equivalent to argocd.argoproj.io/sync-wave |
hook-delete-policy | supported, but cleaned up per Argo CD's sync semantics |
helm.sh/resource-policy: keep | equivalent to sync-options: Delete=false |
crd-install | handled as a regular CRD by Argo CD |
pre-rollback,post-rollback,test-success,test-failure,hook-delete-timeout | not supported (ignored) —helm test pods will not run |
Note: once the chart defines any Argo CD hook,all hooks are ignored. Hooks are created as kubectl apply resources; an existing hook with the same name is not changed unless it has before-hook-creation a deletion policy.
When
- Need visual diffs, centralized multi-cluster management, or team self-service → Argo CD.
- The chart heavily relies on
lookup,helm test, hooks that distinguish install from upgrade, or downstream tools that depend on the release Secret → consider Flux (Module 5) or adjust the chart.
helm upgrade for emergency fixes”—this creates two managers; Argo CD reverts it on the next sync (and Helm cannot find the release, so it tries a fresh install and conflicts). ② “repoURL: oci://ghcr.io/…”—for helm-type OCI repositories, repoURL do not write oci://, and the chart name goes in the chart field. ③ “pre-install only runs on first install”—in Argo CD it runs on every sync.Mechanism diagram: how Argo CD renders and syncs a Helm chart
Interactive: Helm hooks → Argo CD sync-order sorter
Below are the objects and annotations in the myapp chart. Click “Compute order” to see the actual execution order in Argo CD; check “chart has another Argo CD hook” to observe how all Helm hooks are ignored.
Core commands and manifests
| Command | Purpose |
|---|---|
argocd repo add ghcr.io/andy/charts --type helm --name ghcr --enable-oci | Register an OCI Helm repository (for private ones, add --username/--password) |
argocd app create -f app.yaml / kubectl apply -f app.yaml | Create the Application |
argocd app manifests myapp --source git | View the rendered manifests |
argocd app diff myapp | Diff desired vs live state |
argocd app sync myapp / argocd app wait myapp --health | Sync and wait for health |
argocd app history myapp / argocd app rollback myapp <ID> | Argo CD's own deployment history (rollback requires disabling auto-sync first) |
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: myapp-dev
namespace: argocd
spec:
project: default
sources:
- repoURL: ghcr.io/andy/charts # OCI: do not write oci://
chart: myapp
targetRevision: 0.5.1 # pinned version; a range such as 0.5.* also works
helm:
releaseName: myapp
valueFiles:
- $values/gitops/values/common.yaml
- $values/gitops/values/dev.yaml
valuesObject:
replicaCount: 1 # takes precedence over valueFiles
- repoURL: https://github.com/andy/helm-charts.git
targetRevision: main
ref: values # only provides values files; do not set path
destination:
server: https://kubernetes.default.svc
namespace: myapp-argo
syncPolicy:
automated: { prune: true, selfHeal: true }
syncOptions: [CreateNamespace=true, ServerSideApply=true]
retry:
limit: 3
backoff: { duration: 10s, factor: 2, maxDuration: 2m }
kubectl apply -f gitops/argocd/myapp-dev.yaml argocd app wait myapp-dev --health --timeout 180 argocd app get myapp-dev -o tree | head -12 helm list -n myapp-argo # empty: Argo CD does not create a release kubectl get secret -n myapp-argo -l owner=helm
Name: argocd/myapp-dev Sync Status: Synced to 0.5.1 Health Status: Healthy KIND NAMESPACE NAME STATUS HEALTH Service myapp-argo myapp Synced Healthy Service myapp-argo myapp-redis Synced Healthy Deployment myapp-argo myapp Synced Healthy Deployment myapp-argo myapp-redis Synced Healthy NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION No resources found in myapp-argo namespace.
How to verify:kubectl get deploy myapp -n myapp-argo -o yaml | grep -A3 annotations You should see Argo CD's tracking annotations (the default tracking method in v3 is annotation; follow the actual output). Common mistake: Also setting path on the values source of a multi-source app causes Argo CD to try to render the values directory as manifests.
Lab 4: deploy myapp from GHCR with Argo CD (about 7 minutes)
kubectl create namespace argocd kubectl apply -n argocd --server-side --force-conflicts -f https://raw.githubusercontent.com/argoproj/argo-cd/v3.6.1/manifests/install.yaml kubectl -n argocd rollout status deploy/argocd-repo-server argocd login --core # operate directly via kubeconfig, no need to expose the UI kubectl config set-context --current --namespace argocd
gitops/values/ create common.yaml (image repository) and dev.yaml (image.tag: "1.1",resources), and commit to main.argocd app wait, then access the service:
kubectl -n myapp-argo port-forward svc/myapp 8081:80 & curl -s localhost:8081/healthz
pre-upgrade database migration Job, sync twice with argocd app sync myapp-dev, and confirm that it runs every time (kubectl get jobs -n myapp-argo -w); helm test pods will not be created.kubectl scale deploy/myapp -n myapp-argo --replicas=5, and selfHeal reverts it to 1 within seconds. In Git, change the dev.yaml of image.tag to a nonexistent 9.9 and push:
argocd app get myapp-dev --refresh | grep -E "Sync Status|Health Status" # rollback = revert the commit in Git (argocd app rollback is rejected while auto-sync is on) git revert --no-edit HEAD && git push
Sync Status: Synced to 0.5.1 Health Status: Progressing ← new Pod ImagePullBackOff, old ReplicaSet still serving Sync Status: Synced to 0.5.1 Health Status: Healthy ← restored after revert
Argo CD has no “automatic rollback on failed upgrade”; by default a Deployment stays Progressing until progressDeadlineSeconds (default 600 seconds) and then becomes Degraded. For automatic rollback, see Module 5 (Flux) and Module 7 (Argo Rollouts).
Case 1: a Secret that is permanently OutOfSync
Problem: The chart uses randAlphaNum 16 to generate the Redis password, and lookup to reuse existing values; in Argo CD lookup returns empty, so the password differs on every render; the Secret stays OutOfSync forever, and selfHeal keeps changing the password, causing Redis authentication failures. Approach: Provide the password from External Secrets or a pre-created Secret, and the chart supports existingSecret.
Case 2: HPA conflicts with replicas
Problem: With HPA enabled, the chart still renders replicas. Approach: In the template, guard {{- if not .Values.autoscaling.enabled }}replicas: …{{- end }}; or in the Application, use ignoreDifferences /spec/replicas along with RespectIgnoreDifferences=true.
Case 3: migrating from helm install to Argo CD
Problem: An existing Helm release needs to be handed over to Argo CD. Approach: The Application uses the same releaseName and namespace; the first sync takes over with SSA; after confirming, delete the release Secret (kubectl delete secret -l owner=helm,name=myapp), and do not helm uninstall (this deletes the resources). Before migrating, first argocd app diff.
Common errors and fixes
ComparisonError: rpc error: … failed to fetch chart: … 401 Unauthorized / unexpected status code
Cause: the private GHCR package has no registered credentials, or repoURL was written as oci://….
argocd repo list argocd repo add ghcr.io/andy/charts --type helm --name ghcr --enable-oci --username andy --password "$GH_PAT_READ"
Error: open $values/gitops/values/dev.yaml: no such file or directory
Cause: a single-source Application uses $values, or the ref name is inconsistent; the path should be relative to the root of the values repository. Fix: Change it to sources a multi-source Application, and in the second source write ref: values; or use ignoreMissingValueFiles (with caution).
The app stays OutOfSync; the diff only shows Secret data or some annotation changing
Cause: the template contains random/time functions (randAlphaNum,now),lookup, or another controller has changed the fields.
argocd app diff myapp-dev argocd app manifests myapp-dev | grep -n "randAlpha\|checksum"
Fix: Remove non-deterministic templates; for fields managed by external controllers, use ignoreDifferences.
Pods for helm test / test-success never run, and the post-rollback hook does not run either
Cause: Argo CD does not support these hooks (per the official mapping table). Fix: Change the smoke test to a argocd.argoproj.io/hook: PostSync Job.
1. View the rendered Deployment for myapp-dev and confirm the image tag.
argocd app manifests myapp-dev | yq 'select(.kind=="Deployment") | .spec.template.spec.containers[].image'
2. Temporarily override one Helm parameter from the command line (this writes to the Application's parameters).
argocd app set myapp-dev --helm-set replicaCount=2
In GitOps, change Git rather than the command line; with auto-sync + selfHeal, this change may be overwritten by Git (depending on whether the Application itself is also managed by Git).
In the chart, a pre-upgrade hook runs the database migration, and a post-install hook creates the initial admin. After switching to Argo CD deployment, every sync tries to create the admin and fails with an error. Why? How do you fix it?
Argo CD does not distinguish install from upgrade; post-install maps to PostSync and runs on every sync. Fix: make the Job idempotent (skip if it already exists); or disable this hook via values when deploying with Argo CD, and run it as a one-time manual/pipeline step instead; for the migration Job, add hook-delete-policy: before-hook-creation to ensure it is recreated every time.
Verified teaching videos
Official docs
- Argo CD: Helm
- Multiple Sources for an Application
- Sync Phases and Waves
- FAQ: why helm ls does not show the app
Video storyboard (about 70 seconds)
Visual: the chart goes into repo-server's “printing press,” and a stack of YAML comes out; the Helm label stays inside the machine and never enters the cluster.
Narration: Argo CD only borrows Helm to render templates; it does the installation itself, so helm list is empty.
Visual: two conveyor belts, one carrying the chart and one carrying values, merging at $values.
Narration: a multi-source Application keeps the chart and environment config stored separately.
Visual: the pre-install and pre-upgrade cards both drop into the PreSync slot.
Narration: Argo CD does not distinguish install from upgrade; the pre and post hooks run on every sync.
Module 5 · GitOps: Flux HelmRelease
- Draw the HelmRelease reconciliation chain: GitRepository → Kustomization applies HelmRelease → OCIRepository / HelmRepository pulls the chart → helm-controller composes values, decides the action, executes, waits (kstatus poller) → test → drift detection.
- Configure
install.remediationandupgrade.remediation(retries, strategy rollback/uninstall, remediateLastFailure), as well asupgrade.strategy(RemediateOnFailure / RetryOnFailure). - Enable
driftDetection.mode: enabledand use ignore rules to exclude fields managed by the HPA; usedependsOnto orchestrate release order; you will also useflux reconcile hr --reset / --force.
What: HelmRelease is a “declarative helm upgrade --install”
helm-controller calls the Helm SDK directly: release records are still written as usual in storage namespace (by default, the same namespace as the HelmRelease) sh.helm.release.v1.* Secret, so helm list / history / get values can all see it, but do not use the Helm CLI to modify it, otherwise the next reconciliation will overwrite it or flag it as drift.
| Object | Controller | Role |
|---|---|---|
GitRepository + Kustomization | source / kustomize-controller | Applies the HelmRelease, OCIRepository, and values ConfigMap from Git to the cluster |
OCIRepository (source.toolkit.fluxcd.io/v1) | source-controller | Pulls the OCI chart by semver / tag / digest, optionally verifies it with cosign / notation; HelmRelease references it via chartRef (recommended in the official examples) |
HelmRepository + .spec.chart Template | source-controller | HTTP repository (e.g. gh-pages); the HelmRelease's spec.chart template generates a HelmChart object |
HelmRelease (helm.toolkit.fluxcd.io/v2) | helm-controller | Composes values (valuesFrom + values), install/upgrade/test/rollback/uninstall, drift detection |
How: decisions in one reconciliation (simplified)
- Dependencies (
dependsOn) all Ready? If not, wait. - Get the chart artifact (the OCIRepository revision is
<version>+<first 12 digest characters>, a digest change triggers an upgrade even if the version stays the same). - Compose values and compute the config digest; compare release storage with the HelmRelease history: not present → install; config/chart changed → upgrade; consistent → skip to drift detection.
- Run the Helm action, then wait for readiness per
waitStrategy(defaultpoller, i.e. kstatus); optionally run helm test. - On failure:
Released=False(InstallFailed / UpgradeFailed), perform rollback (upgrade) or uninstall (install) per remediation, increment the counter by +1, and requeue; after retries are exhausted, stay failed (Ready=False), until the config changes, a new chart version, or--reset. - On success and consistent:
driftDetectionuse a server-side dry-run apply to compare the manifests in Helm storage with the cluster,warnonly emits events, whileenabledwill be corrected.
| Field | Default | Description (from the HelmRelease v2 docs) |
|---|---|---|
install.remediation.retries | 0 | Number of retries after an install failure; uninstall before each retry; negative value = unlimited |
upgrade.remediation.retries | 0 | Number of retries after an upgrade failure; remediate per |
upgrade.remediation.strategy | rollback | or uninstall (reinstalls afterwards) |
upgrade.remediation.remediateLastFailure | true when retries > 0 | whether to also remediate (roll back) the last failure after retries are exhausted |
upgrade.strategy.name | RemediateOnFailure | RetryOnFailure: no remediation; retry at retryInterval (default 5m) |
driftDetection.mode | Not enabled | warn / enabled; ignore exclude by path and target |
waitStrategy.name | poller | kstatus polling; legacy is the Helm v3 wait logic |
maxHistory | 5 | Number of revisions to keep |
releaseName | [<targetNamespace>-]<name> | Names longer than 53 characters are truncated with a hash; renaming = uninstall and reinstall |
Why / When: how Flux and Argo CD handle Helm
| Argo CD (Module 4) | Flux HelmRelease | |
|---|---|---|
| Execution method | helm template + its own apply | Helm SDK install/upgrade |
| helm list | Not visible | Visible (read-only use) |
| hooks / helm test / lookup | Mapped / partially unsupported / unavailable | Same as Helm |
| Failed upgrade | No automatic rollback; relies on Git revert | remediation with automatic rollback + retries |
| Drift | selfHeal (based on rendered output) | driftDetection (based on the manifests in Helm storage) |
| Visualization | Strong | CLI / events / third-party UI |
flux suspend hr then act, or change Git directly. ② “Once retries are exhausted, it keeps retrying”—no, it stays failed until a new config or --reset. ③ “Changing releaseName / targetNamespace is just a rename”—this uninstalls the old release and reinstalls it (downtime).Architecture diagram: Helm delivery in Flux
State diagram: failed upgrade and remediation (retries: 3, strategy: rollback)
Core animation: GitOps reconciling a HelmRelease
Choose a scenario and step through it: Git change → source controllers fetch the chart and values → helm-controller renders and decides the action → upgrade → health check (kstatus) → on failure, roll back per remediation. On the right are the HelmRelease conditions and helm history.
Core commands
| Command | Purpose |
|---|---|
flux get sources oci -A / flux get hr -A | Sources and HelmRelease status |
flux reconcile hr myapp -n myapp-flux --with-source | Reconcile now (refresh sources first) |
flux reconcile hr myapp --reset | Reset the failure counter and retry |
flux reconcile hr myapp --force | Force one install/upgrade (without changing the spec) |
flux suspend hr myapp / flux resume hr myapp | Suspend/resume (before emergency manual operations) |
flux events --for HelmRelease/myapp -n myapp-flux | Events (drift summary, failure reasons) |
flux debug hr myapp -n myapp-flux --show-values | Output the final composed values |
helm history myapp -n myapp-flux | Read-only view of Helm revisions |
apiVersion: v1
kind: Namespace
metadata: { name: myapp-flux }
---
apiVersion: source.toolkit.fluxcd.io/v1
kind: OCIRepository
metadata: { name: myapp, namespace: myapp-flux }
spec:
interval: 5m
url: oci://ghcr.io/andy/charts/myapp
ref: { semver: "0.5.x" }
layerSelector:
mediaType: "application/vnd.cncf.helm.chart.content.v1.tar+gzip"
operation: copy
verify:
provider: cosign
matchOIDCIdentity:
- issuer: "^https://token.actions.githubusercontent.com$"
subject: "^https://github.com/andy/helm-charts/.github/workflows/release.yaml@refs/heads/main$"
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata: { name: myapp, namespace: myapp-flux }
spec:
interval: 10m
timeout: 3m
chartRef: { kind: OCIRepository, name: myapp }
releaseName: myapp
install:
remediation: { retries: 3 }
upgrade:
cleanupOnFail: true
remediation:
retries: 2
strategy: rollback
remediateLastFailure: true
test:
enable: true # run the chart's helm test (Lesson 2)
driftDetection:
mode: enabled
ignore:
- paths: ["/spec/replicas"]
target: { kind: Deployment }
valuesFrom:
- kind: ConfigMap
name: myapp-dev-values # generated from values/dev.yaml by the configMapGenerator in gitops/kustomization.yaml
values:
replicaCount: 1
flux get hr myapp -n myapp-flux helm list -n myapp-flux helm history myapp -n myapp-flux
NAME REVISION SUSPENDED READY MESSAGE myapp 0.5.1+3b1f0c4d2e9a False True Helm install succeeded for release myapp-flux/myapp.v1 with chart myapp@0.5.1+3b1f0c4d2e9a NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION myapp myapp-flux 1 2026-11-15 10:40:12 UTC deployed myapp-0.5.1 1.1 REVISION UPDATED STATUS CHART APP VERSION DESCRIPTION 1 Sat Nov 15 10:40:12 2026 deployed myapp-0.5.1 1.1 Install complete
How to verify:kubectl get hr myapp -n myapp-flux -o jsonpath='{.status.history[0].chartVersion}'; kubectl get secret -n myapp-flux -l owner=helm You should see the release Secret. Message text follow the actual helm-controller output.
Lab 5: deploy myapp with Flux and practice automatic rollback on a failed upgrade (about 7 minutes)
flux install; production: flux bootstrap github, see K8s Lesson 6):
flux check --pre flux install flux create source git helm-charts --url=https://github.com/$GH_USER/helm-charts --branch=main --interval=1m flux create kustomization myapp-flux --source=GitRepository/helm-charts --path=./gitops --prune=true --interval=5m
gitops/flux/myapp.yaml, and in gitops/ the root directory, add a kustomization (so the generator can reference the values/dev.yaml, avoiding kustomize's “files outside the root directory cannot be loaded” restriction):
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources: [flux/myapp.yaml] # does not include the argocd/ directory
configMapGenerator:
- name: myapp-dev-values
namespace: myapp-flux
files: [values.yaml=values/dev.yaml]
generatorOptions:
disableNameSuffixHash: true
git add gitops && git commit -m "gitops: flux myapp" && git push flux reconcile ks myapp-flux --with-source kubectl -n myapp-flux wait hr/myapp --for=condition=Ready --timeout=5m
helm list -n myapp-flux
kubectl -n myapp-flux set env deploy/myapp DEBUG=1 # cause drift (replicas is already ignored, so change env instead)
flux reconcile hr myapp -n myapp-flux
flux events --for HelmRelease/myapp -n myapp-flux | tail -3
kubectl -n myapp-flux get deploy myapp -o jsonpath='{.spec.template.spec.containers[0].env}'
… DriftDetected Cluster state of release myapp-flux/myapp.v1 has drifted from the desired state: Deployment/myapp-flux/myapp changed (0 additions, 1 changes, 0 removals)
… DriftCorrected …
[{"name":"REDIS_HOST","value":"myapp-redis"}]gitops/values/dev.yaml of image.tag to 9.9 , push, and observe:
flux reconcile ks myapp-flux --with-source watch -n5 "flux get hr myapp -n myapp-flux; helm history myapp -n myapp-flux --max 6"
myapp 0.5.1+3b1f0c4d2e9a False False … upgrade retries exhausted …(the last failure was also rolled back) REVISION STATUS CHART DESCRIPTION 2 failed myapp-0.5.1 Upgrade "myapp" failed: resource Deployment/myapp-flux/myapp not ready. status: InProgress, message: … 3 superseded myapp-0.5.1 Rollback to 1 4 failed myapp-0.5.1 Upgrade "myapp" failed: … 5 superseded myapp-0.5.1 Rollback to 3 6 failed myapp-0.5.1 Upgrade "myapp" failed: … 7 deployed myapp-0.5.1 Rollback to 5
retries: 2 → 3 upgrade attempts in total (1 + 2 retries), rolling back after each failure; the last failure is also rolled back (remediateLastFailure). Production always runs the old Pods. Exact counts and description text follow the actual output.
git revert commit and push it. A values change resets the failure counter, and HelmRelease returns to Ready; if the issue is only external (e.g. the image was pushed later), use flux reconcile hr myapp -n myapp-flux --reset.Case 1: stuck at “upgrade retries exhausted”
Problem: A failed upgrade on Friday exhausted its retries; on Monday, after the image was fixed, the HelmRelease still did not move. Cause: After retries are exhausted, the controller stops until the spec, values, or chart changes, or it is reset. Approach:flux reconcile hr --reset; set up an alert rule that watches Ready=False for more than 15 minutes (via Flux notification-controller or kube-state-metrics custom metrics).
Case 2: platform component ordering
Problem: The myapp chart renders a ServiceMonitor, but kube-prometheus-stack is not installed yet, so the first install fails with no matches for kind "ServiceMonitor". Approach: Add to the myapp HelmRelease dependsOn: [{name: kube-prometheus-stack, namespace: monitoring}]; for CRDs, use install.crds: CreateReplace / upgrade.crds: CreateReplace to let Helm manage them.
Case 3: HPA and drift correction overwrite each other
Problem: With driftDetection: enabled enabled, the replica count scaled up by the HPA is reverted every time. Approach:ignore /spec/replicas (target Deployment); or the chart does not render replicas when HPA is enabled.
Common errors and fixes
HelmRelease Ready=False: upgrade retries exhausted / Failed to upgrade after 3 attempt(s)
kubectl -n myapp-flux get hr myapp -o jsonpath='{range .status.conditions[*]}{.type}={.status} {.reason}: {.message}{"\n"}{end}'
kubectl -n myapp-flux get hr myapp -o jsonpath='{.status.upgradeFailures}'
flux events --for HelmRelease/myapp -n myapp-flux
Fix: fix the root cause (image, probes, resources) → change Git or flux reconcile hr myapp --reset.
OCIRepository: no matching signatures / SourceVerified False
Cause: the new version is unsigned, or the subject regex does not match the workflow reference (e.g. a release triggered from a tag is @refs/tags/…).
flux get sources oci myapp -n myapp-flux cosign verify ghcr.io/andy/charts/myapp@sha256:… --certificate-identity-regexp '.*' --certificate-oidc-issuer https://token.actions.githubusercontent.com -o json | jq -r '.[].optional.Subject'
dependency 'myapp-flux/redis' is not ready
Cause:dependsOn 's HelmRelease is not Ready yet (or the name/namespace is wrong, or there is a circular dependency). Fix:flux get hr -A Fix the upstream first.
Helm install failed … rendered manifests contain a resource that already exists … invalid ownership metadata
Cause: the object was previously created by helm install (another release name) or by Argo CD. Fix: make sure releaseName / namespace match the original release to take ownership; or delete the old object; HelmRelease takes ownership on upgrade by default (disableTakeOwnership can be turned off), per the official docs.
1. Before an emergency, suspend the HelmRelease, manually run helm rollback to revision 1, then resume.
flux suspend hr myapp -n myapp-flux helm rollback myapp 1 -n myapp-flux --wait # After fixing Git: flux resume hr myapp -n myapp-flux
resume, and the controller reconciles again against the desired state in Git.
2. View the final values that helm-controller uses for rendering.
flux debug hr myapp -n myapp-flux --show-values
The team requires “a failed upgrade must not affect production, and it must not retry indefinitely and noisily trigger alerts,” while also requiring “helm history must be visible for auditing.” Write out the key HelmRelease fields and explain them.
Flux (helm list/history visible). upgrade.remediation.retries: 2,strategy: rollback,remediateLastFailure: true → on failure, roll back to the last successful version; stop after at most 3 attempts; timeout: 3m + the default poller (kstatus) ensures timeouts are detectable; upgrade.cleanupOnFail: true clean up newly created resources; maxHistory: 10 keep the audit trail; alerts listen for Ready=False / UpgradeFailed events.
Verified teaching videos
Official docs
Video storyboard (about 80 seconds)
Visual: a Git commit lights up, and three controllers hand off in turn: fetch the source, apply the HelmRelease, run Helm.
Narration: Flux turns helm upgrade into an object that is continuously reconciled.
Visual: the new Pod stays in ImagePullBackOff, the timer reaches 3 minutes, a red UpgradeFailed appears, then a rollback arrow pulls the version back to green v1, and the counter shows 1/3.
Narration: the upgrade fails, helm-controller rolls back per remediation and retries, and when retries are exhausted it stops and waits for you.
Visual: myapp appears in helm list in the terminal; someone runs kubectl edit, and the event stream shows DriftDetected and DriftCorrected.
Narration: unlike Argo CD, here there is a real Helm release, plus drift correction based on Helm storage.
Module 6 · Helmfile and multi-release orchestration
- Write
helmfile.yaml.gotmpl:environments,repositories(including OCI),helmDefaults,releases,needs, andvaluestemplates. - Understand the difference between
helmfile -e dev diff / apply / sync / destroy, and in CI usediff --detailed-exitcodeto preview changes. - Decide when to use Helmfile (push-based, a few clusters, local/CI orchestration, environment bootstrapping), when to use Argo CD / Flux (continuous reconciliation, multiple clusters, drift governance), and how to combine the two (Argo CD's Helmfile plugin, Flux's dependsOn as a replacement for needs).
What: what Helmfile does
Helmfile is a declarative orchestrator for Helm: it reads helmfile (which can be layered and templated) → composes the values for each release for the selected environment → sorts by needs builds the dependency graph → calls helm (diff depends on the helm-diff plugin). It has no in-cluster controller, runs once and exits; releases are regular Helm releases (helm list visible). The official docs say Helmfile supports Helm 3.x and 4.x; starting with v1.8.2, under Helm 4 it skips the removed --recreate-pods.
| Command | Behavior |
|---|---|
helmfile init | Checks / installs dependencies (helm, helm-diff, etc.); runs once after first installation |
helmfile -e dev template | Renders all releases (without connecting to the cluster) |
helmfile -e dev diff | Runs helm diff for each release; --detailed-exitcode returns 2 when there are changes |
helmfile -e dev apply | Diff first,only for releases with changes runs upgrade; uninstalls releases marked installed: false releases |
helmfile -e dev sync | Runs upgrade --install on all releases (no diff first) |
helmfile -e dev destroy | Uninstalls in reverse dependency order |
-l name=myapp / --include-needs | Selectors operate on only some releases, optionally including their dependencies |
Why: one person / one pipeline manages multiple releases
- Multiple
helm upgradecommands are scattered across scripts, with environment differences handled by if/else; Helmfile puts “what to install, in what order, and which values for which environment” into one reviewable file. apply's diff-then-sync gives CI a readable change preview; PR reviewers can see which objects would change.
How: file conventions in v1
- Starting with Helmfile v1, only helmfiles whose extension is
.gotmplare rendered as Go templates (helmfile.yaml.gotmpl); when using environment values in the same file, use---to splitenvironmentsandreleasesinto two documents. - OCI repositories:
repositoriesinoci: true,urlwithoutoci://, the release writeschart: <repo-name>/myapp. needsWrite it as[namespace/]name; Helmfile runs in dependency batches, and releases within the same batch run in parallel.- A release's values file can also be
.gotmpl, which can reference.Values(environment values) and.Release.Nameetc.
When: Helmfile vs GitOps
| Dimension | Helmfile (push) | Argo CD / Flux (pull) |
|---|---|---|
| Where it runs | Developer machine / CI, requires cluster credentials | In-cluster controller; CI needs no cluster write permissions |
| Drift | Only discovered on the next run (diff) | Continuous detection and correction |
| Dependency ordering | needs | Argo CD sync waves / Flux dependsOn |
| Best for | Cluster bootstrapping (installing Argo CD/Flux itself), a few clusters, local dev environments, one-time migrations | Long-running production clusters, multi-cluster |
--rollback-on-failure, and the corresponding helmDefaults key; follow the Helmfile docs). ② “needs waits for the app to be healthy”—you need to also enable wait, otherwise the upstream is only “submitted to the API”. ③ “You can freely write {{ }} in helmfile.yaml”—in v1, files that are not .gotmpl are not rendered as templates.Structure diagram: helmfile layering
Interactive: needs dependency graph and execution batches
Click the dependency toggles between releases to see the batches Helmfile computes (releases in the same batch can run in parallel; destroy in reverse order when uninstalling). Turn on “Create cycle” to watch the error.
Example helmfile
environments:
dev:
values: [env/dev.yaml]
prod:
values: [env/prod.yaml]
---
helmDefaults:
wait: true
timeout: 300
createNamespace: true
historyMax: 10
repositories:
- name: andy
url: ghcr.io/andy/charts
oci: true
releases:
- name: redis
namespace: myapp-hf
chart: ../charts/redis # local redis chart from Lesson 2 (copied into the repo)
values:
- values/redis.yaml
- name: myapp
namespace: myapp-hf
chart: andy/myapp
version: {{ .Values.myapp.chartVersion }}
installed: {{ .Values.myapp.enabled }}
needs:
- myapp-hf/redis
values:
- values/myapp.yaml.gotmpl
set:
- name: redis.enabled # use a separate redis release
value: false
# environment values: used by helmfile and *.gotmpl values myapp: enabled: true chartVersion: 0.5.1 imageTag: "1.1" replicas: 1
replicaCount: {{ .Values.myapp.replicas }}
image:
tag: {{ .Values.myapp.imageTag | quote }}
redis:
host: redis-master.{{ .Release.Namespace }}.svc # use the actual service name of your redis chart
cd ~/helmlab/helm-charts/deploy helmfile init # install helm-diff (Helm 4 verifies plugin provenance) helmfile -e dev lint helmfile -e dev diff --detailed-exitcode; echo "exit=$?" helmfile -e dev apply helm list -n myapp-hf
Comparing release=redis, chart=../charts/redis, namespace=myapp-hf myapp-hf, redis-master, StatefulSet (apps) has been added: + … Comparing release=myapp, chart=andy/myapp, namespace=myapp-hf myapp-hf, myapp, Deployment (apps) has been added: + … exit=2 … UPDATED RELEASES: NAME NAMESPACE CHART VERSION DURATION redis myapp-hf ../charts/redis 0.1.0 28s myapp myapp-hf andy/myapp 0.5.1 19s NAME NAMESPACE REVISION STATUS CHART APP VERSION myapp myapp-hf 1 deployed myapp-0.5.1 1.1 redis myapp-hf 1 deployed redis-0.1.0 7.4
How to verify: Run without making any changes helmfile -e dev apply, and it should show no changes and upgrade no releases (revision unchanged). helm-diff installation (Helm 4): Helm 4 verifies plugin provenance by default; the helm-diff project recommends importing its GPG public key and then installing from the Release's tarball URL (git repository URLs do not support provenance verification); see the helm-diff README.
Lab 6: orchestrate redis + myapp with Helmfile (about 6 minutes)
charts/redis, then follow the Commands tab to create the deploy/ directory.helmfile -e dev apply, and confirm that redis finishes before myapp (in the log, redis's UPDATED line appears first).env/dev.yaml in replicas to 2, then run helmfile -e dev diff, and you should see only the myapp Deployment's replicas change; then run apply, and confirm that only myapp's revision goes up by +1. - name: helmfile diff
run: |
helmfile -f deploy/helmfile.yaml.gotmpl -e dev diff --detailed-exitcode --suppress-secrets || rc=$?
[ "${rc:-0}" = "2" ] && echo "::notice::Changes found, see the diff above" || true
[ "${rc:-0}" = "1" ] && exit 1 || trueenv/dev.yaml in myapp.enabled to false, then apply; myapp is uninstalled and redis is kept; finally helmfile -e dev destroy (uninstalls in reverse order).Case 1: bootstrapping GitOps with Helmfile
Problem: On a new cluster, cert-manager and Argo CD (or Flux) must be installed before GitOps can run, a chicken-and-egg problem. Approach: A “bootstrap helmfile” contains only these platform releases (pinned versions, needs ordering), run once by the pipeline; afterwards, all other apps are handed over to Argo CD / Flux. Argo CD's own Application can also be used to self-manage.
Case 2: helmfile apply accidentally deletes a release
Problem: An environment file omits enabled, so the template evaluates to false,installed: false causing the production release to be uninstalled. Approach: Write env values as required ({{ .Values.myapp.enabled | required "myapp.enabled is required" }}); require manual review of the diff before production apply; do not use the installed toggle for critical releases.
Case 3: diff is very slow with many releases
Problem: With 80 releases, each diff takes 10 minutes. Approach: Split into layers by label (labels: {tier: platform}), so PRs only diff the releases whose directories changed (-l); increase --concurrency; split the rarely changing platform layer into its own helmfile.
Common errors and fixes
Error: unknown command "diff" for "helm" / helm-diff plugin not installed
Fix:helmfile init; under Helm 4, if plugin verification fails, import the public key per the helm-diff README and install from the tarball URL, or explicitly skip verification in a controlled environment (follow the Helm plugin docs).
err: no releases found that matches specified selector / environment values not taking effect, {{ .Values.myapp }} shown literally
Cause: the file name is not .gotmpl (v1 does not render templates); or environments and releases did not use --- to separate; or forgot -e dev (uses the default environment).
in ./helmfile.yaml.gotmpl: release "myapp-hf/myapp" depends on "myapp-hf/redis" which does not match any release
Cause:needs 's namespace/name is wrong, or is -l filtered out by the selector. Fix: correct the name; for selector cases, add --include-needs.
Error: failed to authorize: … 401 Unauthorized (pulling andy/myapp)
Cause: Not logged in to the private GHCR package. Fix:helm registry login ghcr.io (or configure username/password environment variables under repositories); see Module 2.
1. Apply only to myapp and its dependencies (prod environment).
helmfile -e prod -l name=myapp --include-needs apply
2. Render all manifests for the dev environment and validate them with kubeconform.
helmfile -e dev template | kubeconform -strict -summary -kubernetes-version 1.37.0
The team has 3 clusters, each with about 15 releases, and currently uses Helmfile with Jenkins scheduled applies. Recently, several times someone manually ran helm upgrade, causing production to diverge from the repository. How would you evolve this?
Short term: run scheduled helmfile diff --detailed-exitcode to alert on drift; revoke individuals' cluster write access. Mid term: migrate to Flux (release semantics unchanged, Helm history continues, HelmRelease's dependsOn replaces needs, driftDetection corrects manual changes) or Argo CD (evaluate hooks/lookup differences). Keep Helmfile only for cluster bootstrapping and local development environments.
Verified teaching videos
Official docs
Video storyboard (about 60 seconds)
Visual: scattered helm command cards are gathered into one helmfile folder.
Narration: Helmfile puts multiple releases and multiple environments into one declarative file.
Visual: the dependency graph points from redis to myapp, and two batches light up in turn; in the diff output, only one changed line is highlighted.
Narration: batch by dependency, diff first, then upgrade only the releases that changed.
Visual: a balance scale with Helmfile (push) on one side and a GitOps controller (pull, continuous reconciliation) on the other.
Narration: use Helmfile to bootstrap the cluster, and hand long-running workloads to GitOps.
Module 7 · Upgrade strategy and automated rollback
- Explain Helm 4's three wait strategies:
hookOnly(the default when--waitis not specified),watcher(--waitused alone, based on kstatus),legacy(Helm 3 logic);--rollback-on-failurewill set the default wait to watcher. - For
helm upgradein CI, choose--timeout,--cleanup-on-fail,--history-max, and before upgrading, usehelm diff upgradeand--dry-run=serverto preview. - Understand the limits of Helm rollback (it only rolls back Kubernetes objects, not database migrations or external state), and know when canary/blue-green requires Argo Rollouts or Flagger.
What: the components of a safe upgrade
| Stage | Tool / flags | Purpose |
|---|---|---|
| Preview | helm diff upgrade (plugin),helm upgrade --dry-run=server | Shows which objects would change; server mode also runs admission and schema validation |
| Apply | helm upgrade --install (Helm 4 uses SSA by default for new installs; --server-side auto otherwise reuses the previous method) | Write objects and release vN (pending-upgrade → deployed/failed) |
| Wait | --wait (= watcher, kstatus),--wait-for-jobs,--timeout (default 5m, applies to each Kubernetes operation, such as hook Jobs) | A Deployment is ready, a Job completes, a Service gets an address, etc., count as success |
| Failure handling | --rollback-on-failure (formerly --atomic),--cleanup-on-fail | roll back to the last successful revision; clean up resources newly created in this run |
| Traffic rollout | Deployment's maxSurge/maxUnavailable, minReadySeconds, PDB; Argo Rollouts / Flagger | control the speed at which the new version is exposed to users |
Why: upgrades without --wait “always succeed”
By default, hookOnly only waits for hook resources; once objects are written to the API, the release is marked as deployed, even if the new Pods keep CrashLoopBackOff. The pipeline is therefore green, yet the problem is in production. --wait Use kstatus to determine the state of each resource (Current / InProgress / Failed) until all are Current or a timeout occurs.
How: choosing parameters
--timeoutshould be greater than “slowest Pod readiness + number of rollout batches × time per batch + hook time”, yet less than the Deployment'sprogressDeadlineSeconds, so Helm does not give up while the Deployment is still progressing.--rollback-on-failureRollback applies to Kubernetes objects only; database migrations need a compatible “expand first, contract later” (expand/contract) design, and migrations in hooks must be forward-compatible with the old version.- Rollback itself can fail (for example, if the new version deleted a Secret the old version needs), so
--history-maxshould not be too small (default 10). - Canary: Helm only handles “declaring the new version”; shifting traffic by percentage and automatically judging based on metrics requires Argo Rollouts (use
Rolloutresource to replace the Deployment, with canary steps / blueGreen and AnalysisTemplate) or Flagger (Canaryresource pointing to an existing Deployment that automatically creates primary/canary; part of the Flux ecosystem; supports multiple service meshes and Ingress).
When
| Scenario | Recommended |
|---|---|
| Pipeline push upgrade (GitHub Actions / Azure Pipelines) | helm diff Preview → helm upgrade --install --rollback-on-failure --timeout 5m |
| Flux | HelmRelease remediation (Module 5),waitStrategy: poller |
| Argo CD | No automatic rollback: health checks + alerts + Git revert; when automation is needed, use Argo Rollouts (auto-abort on metric failure) |
| Critical user-facing services | Canary (Argo Rollouts / Flagger) + SLO metric analysis |
| Incompatible schema changes | Blue-green or phased rollout; ship a compatible intermediate version first |
--rollback-on-failure can undo database migrations”—no. ② “A longer timeout is always safer”—too long keeps the pipeline hanging and blocks later deployments; combine it with progressDeadlineSeconds make failures surface early. ③ “A canary can be done with two Helm releases”—two Deployments sharing a Service can only split traffic roughly by replica count, and there is no automatic analysis or rollback.Timeline: failed upgrade with --rollback-on-failure
Comparison: Argo Rollouts vs Flagger
| Argo Rollouts (v1.10.2) | Flagger (v1.45.0) | |
|---|---|---|
| Workload | Rollout resource replaces the Deployment (the chart templates need changes) | Canary resource references an existing Deployment and automatically generates -primary |
| Strategy | canary (setWeight / pause / analysis steps), blueGreen | canary, A/B, blue/green (traffic mirroring, etc.) |
| Traffic | replica ratio or integration with Ingress / service mesh / Gateway API | depends on a service mesh or Ingress controller |
| Analysis | AnalysisTemplate (Prometheus, etc.) | built-in metric checks + webhook |
| Common pairings | Argo CD | Flux |
Interactive: upgrade timeline simulator
Choose parameters and the new version's behavior, and observe release status, production Pods, and pipeline results.
Core commands
| Command | Description |
|---|---|
helm diff upgrade myapp oci://… --version 0.5.2 -f dev.yaml -n myapp | helm-diff plugin; --detailed-exitcode returns 2 when there are changes |
helm upgrade … --dry-run=server | Server-side simulation (admission, schema), not persisted |
helm upgrade --install … --rollback-on-failure --timeout 5m --cleanup-on-fail | automatic rollback on failure; default wait is watcher |
helm upgrade … --wait --wait-for-jobs | also waits for Jobs to complete |
helm history myapp -n myapp --max 5 | View revisions and descriptions |
helm rollback myapp 0 -n myapp --wait | roll back to the previous revision (0 means the previous one) |
REF=oci://ghcr.io/$GH_USER/charts/myapp kubectl create ns myapp-push --dry-run=client -o yaml | kubectl apply -f - helm upgrade --install myapp $REF --version 0.5.1 -n myapp-push --set image.tag=1.1 --wait --timeout 3m helm diff upgrade myapp $REF --version 0.5.1 -n myapp-push --set image.tag=9.9 --detailed-exitcode; echo "diff exit=$?" helm upgrade myapp $REF --version 0.5.1 -n myapp-push --set image.tag=9.9 \ --rollback-on-failure --timeout 2m --cleanup-on-fail; echo "upgrade exit=$?" helm history myapp -n myapp-push --max 3
myapp-push, myapp, Deployment (apps) has changed: - image: "ghcr.io/andy/myapp:1.1" + image: "ghcr.io/andy/myapp:9.9" diff exit=2 Error: UPGRADE FAILED: release myapp failed, and has been rolled back due to rollback-on-failure being set: resource Deployment/myapp-push/myapp not ready. status: InProgress, message: … upgrade exit=1 REVISION UPDATED STATUS CHART APP VERSION DESCRIPTION 1 Sat Nov 15 11:02:10 2026 superseded myapp-0.5.1 1.1 Install complete 2 Sat Nov 15 11:03:01 2026 failed myapp-0.5.1 1.1 Upgrade "myapp" failed: … 3 Sat Nov 15 11:05:02 2026 deployed myapp-0.5.1 1.1 Rollback to 1
The exact wording of error messages follows the actual Helm 4.3 output. How to verify that production is unaffected: Open another terminal during the upgrade kubectl -n myapp-push port-forward svc/myapp 8082:80 and loop curl, which should always return 200 (requires readinessProbe and maxUnavailable: 0).
Argo Rollouts canary snippet (replacing the Deployment in the chart)
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata: { name: {{ include "myapp.fullname" . }} }
spec:
replicas: 4
selector:
matchLabels:
{{- include "myapp.selectorLabels" . | nindent 6 }}
template: … # same as the original Deployment's Pod template
strategy:
canary:
steps:
- setWeight: 25
- pause: { duration: 2m }
- analysis: { templates: [ { templateName: success-rate } ] }
- setWeight: 50
- pause: { duration: 2m }
Lab 7: the same failed upgrade under three deployment methods (about 7 minutes)
helm history and the curl result.helm upgrade myapp $REF --version 0.5.1 -n myapp-push --set image.tag=9.9; echo "exit=$?" helm status myapp -n myapp-push | grep STATUS kubectl -n myapp-push get pods
exit=0 STATUS: deployed ← pipeline is green myapp-6c9… 1/1 Running 0 9m myapp-7f4… 0/1 ImagePullBackOff 0 20s ← problem left in production
After finishing, run helm rollback myapp 0 -n myapp-push --wait.
Method Failure detected Prod impact Auto rollback Recovery helm without --wait No (exit 0) some Pods abnormal No manual rollback helm --rollback-on-failure Yes None Yes redeploy after fix Flux remediation Yes None Yes+retry change Git / --reset Argo CD Yes (health) None No git revert
Case 1: migration Job succeeds, app fails, and after rollback the old version cannot start
Problem: The pre-upgrade migration dropped an old column; the new version failed due to a configuration error and rolled back; the old version's queries on the old column then errored, causing a site-wide outage. Approach: expand/contract: v2 only adds columns and stays compatible with reads and writes; v3 is the first to drop the old column. Decouple the migration Job from the application, and limit the rollback strategy to the stateless parts.
Case 2: timeout shorter than startup time
Problem: A Java service takes 4 minutes to cold-start and rolls out in 6 batches,--timeout 5m causing every release to “fail and roll back”. Approach: Estimate using “slowest Pod ready time × batches” and add headroom; add a startupProbe; raise maxSurge to reduce the number of batches.
Case 3: the canary detects 5xx errors and aborts automatically
Problem: A downstream API that the new version depends on changed in one region, and the error rate rose by 3%. Approach: An Argo Rollouts AnalysisTemplate queries the Prometheus success rate; if it is < 99%, the analysis fails, the Rollout aborts automatically, and traffic switches back to the stable version. The desired version in the Helm release stays on the new version, and a Git revert finishes the job.
Common errors and fixes
Error: UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress
Cause: The previous upgrade was interrupted (pipeline cancelled, or killed on timeout), and the release is stuck in pending-upgrade.
helm history myapp -n myapp-push --max 3 helm rollback myapp <previous deployed revision> -n myapp-push --wait
For the detailed cause and recovery, see Lesson 7; in the pipeline, use concurrency to prevent concurrent deployments.
Error: UPGRADE FAILED: … context deadline exceeded (no rollback)
Cause: Only used --wait without --rollback-on-failure, so the release is marked failed but the objects keep the new version. Fix:helm rollback myapp 0 --wait; add it uniformly in the pipeline --rollback-on-failure.
Flag --atomic has been deprecated, use --rollback-on-failure instead
Cause: Old scripts run on Helm 4. The parameters still work but emit a warning; update scripts and tools (for example, the helm module in kubernetes.core 6.6.0 already maps them).
rollback failed: Error: … no Secret with the name "myapp-config-v2" found / Pod still failing after rollback
Cause: The previous version depends on external objects or data that were deleted or changed. Fix: Check helm get manifest myapp --revision N; for shared resources, add helm.sh/resource-policy: keep; design backward-compatible configuration changes.
1. Upgrade and wait for all resources and Jobs to complete; roll back on failure; timeout 8 minutes.
helm upgrade --install myapp $REF --version 0.5.2 -n myapp --wait --wait-for-jobs --rollback-on-failure --timeout 8m
2. Inspect the rendered manifest and values of revision 2 to compare against the failure cause.
helm get manifest myapp -n myapp --revision 2 helm get values myapp -n myapp --revision 2
The payment service requires that any single release affects at most 5% of users for 10 minutes; roll back automatically when metrics are abnormal; the team uses Argo CD. Propose a solution.
Argo CD by itself does not do traffic ramp-up or automatic rollback. Introduce Argo Rollouts: in the chart, replace the Deployment with a Rollout; canary steps: setWeight 5 → pause 10m (during which an AnalysisRun queries the error rate and latency) → 25 → 50 → 100; route traffic precisely through an Ingress/Gateway or a service mesh; a failed analysis aborts automatically. In Argo CD, configure health checks for the Rollout (Argo CD has built-in health assessment for Rollouts); after a failed release, use a Git revert to return the desired state to the stable version.
Verified teaching videos
Helm 4's --rollback-on-failure / kstatus waiting: no verified dedicated video was found; see the storyboard script.
Official docs
Video storyboard script (about 70 seconds)
Visual: the pipeline is green, but new Pods are smoking in the cluster (failing); caption “--wait not added”.
Narration: without waiting for readiness, the upgrade always “succeeds”.
Visual: the kstatus timer runs out, release v4 turns red, a rollback arrow produces v5, and the old Pods stay green throughout.
Narration: with --wait and --rollback-on-failure, the failure is detected and the release automatically returns to the last successful version.
Visual: the traffic slider moves from 5% to 25%, the error-rate curve rises, and the slider automatically drops back to 0.
Narration: when you need proportional rollout and automated analysis, hand off to Argo Rollouts or Flagger.
Module 8 · First-five-hours recap, self-check, and cleanup
- Use one diagram to recap the knowledge map of the first five lessons, and name the key commands and common failures at each step.
- Use the troubleshooting tree to locate five types of automation failures: ct failure, OCI push 401, signature verification failure, Argo CD OutOfSync that never converges, and HelmRelease upgrade failures that keep retrying.
- Clean up in the right order: stop the GitOps controllers first (otherwise they will 'fix' deleted items back into existence) → release → namespace → controllers → kind; remote cleanup: GHCR packages, gh-pages, Releases (optional).
What: knowledge map of the first five hours
| Lesson | Topic | What you should be able to do now | How it continues in this lesson |
|---|---|---|---|
| Lesson 1 | Helm core: release, revision, values precedence, OCI, template/get | Explain upgrade --install Full workflow and the release Secret | Flux has a release; Argo CD does not |
| Lesson 2 | Writing charts: templates, schema, dependencies, lint, test | Write reusable charts that have a schema and tests | Automate these checks with ct lint / ct install |
| Lesson 3 | AKS + ACR: Workload Identity, Key Vault, Gateway, pipelines | Deploy from ACR to AKS without long-lived credentials | ACR as one of the OCI publishing targets |
| Lesson 4 | EKS + ECR: Pod Identity, LBC, Karpenter, pipelines | The same chart running on EKS | ECR immutable tags ↔ immutable releases |
| Lesson 5 | CI/CD and GitOps | PR testing → release signing → pull-based deployment → automatic rollback | Lesson 6 hooks, Lesson 7 deep troubleshooting |
Why: compare the five deployment methods side by side
| Method | Who runs Helm | Release record | Failed upgrade | Drift |
|---|---|---|---|---|
| helm CLI (Lesson 1) | Human | Yes | Manual rollback | No detection |
| Pipeline push (Lessons 3, 4) | CI runner | Yes | --rollback-on-failure | No detection |
| Helmfile (Module 6) | Human/CI | Yes | Depends on the arguments passed to helm | Found at diff time |
| Argo CD (Module 4) | Render only; Argo CD applies | None | No automatic rollback; Git revert | selfHeal |
| Flux (Module 5) | helm-controller (SDK) | Yes | Remediation rollback + retries | driftDetection |
How: the principle behind the cleanup order
- GitOps controllers reconcile continuously: if you delete resources while the controller is still running, it recreates them. First
flux suspend/ delete the Kustomization and HelmRelease (Flux uninstalls the corresponding release); when Argo CD deletes an Application, use cascading deletion (with the finalizerresources-finalizer.argocd.argoproj.iothat deletes the resources). - kind is disposable:
kind delete cluster --name labit removes everything in the cluster; but Lesson 6 still uses the lab, so you can delete only the namespace. - Remote: GHCR packages (charts and images), the gh-pages branch and GitHub Releases, and Rekor entries (public and cannot be deleted).
When: what to keep for the next lesson
Lesson 6 (hooks, architecture in practice) reuses the kind cluster lab, the helm-charts repository, and the myapp chart in GHCR; it is recommended to delete only the namespaces and GitOps controllers created in this lesson, and keep the repository and packages.
Overview: the delivery chain from PR to cluster
Interactive: cleanup-order sorting game
Click steps to add them to your sequence; when finished, click “Check”. Goal: clean up this lesson's Argo CD, Flux, Helmfile, and push-based deployments without letting the controllers 'fix' resources back into existence.
Cleanup commands
# 1. Stop Flux reconciliation and uninstall the releases Flux manages
flux delete kustomization myapp-flux --silent # prune=true: deletes objects it applied, such as the HelmRelease; helm-controller then uninstalls the release
flux get hr -A # confirm no HelmRelease remains
# 2. Delete the Argo CD Application (cascade-deletes resources)
kubectl -n argocd patch application myapp-dev --type merge -p '{"metadata":{"finalizers":["resources-finalizer.argocd.argoproj.io"]}}'
kubectl -n argocd delete application myapp-dev
# 3. Helmfile and push-based releases
helmfile -f deploy/helmfile.yaml.gotmpl -e dev destroy
helm uninstall myapp -n myapp-push
# 4. The controllers themselves (when Lesson 6 no longer needs them)
flux uninstall --silent
kubectl delete -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/v3.6.1/manifests/install.yaml
kubectl delete ns argocd myapp-argo myapp-flux myapp-hf myapp-push --ignore-not-found
# 5. Verify
helm list -A
kubectl get ns | grep -E 'myapp|argocd|flux' || echo "clean"
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION clean
Remote cleanup (optional; Lesson 6 still uses the helm-charts repository and the GHCR chart)
# Delete a chart version (GHCR package version) gh api /user/packages/container/charts%2Fmyapp/versions --jq '.[] | "\(.id) \(.metadata.container.tags)"' gh api -X DELETE /user/packages/container/charts%2Fmyapp/versions/<VERSION_ID> # Delete a GitHub Release and its tag gh release delete myapp-0.5.0 --cleanup-tag --yes # Revoke the local signing private key and credentials gpg --delete-secret-and-public-key "Helm Lab"; rm -f /tmp/secring.gpg helm registry logout ghcr.io
Note: Deleting a published version breaks users who depend on it and the links in index.yaml; public repositories usually only “deprecate” (set in Chart.yaml deprecated: true and publish a new version) instead of deleting. Signature records in Rekor cannot be deleted.
Lab 8: self-check + cleanup (about 6 minutes)
contents/packages/id-token). Compare with the labs for Modules 1, 2, and 3.for ns in myapp-argo myapp-flux myapp-push; do echo "== $ns"; helm list -n $ns -q; kubectl get secret -n $ns -l owner=helm -o name; done
== myapp-argo == myapp-flux myapp secret/sh.helm.release.v1.myapp.v3 … v7 (maxHistory defaults to 5; only the latest 5 are kept) == myapp-push myapp secret/sh.helm.release.v1.myapp.v3
Case 1: deleting in the wrong order during cleanup makes resources “come back”
Problem: The ops team first kubectl delete ns myapp-flux, and a few minutes later the namespace and app reappeared. Cause: The Kustomization was still present and recreated the Namespace and HelmRelease from Git. Approach: First suspend / delete the parent Kustomization, or remove the matching directory from Git (prune).
Case 2: release conflict when migrating from Argo CD to Flux
Problem: The same app is managed on both sides: Argo CD selfHeal and Flux driftDetection keep overwriting each other. Approach: First delete the Application from Argo CD, but not cascade-delete it (remove the finalizer); then let the HelmRelease take over with the same releaseName. After confirming, clean up Argo CD's tracking annotations.
Case 3: the release job is the single point of failure in the delivery chain
Problem: release.yaml's GITHUB_TOKEN permissions are too broad: after a malicious PR changed the workflow, a malicious chart was published. Approach: Publishing runs only on push to the protected main branch; least privilege; the signing identity is pinned exactly to the workflow on the main branch; consumers (Flux) enforce signature verification; changes to workflow files require CODEOWNERS review.
Interactive troubleshooting tree: five typical failures in this lesson
Start from the symptom and choose step by step; finally, get diagnostic commands and fix suggestions.
1. List the release Secrets recorded by Helm in all namespaces, and determine which apps are managed by Helm/Flux.
kubectl get secret -A -l owner=helm -o custom-columns=NS:.metadata.namespace,NAME:.metadata.name,STATUS:.metadata.labels.status
2. Suspend all Flux HelmReleases (before a maintenance window).
flux suspend hr --all -n myapp-flux
A new colleague asks: “Why do we need both ct install in CI and Flux remediation? Isn't that redundant?” How do you answer?
They guard different stages. ct install runs before merge, in an isolated kind cluster, to verify that the chart itself installs, upgrades from the previous version, and passes helm test; it catches chart defects. Flux remediation handles environment-specific failures in the real environment (missing image, quota, external dependency, wrong config values) and keeps them from affecting production. The former lowers the rate of occurrence; the latter limits the blast radius.
Verified teaching videos
Official docs
Video storyboard script (about 60 seconds)
Visual: a conveyor belt from PR to cluster, with five stations lighting up in turn (write, test, publish and sign, deploy, upgrade and roll back).
Narration: over the first five hours, we walked through the entire delivery chain of a chart.
Visual: each of the five branches of the troubleshooting tree lights up a red dot, then turns green one by one.
Narration: every stage has typical failures; the troubleshooting tree helps you go from symptom to root cause.
Visual: press “Pause reconciliation” first, then delete the resources; the resources do not come back.
Narration: when cleaning up, stop the controllers first, then delete the resources.
Command cheat sheet
helm lint charts/myapp --strict --kube-version 1.37.0
ct list-changed --target-branch main
ct lint --config ct.yaml
ct install --config ct.yaml --upgrade
ct install --charts charts/myapp --skip-clean-up --debug
helm template t charts/myapp -f charts/myapp/ci/default-values.yaml \
| kubeconform -strict -summary -kubernetes-version 1.37.0 -schema-location default \
-schema-location 'https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/{{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json'helm package charts/myapp -d dist helm package charts/myapp --version 0.5.1-rc.1 --app-version "$(git rev-parse --short HEAD)" helm registry login ghcr.io -u $GH_USER --password-stdin helm push dist/myapp-0.5.0.tgz oci://ghcr.io/$GH_USER/charts helm show chart oci://ghcr.io/$GH_USER/charts/myapp --version 0.5.0 cr package charts/myapp cr upload -o $GH_USER -r helm-charts --skip-existing cr index -o $GH_USER -r helm-charts --push cr push --registry-url oci://ghcr.io/$GH_USER/charts --skip-existing
helm-docs --chart-search-root charts && git diff --exit-code helm package --sign --key 'Helm Lab' --keyring /tmp/secring.gpg charts/myapp helm verify myapp-0.5.0.tgz --keyring helm-lab-pub.asc helm install myapp ./myapp-0.5.0.tgz --verify --keyring helm-lab-pub.asc cosign sign --yes ghcr.io/$GH_USER/charts/myapp@$DIGEST cosign verify ghcr.io/$GH_USER/charts/myapp@$DIGEST \ --certificate-identity "https://github.com/$GH_USER/helm-charts/.github/workflows/release.yaml@refs/heads/main" \ --certificate-oidc-issuer https://token.actions.githubusercontent.com
argocd repo add ghcr.io/$GH_USER/charts --type helm --name ghcr --enable-oci argocd app manifests myapp-dev argocd app diff myapp-dev argocd app sync myapp-dev && argocd app wait myapp-dev --health argocd app history myapp-dev argocd app set myapp-dev --helm-set replicaCount=2 # emergency only helm list -n myapp-argo # empty
flux get sources oci -A flux get hr -A flux reconcile hr myapp -n myapp-flux --with-source flux reconcile hr myapp -n myapp-flux --reset flux reconcile hr myapp -n myapp-flux --force flux suspend hr myapp -n myapp-flux ; flux resume hr myapp -n myapp-flux flux events --for HelmRelease/myapp -n myapp-flux flux debug hr myapp -n myapp-flux --show-values helm history myapp -n myapp-flux
helmfile init helmfile -e dev lint helmfile -e dev template helmfile -e dev diff --detailed-exitcode --suppress-secrets helmfile -e dev apply helmfile -e prod -l name=myapp --include-needs apply helmfile -e dev destroy
helm diff upgrade myapp $REF --version 0.5.2 -n myapp -f dev.yaml helm upgrade myapp $REF --version 0.5.2 -n myapp --dry-run=server helm upgrade --install myapp $REF --version 0.5.2 -n myapp \ --rollback-on-failure --timeout 5m --cleanup-on-fail helm upgrade … --wait --wait-for-jobs helm rollback myapp 0 -n myapp --wait helm get manifest myapp -n myapp --revision 2
flux delete kustomization myapp-flux --silent kubectl -n argocd delete application myapp-dev helmfile -e dev destroy helm uninstall myapp -n myapp-push flux uninstall --silent kubectl delete ns argocd myapp-argo myapp-flux myapp-hf myapp-push --ignore-not-found
Key fields at a glance
| Object | Field | Key points |
|---|---|---|
| ct.yaml | target-branch,chart-dirs,check-version-increment,upgrade | checkout needs fetch-depth: 0 |
| chart-releaser-action | charts_dir,skip_existing,oci_registry_url,CR_TOKEN | contents: write,persist-credentials: true |
| Argo CD Application | chart,targetRevision,helm.valueFiles/valuesObject,ref: values | the OCI repoURL does not include oci:// |
| Flux HelmRelease | chartRef,upgrade.remediation,driftDetection,dependsOn,valuesFrom | retries defaults to 0; after they are used up, you need --reset |
| Flux OCIRepository | ref.semver,layerSelector,verify.matchOIDCIdentity | the revision includes the digest |
| Helmfile | environments,repositories(oci: true),needs,installed | template files need .gotmpl |
Capstone lab + final quiz
contents: read; release job contents: write,packages: write,id-token: write. Keyless signing writes the repository and workflow paths to the public transparency log. Do not store a PAT in the repository; revoke the PAT used to log in to GHCR locally as soon as you are done.charts/myapp (0.5.x),ct.yaml,charts/myapp/ci/{default,servicemonitor}-values.yaml; the kind cluster lab is ready.contianers PR with a typo, and confirm they fail at ct lint and kubeconform respectively; once fixed, everything passes.oci_registry_url pointing to GHCR) + cosign-installer v4.1.3 to sign by digest. Merge 0.6.0:
gh release view myapp-0.6.0 helm show chart oci://ghcr.io/$GH_USER/charts/myapp --version 0.6.0 2>&1 | grep Digest cosign verify ghcr.io/$GH_USER/charts/myapp@$DIGEST \ --certificate-identity "https://github.com/$GH_USER/helm-charts/.github/workflows/release.yaml@refs/heads/main" \ --certificate-oidc-issuer https://token.actions.githubusercontent.com >/dev/null && echo SIGNED
$values), namespace myapp-argo, automated + selfHeal. Verify Healthy,helm list -n myapp-argo is empty.0.6.x + cosign matchOIDCIdentity) + HelmRelease (upgrade retries 2 / rollback / remediateLastFailure, driftDetection enabled, test enable). Verify SourceVerified=True,helm history has revision 1.image.tag to 9.9 and push, curling both services in a loop during this:
kubectl -n myapp-argo port-forward svc/myapp 8081:80 & kubectl -n myapp-flux port-forward svc/myapp 8083:80 &
while true; do printf "argo=%s flux=%s\n" $(curl -s -o /dev/null -w "%{http_code}" localhost:8081/healthz) $(curl -s -o /dev/null -w "%{http_code}" localhost:8083/healthz); sleep 5; done
Observations: the Argo CD app becomes Progressing / Degraded (old Pods keep serving), and requires git revert; Flux shows UpgradeFailed → Rollback,helm history several “Rollback to N” entries appear in the history, and once retries are exhausted Ready=False. After the revert, both recover, and Flux's failure counter is reset.kubectl set env create drift and confirm DriftCorrected; locally, manually helm push an unsigned 0.6.1, and confirm that Flux's OCIRepository SourceVerified=False, staging does not upgrade.Acceptance checklist
Open-ended self-check (answer on your own first, then expand the reference answer)
1. Why is ct's version-bump check a prerequisite for immutable releases?
The release process uses the version in Chart.yaml to decide whether to create a new Release or tag. If the content changes but the version does not, either the release is skipped (production never gets the fix) or the old version is overwritten (different consumers get different bytes). Enforcing a version bump in the PR stage guarantees “one version = one set of content.”
2. The same chart is deployed by Argo CD and Flux,pre-upgrade how does hook behavior differ?
Flux uses the Helm SDK: pre-upgrade runs only on upgrade, not on install; Argo CD maps both pre-install and pre-upgrade to PreSync, which runs on every sync. helm test can run in Flux (test.enable), but is ignored in Argo CD.
3. How would you handle an internal CRD with no public schema in kubeconform?
Generate a JSON Schema from the cluster or the CRD source file with openapi2jsonschema, store it in the repository schemas/ and update it with the CRD version; kubeconform appends -schema-location 'schemas/{{.ResourceKind}}{{.KindSuffix}}.json'. Only as a last resort, use -skip, and list the skipped kinds in the PR output.
4. In Flux, the use cases for upgrade.strategy: RetryOnFailure versus the default RemediateOnFailure?
RemediateOnFailure (the default) rolls back via remediation on failure and suits stateless services, protecting production. RetryOnFailure does not roll back; it retries at intervals and suits scenarios where rollback is costly or impossible (such as stateful components or CRD upgrades) and where you want the failed state kept for investigation.
5. In keyless signing, when verifying, specifying only --certificate-oidc-issuer and not the identity: what is the risk?
Anyone who uses GitHub Actions can obtain a certificate from the same issuer and sign any artifact, and verification will pass; you must constrain the identity (repository + workflow + branch). Flux's matchOIDCIdentity.subject uses the same principle.
6. How do Helmfile, Argo CD, and Flux divide responsibilities on your platform?
Reference: Helmfile handles cluster bootstrap (installing the GitOps controllers, cert-manager, and a few other platform components) and local development environments; business apps and the remaining platform components are continuously reconciled by one GitOps tool: choose Argo CD if you need a UI and centralized multi-cluster management, and Flux if you need native Helm semantics and automatic remediation. Avoid having two tools manage the same app.
Final quiz (12 questions, covering all modules)
Sources and version notes
| Topic | Verification result | Sources (accessed 2026-11-15) |
|---|---|---|
| Helm version and parameters | v4.3.2 (2026-11-13); helm upgrade: --rollback-on-failure (after setting --wait the default is watcher),--wait wait strategy watcher / hookOnly / legacy (hookOnly when unspecified),--timeout default 5m,--server-side default auto,--force-replace,--force-conflicts,--take-ownership,--history-max default 10; helm lint --strict (warnings count as failures),--kube-version | helm upgrade · helm lint · helm/helm releases |
| Helm provenance | --key is a uid substring, not a fingerprint; GnuPG 2.1+ requires exporting the private key file; Helm 4.3.0+ can read kbx and ASCII-armored public keys when verifying; helm package has --passphrase-file; when the .prov and tgz are in the same directory, helm push upload them together; the Helm docs mention the helm-sigstore plugin | Provenance · Registries · helm package |
| chart-testing | ct v3.15.0 (2026-10-06); chart-testing-action v2.9.0 installs ct 3.15.0 by default; ct install/lint parameters (--target-branch default main,--remote default origin,--upgrade,--skip-clean-up,--charts/--all disable change detection and version checks,check-version-increment default true); configuration precedence and lookup paths; library charts are not installed | helm/chart-testing(README, doc/ct_install.md, doc/ct_lint.md) · chart-testing-action |
| kind-action | v1.15.2 (2026-11-04); default kind v0.33.0, kubectl v1.37.1, cluster name chart-testing | helm/kind-action |
| kubeconform | v0.8.0 (2026-06-04); -schema-location default points to yannh/kubernetes-json-schema (confirmed to contain v1.37.0-standalone-strict); CRDs-catalog template {{.Group}}/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json (confirmed that ServiceMonitor, Application, and HelmRelease schemas exist); openapi2jsonschema | yannh/kubeconform · CRDs-catalog |
| chart-releaser | cr v1.10.1, action v1.9.0 (2026-10-31); inputs charts_dir, charts, skip_existing, mark_as_latest, packages_with_index, pages_branch, oci_registry_url; outputs changed_charts, chart_version, releases; creates gh-pages automatically if missing; checkout v6.0.1+/v7 + persist-credentials; CR_REPLACE_EXISTING (v1.10+; immutable releases cannot be replaced); CR_GENERATE_RELEASE_NOTES; cr push pushes .prov | chart-releaser-action · chart-releaser |
| helm-docs | v1.14.2 (2024-07-08, still the latest); # -- comments,# @default --,--chart-search-root,--template-files, pre-commit hooks, image jnorwood/helm-docs | norwoodj/helm-docs |
| cosign | cosign v3.1.4 (2026-10-20); v3 defaults to the new bundle format, and signatures are stored as OCI 1.1 referring artifacts; cosign-installer v4.1.3 | cosign releases(v3.0.0 notes) · cosign-installer |
| Argo CD | v3.6.1 (2026-11-04); Helm is used only for helm template; since 3.5, only Helm v4 renders; value precedence parameters > valuesObject > values > valueFiles; OCI repoURL does not include oci://; multi-source ref: values; hooks mapping table (test / rollback hooks not supported; once an Argo CD hook is defined, all Helm hooks are ignored); enableOCI | Argo CD Helm · Private Repositories · releases |
| Flux | v2.10.0 (2026-10-26), helm-controller v1.7.1; HelmRelease v2: chartRef (OCIRepository / HelmChart / ExternalArtifact), revision version+digest[0:12], install/upgrade remediation (retries default 0, strategy default rollback, remediateLastFailure), upgrade.strategy (RemediateOnFailure / RetryOnFailure, retryInterval default 5m), driftDetection (warn/enabled, ignore), waitStrategy (poller default), dependsOn, maxHistory default 5, releaseName composition rules, storageNamespace,--reset/--force; OCIRepository verify (cosign/notation, matchOIDCIdentity) | HelmReleases · OCIRepositories |
| Helmfile / helm-diff | Helmfile v1.8.4 (2026-11-13), supports Helm 3.x and 4.x, and requires helmfile init installing helm-diff; v1.8.2 skips recreatePods under Helm 4; helm-diff v3.15.15 — Helm 4 verifies plugin provenance by default, so installing from the tarball URL is recommended | helmfile/helmfile · Docs · helm-diff |
| Other action / tool versions | azure/setup-helm v5.1.0; actions/checkout v7.0.1; actions/setup-python v7.1.0; docker/login-action v4.8.0; Argo Rollouts v1.10.2; Flagger v1.45.0; kind v0.33.0; oras v1.3.6 | Each project's GitHub Releases (queried via the GitHub API) |
Video verification notes
The following videos had their titles and channels verified via the YouTube oEmbed endpoint (2026-11-15): TechWorld with Nana, “GitHub Actions Tutorial - Basic Concepts and CI/CD Pipeline with Docker” (R8_veQiYBjI); “What is Helm in Kubernetes? Helm and Helm Charts explained | Kubernetes Tutorial 23” (-ykwb1d0DXU); “ArgoCD Tutorial for Beginners | GitOps CD for Kubernetes” (MeU5_k9ssrs); “What is GitOps, How GitOps works and Why it's so useful” (f5EpcWp0THw); Terry Howe, “Helm with oras-go v3 Demo Mirroring and Blocking Registries” (3yPa6mz0nas); Cloud Native Skunkworks, “What is sigstore? The future of supply chain security?” (hAcMGttHCFw); Akuity, “How to Use Private OCI Helm Repositories in Argo CD” (Hn4pgrySYRU); DevOps & AI Toolkit, “Flux CD v2 With GitOps Toolkit - Kubernetes Deployment And Sync Mechanism” (R6OeIgb7lUI) and “Helmfile - How to manage Kubernetes Helm releases” (qIJt8Iq8Zb0); Techno Tim, “Flux GitOps Tutorial - DevOps and GitOps for Kubernetes” (PFLimPh5-wo); Argo Proj, “Argo Rollouts Demo” (hIL0E2gLkf8). oEmbed does not return duration or publish date, so durations are not listed. Three topics (chart-testing / kubeconform, helm-docs / provenance, and Helm 4 wait and rollback) had no verified dedicated video, so storyboard scripts are provided instead. All videos are in English; most were recorded before Helm 4 / Argo CD v3 / Flux v2.10, so this lesson takes precedence for version details.
Voice narration notes
The “Voice” tab uses the browser's Web Speech API (speechSynthesis zh-CN) to read the narration script aloud, with English terms pronounced in en-US; results depend on the operating system's voice packs. This courseware has no embedded audio; the narration script can be given to a TTS tool to generate audio.
Known limitations
- The commands in this lesson were written from the official docs and were not actually run in this environment; the usernames, digests, times, revision counts, and message text in the “expected output” are all example values.
- The following were handled conservatively and marked “see the official docs”: when Argo CD renders
.Capabilitiesthe sources andhelm.kubeVersion/apiVersionsoverride fields; Argo CD v3 default resource tracking; Argo CD's support for chart signature verification (not claimed in this lesson); HelmfilehelmDefaults's corresponding Helm 4--rollback-on-failurekey names (so the examples do not use them); HelmRelease's take-ownership default behavior; how cosign signatures are stored in GHCR (referrers or the fallback tag scheme); and the exact wording of helm-controller events and helm history. - chart-releaser-action's
packages_with_index,CR_REPLACE_EXISTINGand other advanced usage is only briefly covered; for production use, read the recovery instructions in the README in full. - Flagger and Argo Rollouts are only briefly introduced (Lessons 6 and 7 do not expand on them); the canary example omits the Service, traffic routing, and AnalysisTemplate definitions.
- The timing, counters, and logs in the animations illustrate the mechanism; some retries and events are omitted.
- Lessons 6–8 of this Helm course are being written in parallel with this lesson; cross-lesson references defer to the final content of each lesson.