The exam names both Argo CD and Flux, and this lab wires both to the same Gitea for a reason: you should be able to express the same delivery in either. Flux has no Application monolith; it breaks GitOps into small CRDs that reference each other, and tracing those references is the core skill.

needsmake core

Orientation

competency 2.1 · the other engine

Argo CD gives you one central controller and one big CRD. Flux gives you a toolkit of small controllers and small CRDs wired together by reference. Neither is universally better; they just fail in different ways, and the exam can drop you in front of either. What really carries over is mental translation, which is why the translation table and exercise sit right below.

ControllerOwnsDoes
source-controllerGitRepository, OCIRepository, HelmRepository, HelmChart, BucketFetches sources and publishes an immutable artifact (tarball + revision)
kustomize-controllerKustomizationTakes an artifact and a path, builds manifests, and applies them
helm-controllerHelmReleaseTakes a chart source and manages real Helm installs and upgrades
notification-controllerAlert, Provider, ReceiverSends events out (Slack, webhooks) and takes webhooks in (git push → instant reconcile)
image-*-controllerImageRepository, ImagePolicy, ImageUpdateAutomationScans registry tags and commits new image versions back to git

Keep that last row in your pocket: Flux can close the CI→CD loop by committing the new image tag to git itself. That's the pure pull-based answer to "how does a new build get deployed without CI ever touching the cluster?".

Working model: sources and appliers

one artifact, many consumers
GitRepository/platform  (interval 1m, ref: main)
        │ produces artifact @ revision main/9f2c1ab
        ├────────────▶ Kustomization/apps     path ./apps      prune ✓  interval 5m
        ├────────────▶ Kustomization/infra    path ./infra     prune ✓  dependsOn: []
        └────────────▶ Kustomization/tenants  path ./tenants   dependsOn: [infra]

HelmRepository/podinfo ──▶ HelmRelease/podinfo ──▶ release in target namespace

That two-step split is the heart of Flux's design. One GitRepository can feed as many Kustomization objects as you like, each watching its own path with its own interval, health checks, and prune setting. dependsOn orders them, acting as Flux's counterpart to Argo CD sync waves and operating between top-level objects rather than inside a single sync.

Two things called Kustomization

Flux's Kustomization (kustomize.toolkit.fluxcd.io) isn't the same thing as Kustomize's Kustomization file (kustomize.config.k8s.io). The Flux CR lives in the cluster and points at a directory; that directory may contain a kustomization.yaml file. Exam prompts love leaning on this overlap, and knowing the difference between kubectl get kustomizations.kustomize.toolkit.fluxcd.io and reading a file in git cuts right through it.

Kustomization fields that decide behavior

FieldEffect
intervalHow often Flux re-applies. Drift correction is a built-in side effect of re-applying; there's no separate selfHeal toggle.
pruneDeletes resources removed from git, with the exact same blast radius as Argo CD's prune.
wait / healthChecks / timeoutHolds Ready back until the managed objects are actually healthy, which is what gives dependsOn real teeth.
targetNamespaceOverrides the namespace on every namespaced manifest the path applies.
postBuild.substitute / substituteFromSubstitutes variables from inline maps, ConfigMaps, or Secrets after kustomize build: Flux's clean answer to "one manifest, per-cluster values".
serviceAccountNameImpersonates that ServiceAccount when applying, enforcing multi-tenancy so a tenant's Kustomization can't exceed its own RBAC.
decryptionNative SOPS decryption at apply time for encrypted secrets in git.

HelmRelease

A HelmRelease points at a chart (from a HelmRepository, GitRepository, or OCIRepository), merges inline values with valuesFrom ConfigMaps and Secrets, and controls failure recovery via install.remediation and upgrade.remediation (retry counts and rollback strategy). Modern Flux also detects and corrects drift on the release's rendered manifests. When a HelmRelease breaks, the whole diagnostic trick is spotting which layer failed: source resolution (couldn't fetch the chart), install/upgrade (Helm itself errored), or health checks (the release installed, but the workload never came up). Each layer writes a distinct condition, so reading the right one points straight to the fix.

Daily verbs

flux get sources git                      # and: helm, oci, bucket, all
flux get kustomizations                   # Ready, revision, last applied
flux reconcile kustomization demo-flux --with-source   # force the loop now, refetch first
flux suspend kustomization demo-flux           # the sanctioned pause for surgery
flux resume kustomization demo-flux
flux tree kustomization demo-flux              # what did this thing create
flux events --for Kustomization/demo-flux
flux logs --level=error --all-namespaces
flux trace deploy/demo -n flux-demo       # which Flux object owns this resource
outputcaptured 2026-08-26
$ flux get sources git                      # and: helm, oci, bucket, all
NAME    	REVISION          	SUSPENDED	READY	MESSAGE                                           
platform	main@sha1:c7cb9a1e	False    	True 	stored artifact for revision 'main@sha1:c7cb9a1e'	
$ flux get kustomizations                   # Ready, revision, last applied
NAME     	REVISION          	SUSPENDED	READY	MESSAGE                              
demo-flux	main@sha1:c7cb9a1e	False    	True 	Applied revision: main@sha1:c7cb9a1e	
$ flux reconcile kustomization demo-flux --with-source   # force the loop now, refetch first
► annotating GitRepository platform in flux-system namespace
✔ GitRepository annotated
◎ waiting for GitRepository reconciliation
✔ fetched revision main@sha1:c7cb9a1e37949219ff64e2c5dd17654109deea6d
► annotating Kustomization demo-flux in flux-system namespace
✔ Kustomization annotated
◎ waiting for Kustomization reconciliation
✔ applied revision main@sha1:c7cb9a1e37949219ff64e2c5dd17654109deea6d
$ flux suspend kustomization demo-flux           # the sanctioned pause for surgery
► suspending kustomization demo-flux in flux-system namespace
✔ kustomization suspended
$ flux resume kustomization demo-flux
► resuming kustomization demo-flux in flux-system namespace
✔ kustomization resumed
◎ waiting for Kustomization reconciliation
✔ Kustomization demo-flux reconciliation completed
✔ applied revision main@sha1:c7cb9a1e37949219ff64e2c5dd17654109deea6d
$ flux tree kustomization demo-flux              # what did this thing create
Kustomization/flux-system/demo-flux
├── Service/flux-demo/demo
└── Deployment/flux-demo/demo

$ flux events --for Kustomization/demo-flux
LAST SEEN           	TYPE  	REASON                    	OBJECT                 	MESSAGE                                                                                                      
31m                 	Normal	NewArtifact               	GitRepository/platform 	stored artifact for commit 'seed lab manifests'                                                             	
5m34s (x26 over 30m)	Normal	GitOperationSucceeded     	GitRepository/platform 	no changes since last reconciliation: observed revision 'main@sha1:62d527f00a730f9a9b30cbd70a20b8e138f70bd6'	
4m35s               	Normal	NewArtifact               	GitRepository/platform 	stored artifact for commit 'staging: 3 replicas'                                                            	
3m33s               	Normal	GarbageCollectionSucceeded	GitRepository/platform 	garbage collected 1 artifacts                                                                               	
2m10s               	Normal	Progressing               	Kustomization/demo-flux	Service/flux-demo/demo created                                                                              	
                    	      	                          	                       	Deployment/flux-demo/demo created                                                                           	
2m10s               	Normal	ReconciliationSucceeded   	Kustomization/demo-flux	Reconciliation finished in 653.93345ms, next run in 1m0s                                                    	
92s (x3 over 3m33s) 	Normal	GitOperationSucceeded     	GitRepository/platform 	no changes since last reconciliation: observed revision 'main@sha1:c7cb9a1e37949219ff64e2c5dd17654109deea6d'	
68s                 	Normal	Progressing               	Kustomization/demo-flux	Deployment/flux-demo/demo configured                                                                        	
68s                 	Normal	ReconciliationSucceeded   	Kustomization/demo-flux	Reconciliation finished in 553.601679ms, next run in 1m0s                                                   	
6s                  	Normal	ReconciliationSucceeded   	Kustomization/demo-flux	Reconciliation finished in 481.338357ms, next run in 1m0s                                                   	
4s                  	Normal	ReconciliationSucceeded   	Kustomization/demo-flux	Reconciliation finished in 227.246168ms, next run in 1m0s                                                   	
1s                  	Normal	ReconciliationSucceeded   	Kustomization/demo-flux	Reconciliation finished in 343.998075ms, next run in 1m0s                                                   	
$ flux logs --level=error --all-namespaces
$ flux trace deploy/demo -n flux-demo       # which Flux object owns this resource

