Flux CLI GitOps for Kubernetes
Light · Postcard
102 × 152 mm · PDF
Dark · Postcard
102 × 152 mm · PDF
Ink saver · Postcard
102 × 152 mm · PDF
Light · A4 landscape
297 × 210 mm · PDF
Dark · A4 landscape
297 × 210 mm · PDF
Ink saver · A4 landscape
297 × 210 mm · PDF
Light · A3 landscape
420 × 297 mm · PDF
Dark · A3 landscape
420 × 297 mm · PDF
Ink saver · A3 landscape
420 × 297 mm · PDF
Start here
flux check --pre
flux bootstrap github --owner=<org>
--repository=<repo> --path=<dir>
flux get all -Aflux reconcile kustomization <name>
--with-source
flux diff kustomization <name> --path
<dir>
flux logs -A --level=error
flux events --for Kustomization/<name>
flux suspend kustomization <name>
Concepts
- Source GitRepository, OCI, HelmRepository
- Kustomization / HelmRelease what to apply, how often
- Cluster live objects, drift corrected
Install & Bootstrap
flux check --pre
flux bootstrap github --owner=<org>
--repository=<repo> --path=<dir>
flux checkInspect
flux get allflux get all -Aflux get kustomizations
flux get helmreleases -A
flux get all -A --status-selector ready=false
Reconcile & Suspend
flux reconcile kustomization <name>
flux reconcile kustomization <name>
--with-source
flux reconcile helmrelease <name>
flux suspend kustomization <name>
flux resume kustomization <name>
flux suspend helmrelease <name>
flux resume helmrelease <name>
Create Resources
flux create source git <name> --url=<url>
--branch=<b>
flux create kustomization <name> --source=<src>
--path=<dir> --prune
flux create helmrelease <name>
--source=HelmRepository/<repo>
--chart=<chart>
flux create helmrelease <name> ...
--values=<file>
flux create helmrelease <name> ...
--create-target-namespace
flux create secret git <name>
--url=ssh://git@<host>/<repo>
flux create source git <name> ... --export >
<file>.yaml
flux export kustomization --all
Debug
flux logs -Aflux logs -A --level=error
flux logs --kind=Kustomization --name=<name>
flux eventsflux events --for Kustomization/<name>
flux trace <kind> <name> -n <ns>
flux debug kustomization <name> --show-vars
Build & Diff
flux diff kustomization <name> --path
<dir>
flux diff kustomization <name> --path <dir>
--recursive
Global Flags
--context <name> / --kubeconfig <file>
-n <ns> / -A
--timeout <dur>
--exportRecipes
export GITHUB_TOKEN=<token>flux check --preflux bootstrap github --owner=<org> --repository=<repo> \ --path=clusters/prod --personal=falseflux get all -A
flux create source git podinfo --url=https://github.com/<org>/podinfo \ --branch=main --export > clusters/prod/podinfo-source.yamlflux create kustomization podinfo --source=GitRepository/podinfo \ --path=./kustomize --prune=true --interval=5m \ --export > clusters/prod/podinfo-ks.yamlgit add . && git commit -m 'Add podinfo' && git push
flux get all -A --status-selector ready=falseflux events --for Kustomization/<name>flux logs --kind=Kustomization --name=<name> --level=errorflux reconcile kustomization <name> --with-source



