Skip to main content
Cluster operationsLesson 9 of 16

Helm and GitOps

With many manifests, you must track two things separately: "what did I install together" and "is the cluster in the right state now". Helm solves the first, GitOps the second. Here we follow how a Helm release and a GitOps sync tool (for example Argo CD or Flux) keep the cluster in line.

Helm revision—
Desired state in Git—
Live cluster statenone
Sync status—
Workload clusterDevelopermakes changesHelm chartmanifest templatevaluesper-env valuesGit reposource of truthOperatoredits directlyGitOps toolin the clusterweb applive statefill blanks
RequestWatchAppears in a later step

What you will learn

  • A chart plus values becomes a release
  • Upgrades and rollbacks are recorded as revisions
  • A GitOps tool pulls from Git and aligns the cluster
  • Drift is detected and reverted

Push vs. pull​

AspectPush (CI/CD pipeline deploy)Pull (GitOps)
Who appliesExternal CI/CD toolGitOps tool inside the cluster
WhenOnce, when a run is triggeredContinuously (periodic comparison)
Source of truthThe tool's deploy config and run historyGit repository
RevertingPick an earlier version from history and reapplyRevert to an earlier commit in Git and the tool follows
Direct editsStay until the next deployDetected as drift and may be reverted

Try it yourself​

helm list -A # Releases and their current revision
helm history <release> -n <namespace> # Revisions, rollbacks included
helm get values <release> -n <namespace> # values that filled the chart
argocd app get <app> # Argo CD: Synced or OutOfSync
argocd app diff <app> # Drift between Git and the cluster
flux get kustomizations -A # Flux: ready state and applied revision

Check yourself

  1. You roll a Helm release at revision 2 back to revision 1. What does helm history show afterwards?
  2. In a GitOps setup, an operator scales a Deployment from 3 to 5 Pods with kubectl. What is most likely to happen?
  3. Version 1.4.2 has a bug and the cluster is managed by Argo CD. What is the GitOps way to roll back?

Further reading: Helm docs · OpenGitOps principles · Argo CD docs · Flux docs