Object:          Deployment/demo
Namespace:       flux-demo
Status:          Managed by Flux
---
Kustomization:   demo-flux
Namespace:       flux-system
Target:          flux-demo
Path:            ./demo-app/base
Revision:        main@sha1:c7cb9a1e37949219ff64e2c5dd17654109deea6d
Status:          Last reconciled at 2026-08-26 22:20:37 -0400 EDT
Message:         Applied revision: main@sha1:c7cb9a1e37949219ff64e2c5dd17654109deea6d
---
GitRepository:   platform
Namespace:       flux-system
URL:             http://gitea.lab:3000/lab/platform.git
Branch:          main
Revision:        main@sha1:c7cb9a1e37949219ff64e2c5dd17654109deea6d
Status:          Last reconciled at 2026-08-26 22:16:03 -0400 EDT
Message:         stored artifact for revision 'main@sha1:c7cb9a1e37949219ff64e2c5dd17654109deea6d'

flux trace is your reverse lookup: hand it any live Kubernetes resource and it tells you which Kustomization or HelmRelease put it there. On an unfamiliar cluster, it's the fastest orientation command Flux offers.

Suspend is a real answer

"Stop the controller from overwriting my hotfix while I debug" has a named, auditable answer in both engines: flux suspend, or turning off auto-sync in Argo CD. Scaling kustomize-controller down to zero technically pauses reconciliation too, but it'll cost you the mark because it freezes the entire cluster and leaves no trace on the object.

More Kustomization fields and the per-resource annotations

  • retryInterval controls how quickly Flux retries after a failure (defaults to interval), while timeout caps build, apply, and health checks combined.
  • deletionPolicy takes MirrorPrune (default: delete managed objects when the Kustomization is deleted only if prune: true), Delete, WaitForTermination, or Orphan. Reach for Orphan when a namespace teardown would otherwise race the controller.
  • healthCheckExprs lets you write CEL current, failed, and inProgress rules per apiVersion/kind for CRDs that kstatus doesn't understand natively. dependsOn[].readyExpr does the same for dependencies.
  • patches, images, components, namePrefix/nameSuffix, and commonMetadata let the controller apply Kustomize overlays on the fly without modifying the repo.
  • kubeConfig.secretRef targets a remote cluster using a kubeconfig Secret; Flux's multi-cluster model is simply one Kustomization per remote cluster.

You can also place control annotations directly on manifests in git (not on the Kustomization itself). kustomize.toolkit.fluxcd.io/prune: disabled shields PVCs or namespaces from garbage collection. kustomize.toolkit.fluxcd.io/ssa takes Merge (preserve fields other tools add), IfNotPresent (create once and never overwrite, useful for cert-manager Secrets or webhook configs), or Ignore (skip the object completely). kustomize.toolkit.fluxcd.io/force: enabled recreates resources when immutable fields change (handy for Jobs, risky on StatefulSets). Under server-side apply, manual kubectl edits only survive if you pass --field-manager=flux-client-side-apply. Finally, triggering an out-of-band reconcile sets the reconcile.fluxcd.io/requestedAt annotation, which is all flux reconcile does under the hood.

The translation table

say the same thing in either dialect
IntentArgo CDFlux
Where the manifests liveApplication.spec.sourceGitRepository + Kustomization.spec.path
Auto-apply on changesyncPolicy.automatedImplicit: runs every interval
Revert live driftautomated.selfHealImplicit: re-applies every interval
Delete removed resourcesautomated.pruneKustomization.spec.prune
OrderingSync waves + hooksdependsOn + healthChecks + wait
PauseDisable auto-syncflux suspend
Per-env valuesKustomize overlays / Helm valuesSame, plus postBuild.substitute
Tenant guardrailsAppProjectserviceAccountName + namespace isolation
Instant triggerWebhook to argocd-serverReceiver (notification-controller)

Drill moving across this table in both directions until it's automatic.

Condition vocabulary and failure remediation

Ready reasons · HelmRelease install/upgrade remediation · drift detection · force and reset

Flux resources follow the kstatus convention: Ready summarizes overall state, Reconciling (negative polarity, only present while true) tells you work is active with reason Progressing or ProgressingWithRetry, and Stalled means the controller gave up until the spec changes. These reason strings are stable API, so exam prompts can quote them verbatim.

ObjectReady=True reasonsReady=False reasonsOther condition types
GitRepository / OCIRepository / BucketSucceededAuthenticationFailed · GitOperationFailed · OCIArtifactPullFailed · OCIArtifactLayerOperationFailed · VerificationErrorFetchFailed · IncludeUnavailable · StorageOperationFailed · SourceVerified · ArtifactInStorage
KustomizationReconciliationSucceededArtifactFailed · BuildFailed · HealthCheckFailed · PruneFailed · DependencyNotReady · ReconciliationFailedHealthy
HelmReleaseInstallSucceeded · UpgradeSucceeded · TestSucceededInstallFailed · UpgradeFailed · TestFailed · RollbackSucceeded · RollbackFailed · UninstallSucceeded · UninstallFailed · RetriesExceededReleased · TestSuccess · Remediated · Drifted (DriftDetected / NoDriftDetected)

Read that table as a diagnostic ladder. ArtifactFailed means the source isn't Ready or hasn't produced an artifact yet, so fix the source first. BuildFailed points at kustomize build (wrong path, invalid YAML, or a missing substituteFrom ConfigMap without optional: true). DependencyNotReady points you at an upstream Kustomization. ReconciliationFailed quotes the API server's rejection ("field is immutable", "admission webhook denied"). HealthCheckFailed means manifests applied cleanly but never became healthy before timeout. And on a HelmRelease, Ready=False with reason RollbackSucceeded isn't a contradiction: the upgrade failed, remediation rolled back to the last good revision, and the HelmRelease stays not-ready until you fix the chart or values.

HelmRelease failure handling, field by field

  • install.remediation.retries defaults to 0 (no retries; -1 retries forever), uninstalling between attempts. upgrade.remediation.retries defaults to strategy: rollback (or uninstall), and remediateLastFailure defaults to true whenever retries > 0 so the cluster settles on the last good revision instead of a broken one.
  • install.strategy.name and upgrade.strategy.name select either RemediateOnFailure (above) or RetryOnFailure with retryInterval (Flux 2.7+), which retries in place without rolling back.
  • test.enable: true runs Helm tests after install or upgrade; a failing test triggers remediation unless you set test.ignoreFailures: true.
  • install.crds defaults to Create, whereas upgrade.crds defaults to Skip. Helm refuses to upgrade CRDs by default, so a chart upgrade adding new CRD fields needs upgrade.crds: CreateReplace (or better yet, CRDs managed in a separate Kustomization).
  • driftDetection.mode can be disabled (default), warn (emits an event and sets the Drifted condition), or enabled (corrects drift via server-side apply). driftDetection.ignore accepts JSON 6902 paths and a target, serving as Flux's equivalent of Argo's ignoreDifferences for HPA replicas and webhook mutations.
  • Since Flux 2.8, helm-controller uses server-side apply by default (install.serverSideApply, upgrade.serverSideApply: auto), tracks everything it owns in status.inventory, and waits via kstatus polling rather than Helm's built-in wait.
  • valuesFrom[] pulls values from a ConfigMap or Secret using name, valuesKey (default values.yaml), optional targetPath to graft a single key, and optional. Inline values always override valuesFrom.

The three annotations behind flux reconcile

flux reconcile helmrelease X sets reconcile.fluxcd.io/requestedAt. Adding --force sets reconcile.fluxcd.io/forceAt, forcing a fresh install or upgrade even when nothing changed. Adding --reset sets reconcile.fluxcd.io/resetAt, clearing failure counters after RetriesExceeded; without it, an exhausted HelmRelease stays halted until the chart, values, or generation changes. Kustomizations only recognize requestedAt; fixing a stuck one means fixing the underlying cause.

install.retries: 0 is the default

If a chart's first install fails, Flux leaves it failed and won't retry until the spec changes, and only the Ready reason (InstallFailed) tells you. Set install.remediation.retries: 3 and upgrade.remediation.retries: 3 on anything you don't want to babysit, and keep flux reconcile hr X --reset in mind as the manual restart lever.

Sources, image automation, notifications and bootstrap

the fields on each kind · Alert, Provider, Receiver · lockdown flags · CLI verbs

