Skip to content
Latchkey

flux create kustomization: Apply from a Source

flux create kustomization creates a Kustomization object that applies a path from a source and keeps it reconciled.

A Kustomization is Flux's apply loop: it takes a path inside a source and continuously applies it to the cluster.

What it does

flux create kustomization defines a Kustomization custom resource that references a --source (a GitRepository or OCIRepository), applies the manifests under --path, and reconciles on --interval. --prune deletes resources removed from the source.

Common usage

Terminal
flux create kustomization podinfo \
  --source=GitRepository/podinfo \
  --path=./kustomize \
  --prune=true \
  --interval=5m \
  --wait=true

Options

FlagWhat it does
--source <kind/name>Source to apply from (e.g. GitRepository/podinfo)
--path <dir>Directory in the source to apply
--pruneGarbage-collect resources removed from the source
--interval <dur>Reconcile interval
--waitWait for applied resources to become Ready
--depends-on <name>Order this after another Kustomization

In CI

Set --prune=true so deletions in Git propagate to the cluster. --wait=true makes the Kustomization report Ready only when its workloads are healthy, which combined with flux reconcile gives a synchronous deploy you can gate on.

Common errors in CI

"✗ Kustomization reconciliation failed: kustomize build failed: ... no such file or directory" means --path is wrong. "dry-run failed: ... is forbidden" means RBAC denies the service account that field. "✗ source not found" means the --source kind/name does not match an existing source object.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →