Chapter 96: Flux GitOps — Sources, Reconciliation and Safe Local Practice
96.9 HelmRelease, charts and values
Fictional teaching story. At a fictional Aurangabad team, Pooja and Alex distinguish the packaged lesson kit from the schedule that installs and maintains it.
Why
A chart package and a release configuration are different layers with different failure evidence.
What
Keep source reference, release intent and chart values separate.
How
A HelmRelease reconciles a Helm release
Helm packages Kubernetes templates into a chart. A release is an installed instance of that chart. A HelmRelease describes the desired release for helm-controller.
Immediate practice example
- Read the example from top to bottom. Do not send it to a real cluster.
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: classroom-web
namespace: flux-system
spec:
interval: 5m
chartRef:
kind: OCIRepository
name: classroom-chart
- Read the expected result.
Illustrative output: not executed by Flux, kubectl, Helm or Kubernetes.
No chart is downloaded or installed. A real controller would need the referenced OCIRepository and valid chart artifact.
- Understand each line in plain English.
The API and kind identify the fetched stable example form. Metadata identifies the release object. The interval belongs to Helm reconciliation. chartRef references an existing chart source; a full OCIRepository would have its own documented source configuration. This example intentionally does not create that source or choose a real chart version. Use exactly one of chart or chartRef, not both.
Values and drift detection need explicit review
Values are inputs consumed by a particular chart’s templates; their field names depend on that chart. Drift detection compares an installed release’s stored desired manifests with live resources. In a HelmRelease, mode enabled requests correction; warn only reports drift.
Immediate practice example
- Read the example from top to bottom. Do not send it to a real cluster.
spec:
driftDetection:
mode: enabled
- Read the expected result.
Illustrative output: not executed by Flux, kubectl, Helm or Kubernetes.
A real compatible HelmRelease would request drift detection and correction.
- Understand each line in plain English.
This is a partial spec, not a complete deployment instruction. No generic replicas value is assumed because charts differ. The enabled mode is explicit; do not imply every HelmRelease corrects drift by default. Helm install, upgrade, rollback and uninstall behaviour also depends on action and remediation settings. No automatic rollback guarantee is made here.
Ravindra Bagale's Tip
Helm values are chart-specific; a copied field may do nothing.
Helm values chart नुसार असतात; copy केलेलं field काहीच काम करेल असं नाही.
Helm values chart पर निर्भर हैं; copied field काम करेगा ही, ऐसा नहीं.
Did you understand? Let us try it once more.