Source kinds

KindPointer fieldsExtras a task may set
GitRepositoryurl · ref.branch | ref.tag | ref.semver | ref.name (refs/pull/1/head) | ref.commitsecretRef (basic auth, token, SSH key, TLS CA), ignore (or .sourceignore), include for other GitRepositories, verify.mode for signed commits, sparseCheckout, recurseSubmodules, provider: github|azure|aws for app or workload identity
OCIRepositoryurl: oci://... · ref.tag | ref.semver | ref.semverFilter | ref.digestlayerSelector, verify.provider: cosign|notation (keyless OIDC or public keys in a Secret), provider: aws|azure|gcp, insecure for plain HTTP registries
HelmRepositoryurl (https:// index, or oci:// with type: oci)secretRef, passCredentials; Flux generates a HelmChart per HelmRelease, which is what flux get sources chart lists
BucketbucketName · endpoint · provider: generic|aws|gcp|azureFor S3-compatible object stores holding config

Every source publishes an Artifact (a tarball plus a revision such as main@sha1:9f2c1ab), and downstream consumers only ever read that artifact. That's why one failing source starves every Kustomization behind it with ArtifactFailed.

Image automation, the loop that closes CI to CD

  • ImageRepository scans a container registry path on an interval, authenticating via secretRef or a cloud provider.
  • ImagePolicy selects one winning tag from the scan using policy.semver.range: 5.0.x, alphabetical, or numerical, optionally paired with filterTags.pattern and an extract group for build tags like main-abc123-1699999999. The winner lands in status.latestRef (image, tag, and digest).
  • ImageUpdateAutomation rewrites matching files under update.path in the sourceRef GitRepository (which needs push credentials) wherever it finds a marker comment like image: ghcr.io/org/app:1.0 # {"$imagepolicy": "flux-system:app"} (append :tag or :name to update just that piece). It commits as git.commit.author and pushes to git.push.branch, which can be a separate branch so a PR gates production.

Notification controller

  • Provider (notification.toolkit.fluxcd.io/v1beta3) configures an outbound target: type (slack, msteams, discord, github, gitlab, generic webhook, and more), address, channel, and secretRef. The github and gitlab providers post commit statuses, putting a red X right on the commit that broke reconciliation.
  • Alert (v1beta3) wires events to a provider via providerRef, eventSeverity: info|error, eventSources (kind, name or *, namespace), inclusionList/exclusionList regexes, and extra eventMetadata.
  • Receiver (v1) accepts inbound webhooks: set type (github, gitlab, bitbucket, harbor, dockerhub, quay, gcr, nexus, acr, generic, generic-hmac, generic-oidc, or cdevents; note there's no gitea type because Gitea sends GitHub-format webhooks, so use github), events, secretRef for the webhook token, and resources to reconcile (a GitRepository, or ImageRepository objects for registry pushes). Expose the webhook-receiver Service yourself and hand the git server status.webhookPath to turn a one-minute poll into an instant pull.

Bootstrap and lockdown recap

flux bootstrap <provider> commits gotk-components.yaml and gotk-sync.yaml under --path, installs the controllers, and wires up the flux-system GitRepository and Kustomization so Flux manages itself from then on. Pass --components-extra to include the image controllers, or --token-auth for HTTPS token auth instead of a deploy key. Multi-tenant lockdown adds three controller flags (--no-cross-namespace-refs=true, --no-remote-bases=true, --default-service-account=default) plus spec.serviceAccountName: kustomize-controller on the flux-system Kustomization, applied as Kustomize patches in your bootstrap directory. Once locked down, any tenant Kustomization that omits serviceAccountName impersonates the namespace's unprivileged default account and fails with a Forbidden inside ReconciliationFailed.

Reflex

flux get all -A --status-selector ready=false filters straight to what's broken, and kubectl get fluxcd -A (the CRD category) lists every Flux object at once. From there, drill down with flux events --for Kustomization/x, flux logs --level=error -A, flux trace, and flux tree. Before pushing a commit, run flux build kustomization x --path ./dir to render locally and flux diff kustomization x --path ./dir to preview the exact cluster diff.

Exercises

tick the dot when its check passes

Deploy the demo base (not the overlays, which Argo owns in 2.2; two controllers must never manage the same resource) into a Flux-owned namespace:

kubectl create ns flux-demo
flux create kustomization demo-flux \
  --source=GitRepository/platform \
  --path=./demo-app/base \
  --target-namespace=flux-demo \
  --prune=true --interval=1m \
  --health-check-timeout=2m
flux get kustomizations
outputcaptured 2026-08-26
$ kubectl create ns flux-demo
namespace/flux-demo created
$ flux create kustomization demo-flux \
  --source=GitRepository/platform \
  --path=./demo-app/base \
  --target-namespace=flux-demo \
  --prune=true --interval=1m \
  --health-check-timeout=2m
✚ generating Kustomization
► applying Kustomization
✔ Kustomization created
◎ waiting for Kustomization reconciliation
✔ Kustomization demo-flux is ready
✔ applied revision main@sha1:c7cb9a1e37949219ff64e2c5dd17654109deea6d
$ flux get kustomizations
NAME     	REVISION          	SUSPENDED	READY	MESSAGE                              
demo-flux	main@sha1:c7cb9a1e	False    	True 	Applied revision: main@sha1:c7cb9a1e	
verify: Ready is True with an applied revision SHA, and kubectl -n flux-demo get deploy demo shows 2/2. Run flux tree kustomization demo-flux and confirm it lists the Deployment, the Service, and nothing else.

Scale the Deployment by hand, then wait out one reconcile interval:

kubectl -n flux-demo scale deploy demo --replicas=5
sleep 70 && kubectl -n flux-demo get deploy demo -o jsonpath='{.spec.replicas}{"\n"}'
outputcaptured 2026-08-26
$ kubectl -n flux-demo scale deploy demo --replicas=5
deployment.apps/demo scaled
$ sleep 70 && kubectl -n flux-demo get deploy demo -o jsonpath='{.spec.replicas}{"\n"}'
2
verify: it snaps back to 2. Same experiment as Argo's selfHeal, different mechanism; be ready to name the component that did it (kustomize-controller re-applying on its interval).

Run flux suspend kustomization demo-flux, scale to 5 again, confirm it stays at 5 across two intervals, then run flux resume kustomization demo-flux and watch it snap back.

verify: flux get kustomizations shows SUSPENDED as True while paused. This is the sanctioned answer to "stop the controller from overwriting my hotfix while I debug".

Sources don't have to be git repos:

flux create source helm podinfo --url=https://stefanprodan.github.io/podinfo --interval=10m
flux create helmrelease podinfo -n flux-demo --source=HelmRepository/podinfo.flux-system \
  --chart=podinfo --release-name=podinfo --target-namespace=flux-demo --interval=5m
kubectl -n flux-demo get deploy podinfo
outputcaptured 2026-11-18
$ flux create source helm podinfo --url=https://stefanprodan.github.io/podinfo --interval=10m
✚ generating HelmRepository source
► applying HelmRepository source
✔ source created
◎ waiting for HelmRepository source reconciliation
✔ HelmRepository source reconciliation completed
✔ fetched revision: sha256:cf283c0bb71bb05b95218dd3325b2dd576a9d1234c99307ddd6fbc7865cfb0d5
$ flux create helmrelease podinfo -n flux-demo --source=HelmRepository/podinfo.flux-system \
  --chart=podinfo --release-name=podinfo --target-namespace=flux-demo --interval=5m
✚ generating HelmRelease
► applying HelmRelease
✔ HelmRelease created
◎ waiting for HelmRelease reconciliation
✔ HelmRelease podinfo is ready
✔ applied revision 6.17.0
$ kubectl -n flux-demo get deploy podinfo
NAME      READY   UP-TO-DATE   AVAILABLE   AGE
podinfo   1/1     1            1           32s

Now break one on purpose: create a second HelmRelease with --chart-version='>99.0.0', inspect the failure in flux get helmreleases and kubectl describe helmrelease, then delete it. Failed source resolution, failed install, and failed health checks each show up in different conditions; spotting which layer broke is the core debugging habit.

verify: flux -n flux-demo get helmreleases shows Ready True at revision 1, and helm list -n flux-demo sees the release (flux create puts Helm storage in the target namespace). Without --release-name, helm-controller would have named both the release and the Deployment flux-demo-podinfo.

From memory, write the Flux equivalent of the Argo CD Application demo-staging from section 2.2 (the GitRepository already exists, so you just need a Kustomization with path, targetNamespace, prune, and interval). Check your draft against flux create kustomization --export.

verify: your hand-written spec matches the exported one field for field.

Remediation is the part of a HelmRelease you only meet during an outage, which is the worst possible time to be guessing field names. Break one on purpose and watch the retry budget, the condition reasons, and the reset recovery in action.

# a leftover release makes this an upgrade, and the install remediation never runs
flux -n flux-demo delete hr broken -s --timeout=90s 2>/dev/null || true
kubectl -n flux-demo patch hr broken --type merge -p '{"metadata":{"finalizers":null}}' 2>/dev/null || true
kubectl -n flux-demo delete hr broken --ignore-not-found --timeout=60s
kubectl -n flux-demo wait --for=delete hr/broken --timeout=60s 2>/dev/null || true
flux create source helm podinfo --url=https://stefanprodan.github.io/podinfo --interval=10m
kubectl create ns flux-demo --dry-run=client -o yaml | kubectl apply -f -
kubectl apply -f - <<'EOF'
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata: { name: broken, namespace: flux-demo }
spec:
  interval: 1m
  chart:
    spec:
      chart: podinfo
      sourceRef: { kind: HelmRepository, name: podinfo, namespace: flux-system }
  install:
    remediation: { retries: 2 }
  timeout: 1m
  values:
    image:
      repository: kind-registry:5000/does-not-exist
      tag: nope
EOF
sleep 240
kubectl -n flux-demo get hr broken -o jsonpath='{.status.conditions}' | jq '.[] | {type, status, reason, message}'
kubectl -n flux-demo get hr broken -o jsonpath='{.status.installFailures}{"\n"}'
flux -n flux-demo events --for HelmRelease/broken | tail -15
# the install remediation already uninstalled, so the recovery runs as an upgrade:
# give it a timeout it can meet and a retry budget, or --reset clears a counter and the retry stalls anyway
kubectl -n flux-demo patch hr broken --type merge -p '{"spec":{"timeout":"5m","upgrade":{"remediation":{"retries":2}},"values":{"image":{"repository":"ghcr.io/stefanprodan/podinfo","tag":"6.7.1"}}}}'
flux -n flux-demo reconcile hr broken --reset --timeout=60s || true
kubectl -n flux-demo get hr broken -o jsonpath='{.status.conditions}' | jq '.[] | {type, status, reason}'
flux -n flux-demo delete hr broken -s --timeout=90s
outputcaptured 2026-11-18
$ # a leftover release makes this an upgrade, and the install remediation never runs
$ flux -n flux-demo delete hr broken -s --timeout=90s 2>/dev/null || true
$ kubectl -n flux-demo patch hr broken --type merge -p '{"metadata":{"finalizers":null}}' 2>/dev/null || true
$ kubectl -n flux-demo delete hr broken --ignore-not-found --timeout=60s
$ kubectl -n flux-demo wait --for=delete hr/broken --timeout=60s 2>/dev/null || true
$ flux create source helm podinfo --url=https://stefanprodan.github.io/podinfo --interval=10m
✚ generating HelmRepository source
► applying HelmRepository source
✔ source created
◎ waiting for HelmRepository source reconciliation
✔ HelmRepository source reconciliation completed
✔ fetched revision: sha256:cf283c0bb71bb05b95218dd3325b2dd576a9d1234c99307ddd6fbc7865cfb0d5
$ kubectl create ns flux-demo --dry-run=client -o yaml | kubectl apply -f -
namespace/flux-demo unchanged
$ kubectl apply -f - <<'EOF'
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata: { name: broken, namespace: flux-demo }
spec:
  interval: 1m
  chart:
    spec:
      chart: podinfo
      sourceRef: { kind: HelmRepository, name: podinfo, namespace: flux-system }
  install:
    remediation: { retries: 2 }
  timeout: 1m
  values:
    image:
      repository: kind-registry:5000/does-not-exist
      tag: nope
EOF
helmrelease.helm.toolkit.fluxcd.io/broken created
$ sleep 240
$ kubectl -n flux-demo get hr broken -o jsonpath='{.status.conditions}' | jq '.[] | {type, status, reason, message}'
{
  "type": "Stalled",
  "status": "True",
  "reason": "RetriesExceeded",
  "message": "Failed to install after 3 attempt(s)"
}
{
  "type": "Ready",
  "status": "False",
  "reason": "InstallFailed",
  "message": "Helm install failed for release flux-demo/broken with chart podinfo@6.17.0: timeout waiting for: [Deployment/flux-demo/broken-podinfo status: 'InProgress']"
}
{
  "type": "Released",
  "status": "False",
  "reason": "InstallFailed",
  "message": "Helm install failed for release flux-demo/broken with chart podinfo@6.17.0: timeout waiting for: [Deployment/flux-demo/broken-podinfo status: 'InProgress']"
}
$ kubectl -n flux-demo get hr broken -o jsonpath='{.status.installFailures}{"\n"}'
3
$ flux -n flux-demo events --for HelmRelease/broken | tail -15
           	                     	       	                          	                          	                                                                                                                                                                                             	
           	                     	       	                          	                          	2026-11-18T06:31:57.554512465Z: creating resource(s): {"resources":2}                                                                                                                        	
           	                     	       	                          	                          	2026-11-18T06:31:57.554535174Z: using server-side apply for resource creation: {"dryRun":false,"fieldValidationDirective":"Strict","forceConflicts":false}                                   	
           	                     	       	                          	                          	2026-11-18T06:31:57.621705004Z: Created resource via patch: {"gvk":"/v1, Kind=Service","name":"broken-podinfo","namespace":"flux-demo"}                                                      	
           	                     	       	                          	                          	2026-11-18T06:31:57.801183992Z: Created resource via patch: {"gvk":"apps/v1, Kind=Deployment","name":"broken-podinfo","namespace":"flux-demo"}                                               	
flux-demo  	103s (x2 over 2m56s) 	Normal 	UninstallSucceeded        	HelmRelease/broken        	Helm uninstall remediation for release flux-demo/broken.v1 with chart podinfo@6.17.0 succeeded                                                                                               	
flux-system	57s (x3 over 2m56s)  	Normal 	ArtifactUpToDate          	HelmChart/flux-demo-broken	artifact up-to-date with remote revision: '6.17.0'                                                                                                                                           	
flux-demo  	30s                  	Warning	InstallFailed             	HelmRelease/broken        	Helm install failed for release flux-demo/broken with chart podinfo@6.17.0: timeout waiting for: [Deployment/flux-demo/broken-podinfo status: 'InProgress']                                  	
           	                     	       	                          	                          	                                                                                                                                                                                             	
           	                     	       	                          	                          	Last Helm logs:                                                                                                                                                                              	
           	                     	       	                          	                          	                                                                                                                                                                                             	
           	                     	       	                          	                          	2026-11-18T06:33:11.433714319Z: creating resource(s): {"resources":2}                                                                                                                        	
           	                     	       	                          	                          	2026-11-18T06:33:11.433755047Z: using server-side apply for resource creation: {"dryRun":false,"fieldValidationDirective":"Strict","forceConflicts":false}                                   	
           	                     	       	                          	                          	2026-11-18T06:33:11.623028022Z: Created resource via patch: {"gvk":"/v1, Kind=Service","name":"broken-podinfo","namespace":"flux-demo"}                                                      	
           	                     	       	                          	                          	2026-11-18T06:33:11.904741149Z: Created resource via patch: {"gvk":"apps/v1, Kind=Deployment","name":"broken-podinfo","namespace":"flux-demo"}                                               	
$ # the install remediation already uninstalled, so the recovery runs as an upgrade:
$ # give it a timeout it can meet and a retry budget, or --reset clears a counter and the retry stalls anyway
$ kubectl -n flux-demo patch hr broken --type merge -p '{"spec":{"timeout":"5m","upgrade":{"remediation":{"retries":2}},"values":{"image":{"repository":"ghcr.io/stefanprodan/podinfo","tag":"6.7.1"}}}}'
helmrelease.helm.toolkit.fluxcd.io/broken patched
$ flux -n flux-demo reconcile hr broken --reset --timeout=60s || true
► annotating HelmRelease broken in flux-demo namespace
✔ HelmRelease annotated
◎ waiting for HelmRelease reconciliation
✗ context deadline exceeded
$ kubectl -n flux-demo get hr broken -o jsonpath='{.status.conditions}' | jq '.[] | {type, status, reason}'
{
  "type": "Reconciling",
  "status": "True",
  "reason": "Progressing"
}
{
  "type": "Ready",
  "status": "Unknown",
  "reason": "Progressing"
}
{
  "type": "Released",
  "status": "False",
  "reason": "InstallFailed"
}
$ flux -n flux-demo delete hr broken -s --timeout=90s
► deleting helmrelease broken in flux-demo namespace
✔ helmrelease deleted
verify: the failing install burns through its retries and stops: Stalled with reason RetriesExceeded, message Failed to install after 3 attempt(s), and status.installFailures at 3. Running --reset clears that counter and moves the release back to Reconciling / Progressing (which is why the 60-second wait times out: resetting restarts the attempts, it doesn't wait them out). Always clear out any leftover release and its finalizer first: if a previous release exists in history, Flux treats this as an upgrade instead of an install, so install.remediation never fires and you see UpgradeFailed / MissingRollbackTarget.

A Kustomization fixes drift automatically because it re-applies on every interval. A HelmRelease doesn't unless you explicitly turn drift detection on; by default Helm only acts when the release spec changes. That's the biggest surprise between the two controllers.

kubectl -n flux-demo get hr podinfo -o jsonpath='{.spec.driftDetection}{"\n"}'
kubectl -n flux-demo patch hr podinfo --type merge -p '{"spec":{"driftDetection":{"mode":"enabled"}}}'
kubectl -n flux-demo scale deploy podinfo --replicas=5
kubectl -n flux-demo get deploy podinfo -o jsonpath='{.spec.replicas}{"\n"}'
sleep 120
kubectl -n flux-demo get deploy podinfo -o jsonpath='{.spec.replicas}{"\n"}'
flux -n flux-demo events --for HelmRelease/podinfo | tail -10
kubectl -n flux-demo get hr podinfo -o jsonpath='{.status.conditions}' | jq '.[] | {type, status, reason}'
outputcaptured 2026-11-18
$ kubectl -n flux-demo get hr podinfo -o jsonpath='{.spec.driftDetection}{"\n"}'
$ kubectl -n flux-demo patch hr podinfo --type merge -p '{"spec":{"driftDetection":{"mode":"enabled"}}}'
helmrelease.helm.toolkit.fluxcd.io/podinfo patched
$ kubectl -n flux-demo scale deploy podinfo --replicas=5
deployment.apps/podinfo scaled
$ kubectl -n flux-demo get deploy podinfo -o jsonpath='{.spec.replicas}{"\n"}'
5
$ sleep 120
$ kubectl -n flux-demo get deploy podinfo -o jsonpath='{.spec.replicas}{"\n"}'
1
$ flux -n flux-demo events --for HelmRelease/podinfo | tail -10
flux-system	13m                  	Normal 	NewArtifact               	HelmRepository/podinfo     	stored fetched index of size 83.35kB from 'https://stefanprodan.github.io/podinfo'                                 	
flux-demo  	2m1s                 	Warning	DriftDetected             	HelmRelease/podinfo        	Cluster state of release flux-demo/podinfo.v1 has drifted from the desired state:                                  	
           	                     	       	                          	                           	Deployment/flux-demo/podinfo changed (0 additions, 1 changes, 0 removals)                                          	
flux-demo  	2m                   	Normal 	DriftCorrected            	HelmRelease/podinfo        	Cluster state of release flux-demo/podinfo.v1 has been corrected:                                                  	
           	                     	       	                          	                           	Deployment/flux-demo/podinfo configured                                                                            	
flux-system	68s (x2 over 43m)    	Normal 	ChartPullSucceeded        	HelmChart/flux-demo-podinfo	pulled 'podinfo' chart with version '6.17.0'                                                                       	
flux-system	68s (x7 over 38m)    	Normal 	ArtifactUpToDate          	HelmChart/flux-demo-podinfo	artifact up-to-date with remote revision: '6.17.0'                                                                 	
$ kubectl -n flux-demo get hr podinfo -o jsonpath='{.status.conditions}' | jq '.[] | {type, status, reason}'
{
  "type": "Ready",
  "status": "True",
  "reason": "InstallSucceeded"
}
{
  "type": "Drifted",
  "status": "False",
  "reason": "NoDriftDetected"
}
{
  "type": "Released",
  "status": "True",
  "reason": "InstallSucceeded"
}
verify: the replica count snaps back on its own, and an event logs that the release's cluster state drifted and was corrected. This builds on the podinfo HelmRelease from above; install that one first if it isn't running.

Pruning keeps a Kustomization authoritative, yet sometimes a specific resource (like a PVC or a shared namespace) has to survive being removed from git. The exemption is an annotation right on the object, so the safety switch lives with the manifest rather than in controller flags.

START=$PWD   # the cd below would otherwise follow you into every later command
rm -rf /tmp/platform-prune-flux && git clone "http://lab:${GITEA_PASS}@gitea.lab:3000/lab/platform.git" /tmp/platform-prune-flux && cd /tmp/platform-prune-flux
kubectl -n flux-demo annotate deploy demo kustomize.toolkit.fluxcd.io/prune=disabled --overwrite
git rm demo-app/base/deployment.yaml
sed -i '/deployment.yaml/d' demo-app/base/kustomization.yaml
git commit -am 'remove the deployment from git' && git push
flux reconcile kustomization demo-flux --with-source
sleep 20
kubectl -n flux-demo get deploy demo
flux events --for Kustomization/demo-flux | tail -10
cd /tmp/platform-prune-flux && git revert --no-edit HEAD && git push
flux reconcile kustomization demo-flux --with-source
kubectl -n flux-demo annotate deploy demo kustomize.toolkit.fluxcd.io/prune-
cd "$START"
outputcaptured 2026-11-18
$ START=$PWD   # the cd below would otherwise follow you into every later command
$ rm -rf /tmp/platform-prune-flux && git clone "http://lab:${GITEA_PASS}@gitea.lab:3000/lab/platform.git" /tmp/platform-prune-flux && cd /tmp/platform-prune-flux
Cloning into '/tmp/platform-prune-flux'...
warning: redirecting to http://gitea.lab:3000/lab/platform.git/
$ kubectl -n flux-demo annotate deploy demo kustomize.toolkit.fluxcd.io/prune=disabled --overwrite
deployment.apps/demo annotated
$ git rm demo-app/base/deployment.yaml
rm 'demo-app/base/deployment.yaml'
$ sed -i '/deployment.yaml/d' demo-app/base/kustomization.yaml
$ git commit -am 'remove the deployment from git' && git push
[main 1a2f292] remove the deployment from git
 2 files changed, 40 deletions(-)
 delete mode 100644 demo-app/base/deployment.yaml
warning: redirecting to http://gitea.lab:3000/lab/platform.git/
To http://gitea.lab:3000/lab/platform.git
   34dd8a1..1a2f292  main -> main
$ flux reconcile kustomization demo-flux --with-source
► annotating GitRepository platform in flux-system namespace
✔ GitRepository annotated
◎ waiting for GitRepository reconciliation
✔ fetched revision main@sha1:1a2f2920ed2219f9f19ff2cf8861d2d775e88818
► annotating Kustomization demo-flux in flux-system namespace
✔ Kustomization annotated
◎ waiting for Kustomization reconciliation
✔ applied revision main@sha1:1a2f2920ed2219f9f19ff2cf8861d2d775e88818
$ sleep 20
$ kubectl -n flux-demo get deploy demo
NAME   READY   UP-TO-DATE   AVAILABLE   AGE
demo   2/2     2            2           48m
$ flux events --for Kustomization/demo-flux | tail -10
47m                 	Normal	ReconciliationSucceeded   	Kustomization/demo-flux	Reconciliation finished in 596.132428ms, next run in 1m0s                                                   	
47m                 	Normal	ReconciliationSucceeded   	Kustomization/demo-flux	Reconciliation finished in 826.720041ms, next run in 1m0s                                                   	
47m                 	Normal	ReconciliationSucceeded   	Kustomization/demo-flux	Reconciliation finished in 853.169803ms, next run in 1m0s                                                   	
46m                 	Normal	Progressing               	Kustomization/demo-flux	Deployment/flux-demo/demo configured                                                                        	
46m                 	Normal	ReconciliationSucceeded   	Kustomization/demo-flux	Reconciliation finished in 778.673757ms, next run in 1m0s                                                   	
45m                 	Normal	ReconciliationSucceeded   	Kustomization/demo-flux	Reconciliation finished in 366.038085ms, next run in 1m0s                                                   	
44m                 	Normal	ReconciliationSucceeded   	Kustomization/demo-flux	Reconciliation finished in 454.195412ms, next run in 1m0s                                                   	
43m                 	Normal	ReconciliationSucceeded   	Kustomization/demo-flux	Reconciliation finished in 628.65389ms, next run in 1m0s                                                    	
3m1s (x40 over 42m) 	Normal	ReconciliationSucceeded   	Kustomization/demo-flux	(combined from similar events): Reconciliation finished in 928.799189ms, next run in 1m0s                   	
2m28s (x46 over 47m)	Normal	GitOperationSucceeded     	GitRepository/platform 	no changes since last reconciliation: observed revision 'main@sha1:34dd8a1a893ac80025f048b52a8d0175018263eb'	
$ cd /tmp/platform-prune-flux && git revert --no-edit HEAD && git push
[main 58d455e] Revert "remove the deployment from git"
 Date: Wed Nov 18 01:45:10 2026 -0500
 2 files changed, 40 insertions(+)
 create mode 100644 demo-app/base/deployment.yaml
warning: redirecting to http://gitea.lab:3000/lab/platform.git/
To http://gitea.lab:3000/lab/platform.git
   1a2f292..58d455e  main -> main
$ flux reconcile kustomization demo-flux --with-source
► annotating GitRepository platform in flux-system namespace
✔ GitRepository annotated
◎ waiting for GitRepository reconciliation
✔ fetched revision main@sha1:58d455efe63982e6fb6dedea70a5dc60f5067c16
► annotating Kustomization demo-flux in flux-system namespace
✔ Kustomization annotated
◎ waiting for Kustomization reconciliation
✔ applied revision main@sha1:58d455efe63982e6fb6dedea70a5dc60f5067c16
$ kubectl -n flux-demo annotate deploy demo kustomize.toolkit.fluxcd.io/prune-
deployment.apps/demo annotated
$ cd "$START"
verify: Flux reconciles cleanly against a revision without the Deployment, and the Deployment is still running. That silence is the whole point: Flux doesn't emit a "skipped prune" event, so a skipped prune looks identical to a no-op reconcile. The annotation on the object is the only record of the exemption. Restore the manifest and strip the annotation before moving on so git and the cluster stay aligned for the next exercises.

Half the real-world Flux tickets you'll ever touch boil down to a path that doesn't exist in the repo. Notice the condition isn't a connection error and isn't an apply error; memorize the exact reason so you can jump straight to the right layer.

kubectl apply -f - <<'EOF'
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata: { name: nowhere, namespace: flux-system }
spec:
  interval: 1m
  prune: true
  sourceRef: { kind: GitRepository, name: platform }
  path: ./does-not-exist
  targetNamespace: flux-demo
EOF
sleep 30
kubectl -n flux-system get kustomization nowhere -o jsonpath='{.status.conditions}' | jq '.[] | {type, status, reason, message}'
flux events --for Kustomization/nowhere | tail -5
flux delete kustomization nowhere -s
outputcaptured 2026-09-13
$ kubectl apply -f - <<'EOF'
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata: { name: nowhere, namespace: flux-system }
spec:
  interval: 1m
  prune: true
  sourceRef: { kind: GitRepository, name: platform }
  path: ./does-not-exist
  targetNamespace: flux-demo
EOF
kustomization.kustomize.toolkit.fluxcd.io/nowhere created
$ sleep 30
$ kubectl -n flux-system get kustomization nowhere -o jsonpath='{.status.conditions}' | jq '.[] | {type, status, reason, message}'
{
  "type": "Reconciling",
  "status": "True",
  "reason": "ProgressingWithRetry",
  "message": "Fetching manifests for revision main@sha1:2cb925cb149a0393023a477f919d901cfec7e371 with a timeout of 30s"
}
{
  "type": "Ready",
  "status": "False",
  "reason": "ArtifactFailed",
  "message": "kustomization path not found: stat /tmp/kustomization-552514629/does-not-exist: no such file or directory"
}
$ flux events --for Kustomization/nowhere | tail -5
LAST SEEN           	TYPE   	REASON                    	OBJECT                	MESSAGE                                                                                                      
27m (x85 over 6h44m)	Normal 	GitOperationSucceeded     	GitRepository/platform	no changes since last reconciliation: observed revision 'main@sha1:83a41e21322e15eff2307bc1e9d5c89e33226d0d'	
22m (x11 over 13h)  	Normal 	GarbageCollectionSucceeded	GitRepository/platform	garbage collected 1 artifacts                                                                               	
2m4s (x20 over 21m) 	Normal 	GitOperationSucceeded     	GitRepository/platform	no changes since last reconciliation: observed revision 'main@sha1:2cb925cb149a0393023a477f919d901cfec7e371'	
29s                 	Warning	ArtifactFailed            	Kustomization/nowhere 	kustomization path not found: stat /tmp/kustomization-552514629/does-not-exist: no such file or directory   	
$ flux delete kustomization nowhere -s
► deleting kustomization nowhere in flux-system namespace
✔ kustomization deleted
verify: the failure points at the kustomization path inside the fetched artifact (ArtifactFailed), not at git connectivity, and the message quotes the missing path verbatim.

A poll interval only promises you're never more than a minute behind. A Receiver eliminates the wait: the git server pokes Flux directly, and reconciliation kicks off the moment you push.

TOKEN=$(head -c 24 /dev/urandom | base64 | tr -d '=+/')
kubectl -n flux-system create secret generic receiver-token --from-literal=token="$TOKEN"
kubectl apply -f - <<'EOF'
apiVersion: notification.toolkit.fluxcd.io/v1
kind: Receiver
metadata: { name: gitea-receiver, namespace: flux-system }
spec:
  # this Flux build has no "gitea" type; Gitea sends GitHub-format webhooks
  type: github
  events: [push]
  secretRef: { name: receiver-token }
  resources:
    - { kind: GitRepository, name: platform }
EOF
sleep 10
kubectl -n flux-system get receiver gitea-receiver -o jsonpath='{.status.webhookPath}{"\n"}'
kubectl -n flux-system patch svc webhook-receiver -p '{"spec":{"type":"NodePort"}}'
# a LoadBalancer IP needs cloud-provider-kind; the NodePort is always reachable from the host
NODE_IP=$(kubectl get node cnpe-control-plane -o jsonpath='{.status.addresses[?(@.type=="InternalIP")].address}')
NODE_PORT=$(kubectl -n flux-system get svc webhook-receiver -o jsonpath='{.spec.ports[0].nodePort}')
HOOK=$(kubectl -n flux-system get receiver gitea-receiver -o jsonpath='{.status.webhookPath}')
echo "webhook URL for Gitea: http://$NODE_IP:$NODE_PORT$HOOK"
flux events --for GitRepository/platform | tail -5
# put the lab back: the Receiver and its token are the only things this exercise needed
kubectl -n flux-system delete receiver gitea-receiver
kubectl -n flux-system delete secret receiver-token
kubectl -n flux-system patch svc webhook-receiver -p '{"spec":{"type":"ClusterIP"}}'
outputcaptured 2026-09-13
$ TOKEN=$(head -c 24 /dev/urandom | base64 | tr -d '=+/')
$ kubectl -n flux-system create secret generic receiver-token --from-literal=token="$TOKEN"
secret/receiver-token created
$ kubectl apply -f - <<'EOF'
apiVersion: notification.toolkit.fluxcd.io/v1
kind: Receiver
metadata: { name: gitea-receiver, namespace: flux-system }
spec:
  # this Flux build has no "gitea" type; Gitea sends GitHub-format webhooks
  type: github
  events: [push]
  secretRef: { name: receiver-token }
  resources:
    - { kind: GitRepository, name: platform }
EOF
receiver.notification.toolkit.fluxcd.io/gitea-receiver created
$ sleep 10
$ kubectl -n flux-system get receiver gitea-receiver -o jsonpath='{.status.webhookPath}{"\n"}'
/hook/a2b76ad1fe000998707d8a990b50c26a825e15ea38b8b30872ae0f7062646270
$ kubectl -n flux-system patch svc webhook-receiver -p '{"spec":{"type":"NodePort"}}'
service/webhook-receiver patched
$ # a LoadBalancer IP needs cloud-provider-kind; the NodePort is always reachable from the host
$ NODE_IP=$(kubectl get node cnpe-control-plane -o jsonpath='{.status.addresses[?(@.type=="InternalIP")].address}')
$ NODE_PORT=$(kubectl -n flux-system get svc webhook-receiver -o jsonpath='{.spec.ports[0].nodePort}')
$ HOOK=$(kubectl -n flux-system get receiver gitea-receiver -o jsonpath='{.status.webhookPath}')
$ echo "webhook URL for Gitea: http://$NODE_IP:$NODE_PORT$HOOK"
webhook URL for Gitea: http://172.18.0.4:31536/hook/a2b76ad1fe000998707d8a990b50c26a825e15ea38b8b30872ae0f7062646270
$ flux events --for GitRepository/platform | tail -5
LAST SEEN           	TYPE  	REASON                    	OBJECT                	MESSAGE                                                                                                      
27m (x85 over 6h44m)	Normal	GitOperationSucceeded     	GitRepository/platform	no changes since last reconciliation: observed revision 'main@sha1:83a41e21322e15eff2307bc1e9d5c89e33226d0d'	
22m (x11 over 14h)  	Normal	GarbageCollectionSucceeded	GitRepository/platform	garbage collected 1 artifacts                                                                               	
2m15s (x20 over 21m)	Normal	GitOperationSucceeded     	GitRepository/platform	no changes since last reconciliation: observed revision 'main@sha1:2cb925cb149a0393023a477f919d901cfec7e371'	
$ # put the lab back: the Receiver and its token are the only things this exercise needed
$ kubectl -n flux-system delete receiver gitea-receiver
receiver.notification.toolkit.fluxcd.io "gitea-receiver" deleted from flux-system namespace
$ kubectl -n flux-system delete secret receiver-token
secret "receiver-token" deleted from flux-system namespace
$ kubectl -n flux-system patch svc webhook-receiver -p '{"spec":{"type":"ClusterIP"}}'
service/webhook-receiver patched
verify: the Receiver publishes a status.webhookPath shaped like /hook/<64 hex characters>, and the final line prints the full URL to paste into Gitea (such as http://172.18.0.4:31536/hook/a2b76ad1...). Notice the type: Flux doesn't have a gitea receiver type, and Gitea speaks GitHub-format webhooks, so github is the right pick. Wire the repo's webhook to that URL with the same secret token and pushes reconcile in seconds instead of waiting on the interval.

Image automation is Flux committing back to git on your behalf: a policy picks the winning tag, and a controller updates the manifest. The marker comment on the image: line is what tells Flux exactly where to write.

flux create image repository demo --image=kind-registry:5000/demo --interval=1m
kubectl -n flux-system patch imagerepository demo --type merge -p '{"spec":{"insecure":true}}'
flux create image policy demo --image-ref=demo --select-semver='>=1.0.0'
skopeo copy --dest-tls-verify=false docker://ghcr.io/stefanprodan/podinfo:6.7.1 docker://localhost:5001/demo:1.0.1
sleep 90
kubectl -n flux-system get imagerepository demo -o jsonpath='{.status.lastScanResult}' | jq
kubectl -n flux-system get imagepolicy demo -o jsonpath='{.status.latestRef}' | jq
# the automation rewrites the line carrying the marker comment, and there is none in the repo yet.
# keep it out of demo-app/overlays: Argo CD syncs that tree and would deploy the rewritten tag into team-a.
rm -rf /tmp/platform-img && git clone "http://lab:${GITEA_PASS}@gitea.lab:3000/lab/platform.git" /tmp/platform-img
mkdir -p /tmp/platform-img/image-automation
cat > /tmp/platform-img/image-automation/deployment.yaml <<'EOF'
apiVersion: apps/v1
kind: Deployment
metadata: { name: image-automation-demo, namespace: flux-demo }
spec:
  replicas: 1
  selector: { matchLabels: { app: image-automation-demo } }
  template:
    metadata: { labels: { app: image-automation-demo } }
    spec:
      containers:
        - name: app
          image: kind-registry:5000/demo:1.0.0 # {"$imagepolicy": "flux-system:demo"}
EOF
git -C /tmp/platform-img add image-automation/deployment.yaml
git -C /tmp/platform-img -c user.name=lab -c user.email=lab@lab.local commit -m 'a manifest for the automation to rewrite'
git -C /tmp/platform-img push
flux create image update demo-auto \
  --interval=1m \
  --git-repo-ref=platform \
  --git-repo-path=./image-automation \
  --checkout-branch=main \
  --push-branch=main \
  --author-name=fluxcdbot \
  --author-email=fluxcdbot@lab.local
flux -n flux-system reconcile image update demo-auto
sleep 30
flux events --for ImageUpdateAutomation/demo-auto | tail -10
git -C /tmp/platform-img fetch && git -C /tmp/platform-img log --format='%an  %s' -1 origin/main
# three objects that would otherwise keep pushing to main forever
flux -n flux-system delete image update demo-auto -s
flux -n flux-system delete image policy demo -s
flux -n flux-system delete image repository demo -s
git -C /tmp/platform-img pull --rebase && git -C /tmp/platform-img rm -r image-automation && git -C /tmp/platform-img -c user.name=lab -c user.email=lab@lab.local commit -m 'remove the automation target' && git -C /tmp/platform-img push
rm -rf /tmp/platform-img
outputcaptured 2026-11-18
$ flux create image repository demo --image=kind-registry:5000/demo --interval=1m
✚ generating ImageRepository
► applying ImageRepository
✔ ImageRepository created
◎ waiting for ImageRepository reconciliation
✗ context deadline exceeded
$ kubectl -n flux-system patch imagerepository demo --type merge -p '{"spec":{"insecure":true}}'
imagerepository.image.toolkit.fluxcd.io/demo patched
$ flux create image policy demo --image-ref=demo --select-semver='>=1.0.0'
✚ generating ImagePolicy
► applying ImagePolicy
✔ ImagePolicy created
◎ waiting for ImagePolicy reconciliation
✔ ImagePolicy reconciliation completed
$ skopeo copy --dest-tls-verify=false docker://ghcr.io/stefanprodan/podinfo:6.7.1 docker://localhost:5001/demo:1.0.1
Getting image source signatures
Copying blob sha256:7e517c53cd4ca936c3bc3d3dc66419278a680214f37444ad0ad1b8bd65968940
Copying blob sha256:35d14af0e611499048effc4d39a2341345f96dd9103c8c186b7cc239a687de5c
Copying blob sha256:2bf70b2badb9fa00aa36d50d61c6b9cc094d7a18fb4a3c7a91ce950dd7202900
Copying blob sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1
Copying blob sha256:43c4264eed91be63b206e17d93e75256a6097070ce643c5e8f0379998b44f170
Copying blob sha256:31eaa2883f08a0ce854d061714a111f052444a3ba1b2323719cb12b872a0dbe3
Copying blob sha256:47f87f374862e0c7555781b116554936999ad2e8e4c6a4e7417688ffe57d8b88
Copying config sha256:c875de4397634b0dc138954cbe2c11b9d86d948b98b17bd9fc3227b3ad992eae
Writing manifest to image destination
$ sleep 90
$ kubectl -n flux-system get imagerepository demo -o jsonpath='{.status.lastScanResult}' | jq
{
  "latestTags": [
    "v1",
    "unsigned",
    "sha256-f451e838d60a425de0f81bd3126670198c3f7f02b89e5e010430abafe66466fa",
    "sha256-ed73e9871dfba28276b28daab3463cc2f9b3c15337dfe0445e8b0f79694e0cd6",
    "sha256-33213719f2b030a8a1260d1c5358f55524f8f690a790e35b14b00c1f50b46ddf",
    "fake",
    "1.0.1"
  ],
  "revision": "sha256:f61672560f43fad55c02265d6556775af987aa15daf21ccf0a92deac2aa7df4c",
  "scanTime": "2026-11-18T06:59:29Z",
  "tagCount": 7
}
$ kubectl -n flux-system get imagepolicy demo -o jsonpath='{.status.latestRef}' | jq
{
  "name": "kind-registry:5000/demo",
  "tag": "1.0.1"
}
$ # the automation rewrites the line carrying the marker comment, and there is none in the repo yet.
$ # keep it out of demo-app/overlays: Argo CD syncs that tree and would deploy the rewritten tag into team-a.
$ rm -rf /tmp/platform-img && git clone "http://lab:${GITEA_PASS}@gitea.lab:3000/lab/platform.git" /tmp/platform-img
Cloning into '/tmp/platform-img'...
warning: redirecting to http://gitea.lab:3000/lab/platform.git/
$ mkdir -p /tmp/platform-img/image-automation
$ cat > /tmp/platform-img/image-automation/deployment.yaml <<'EOF'
apiVersion: apps/v1
kind: Deployment
metadata: { name: image-automation-demo, namespace: flux-demo }
spec:
  replicas: 1
  selector: { matchLabels: { app: image-automation-demo } }
  template:
    metadata: { labels: { app: image-automation-demo } }
    spec:
      containers:
        - name: app
          image: kind-registry:5000/demo:1.0.0 # {"$imagepolicy": "flux-system:demo"}
EOF
$ git -C /tmp/platform-img add image-automation/deployment.yaml
$ git -C /tmp/platform-img -c user.name=lab -c user.email=lab@lab.local commit -m 'a manifest for the automation to rewrite'
[main 7363427] a manifest for the automation to rewrite
 1 file changed, 12 insertions(+)
 create mode 100644 image-automation/deployment.yaml
$ git -C /tmp/platform-img push
warning: redirecting to http://gitea.lab:3000/lab/platform.git/
To http://gitea.lab:3000/lab/platform.git
   2480487..7363427  main -> main
$ flux create image update demo-auto \
  --interval=1m \
  --git-repo-ref=platform \
  --git-repo-path=./image-automation \
  --checkout-branch=main \
  --push-branch=main \
  --author-name=fluxcdbot \
  --author-email=fluxcdbot@lab.local
✚ generating ImageUpdateAutomation
► applying ImageUpdateAutomation
✔ ImageUpdateAutomation created
◎ waiting for ImageUpdateAutomation reconciliation
✔ ImageUpdateAutomation reconciliation completed
$ flux -n flux-system reconcile image update demo-auto
► annotating ImageUpdateAutomation demo-auto in flux-system namespace
✔ ImageUpdateAutomation annotated
◎ waiting for ImageUpdateAutomation reconciliation
✔ repository up-to-date
$ sleep 30
$ flux events --for ImageUpdateAutomation/demo-auto | tail -10
LAST SEEN	TYPE  	REASON   	OBJECT                         	MESSAGE                                  
34s      	Normal	Succeeded	ImageUpdateAutomation/demo-auto	pushed commit 'c7fa30e' to branch 'main'	
         	      	         	                               	Update from image update automation     	
32s      	Normal	Succeeded	ImageUpdateAutomation/demo-auto	no change since last reconciliation     	
$ git -C /tmp/platform-img fetch && git -C /tmp/platform-img log --format='%an  %s' -1 origin/main
warning: redirecting to http://gitea.lab:3000/lab/platform.git/
From http://gitea.lab:3000/lab/platform
   7363427..c7fa30e  main       -> origin/main
fluxcdbot  Update from image update automation
$ # three objects that would otherwise keep pushing to main forever
$ flux -n flux-system delete image update demo-auto -s
► deleting image update automation demo-auto in flux-system namespace
✔ image update automation deleted
$ flux -n flux-system delete image policy demo -s
► deleting image policy demo in flux-system namespace
✔ image policy deleted
$ flux -n flux-system delete image repository demo -s
► deleting image repository demo in flux-system namespace
✔ image repository deleted
$ git -C /tmp/platform-img pull --rebase && git -C /tmp/platform-img rm -r image-automation && git -C /tmp/platform-img -c user.name=lab -c user.email=lab@lab.local commit -m 'remove the automation target' && git -C /tmp/platform-img push
warning: redirecting to http://gitea.lab:3000/lab/platform.git/
Updating 7363427..c7fa30e
Fast-forward
 image-automation/deployment.yaml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
rm 'image-automation/deployment.yaml'
[main 9122b3b] remove the automation target
 1 file changed, 12 deletions(-)
 delete mode 100644 image-automation/deployment.yaml
warning: redirecting to http://gitea.lab:3000/lab/platform.git/
To http://gitea.lab:3000/lab/platform.git
   c7fa30e..9122b3b  main -> main
$ rm -rf /tmp/platform-img
verify: the policy resolves to 1.0.1, and the latest commit on main is authored by fluxcdbot rewriting the image line to kind-registry:5000/demo:1.0.1. Leave out that marker comment and the automation finds nothing to update, happily reporting repository up-to-date, which is the exact gotcha you'll see in troubleshooting tasks. Keep the marked manifest out of demo-app/overlays so Argo CD doesn't sync that rewritten tag straight into team-a.

Self-check

answer before opening
Flux has no selfHeal setting. Why is drift still corrected?

Because a Kustomization re-applies its rendered manifests on every interval; drift correction is built into re-applying, not bolted on as a separate toggle. The trade-off: your drift window equals the interval, and tightening it adds load on the API server.

A Kustomization is Ready False. Name the three layers where it could have failed.

Source (the GitRepository isn't Ready due to auth, ref, or network), build (kustomize build failed on a bad path or invalid YAML), or apply/health (the API server rejected a manifest or health checks timed out). The conditions and flux logs name the exact layer, so read those before diving into the YAML.

How do you order "install CRDs, then the operator, then the tenant CRs" in Flux?

Chain three Kustomizations with dependsOn, and set wait: true (or explicit healthChecks) on each so downstream dependencies wait until resources are actually healthy. Without wait/healthChecks, dependsOn only orders the apply, not readiness.

What is postBuild.substitute for, and what is its Argo CD analog?

It injects per-cluster or per-environment variables into manifests right after kustomize build, pulling values inline or from ConfigMaps and Secrets. In Argo CD, you'd reach for Kustomize overlays, per-Application Helm values, or ApplicationSet template parameters; Flux just saves you from creating another overlay directory.

How does Flux stop one tenant's Kustomization from deploying cluster-admin-level resources?

Set spec.serviceAccountName so the controller impersonates that ServiceAccount during apply, capping the tenant's manifests at their own RBAC. Paired with blocking cross-namespace source references, that's Flux's multi-tenancy boundary and the structural counterpart to Argo CD's AppProject.

A HelmRelease shows Ready False with reason RollbackSucceeded. Is the release broken or healthy right now?

The running workload is healthy on the last good revision; the upgrade failed and remediation rolled it back. The HelmRelease stays not-ready because the cluster isn't running the desired new chart or values. Fix the chart or values in git, or if you resolved an out-of-band issue after hitting RetriesExceeded, run flux reconcile hr X --reset to clear the retry counters.

A chart upgrade adds a CRD field but the CR that uses it is rejected as unknown. Why, and which field fixes it?

spec.upgrade.crds defaults to Skip because Helm doesn't upgrade CRDs automatically, leaving the old schema live to prune or reject the new field. Set upgrade.crds: CreateReplace (alongside install.crds: CreateReplace), or ship CRDs in a separate Kustomization that the HelmRelease depends on.

Make a git push reconcile Flux immediately instead of at the next interval. Objects and the field you hand to the git server?

Create a Receiver with the right type (github, gitlab, or generic; use github for Gitea), events: [push], a secretRef holding a shared token, and resources listing your GitRepository. Expose the notification-controller's webhook-receiver Service, then configure your git webhook with that host plus status.webhookPath and the same secret token.

After multi-tenant lockdown, a tenant's Kustomization fails with Forbidden. What did they leave out?

spec.serviceAccountName. Once --default-service-account=default is enabled, any Kustomization or HelmRelease that omits an explicit account impersonates the namespace's unprivileged default ServiceAccount. The API server rejects the apply, and the Ready condition shows ReconciliationFailed with the Forbidden error. The platform team needs to provision a tenant ServiceAccount and RoleBinding for them to reference.

Docs to know your way around

study time, not exam time
  • fluxcd.io: GitRepository, Kustomization, HelmRelease API references; the "flux CLI" cheat sheet; the multi-tenancy guide for the serviceAccountName pattern.
  • Offline: flux --help and flux create <kind> --help --export generate correct YAML without docs, which is faster than searching during the exam.
  • fluxcd.io/flux/components/kustomize/kustomizations (Kustomization Status, Conditions) and components/helm/helmreleases (Conditions, Install/Upgrade remediation, Drift detection): the reason strings quoted above and the remediation fields.
  • fluxcd.io/flux/components/image and guides/image-update: ImageRepository, ImagePolicy, ImageUpdateAutomation and the marker comment syntax.
  • fluxcd.io/flux/components/notification (Alerts, Providers, Receivers) and installation/configuration/multitenancy: the notification objects and the lockdown patches.