The flux CLI
The command families that actually get used in production: reconcile, suspend, resume, trace, diff, build, check, logs, events, tree, stats, and the export-then-commit workflow that keeps the CLI GitOps-correct.
Overview
What the flux CLI is
The flux CLI is the operational surface of Flux v2: a single Go binary with no daemon, no local state and no privileged access beyond your kubeconfig. Every subcommand resolves to one of four operations against the Kubernetes API.
- Create or delete a Flux resource.
- Read one, with get, trace, tree and events.
- Annotate one, with reconcile, suspend and resume.
- Render locally, with build and diff.
The first three go through the Kubernetes API. The fourth renders manifests on your machine, so you can see a change before it lands.
> [!WARNING] Engineers who have only read the quickstart tend to believe flux reconcile deploys code. It does not; interviewers probe this.
Key concepts
- reconcile.fluxcd.io/requestedAt
- flux reconcile --with-source
- flux suspend and flux resume
- flux trace
- flux build kustomization
- flux diff kustomization
- --export
- flux check versus flux check --pre
Interview questions
- What exactly does flux reconcile do, and how does it relate to spec.interval?
- A Deployment appeared in production that nobody recognizes. How do you find out what put it there?
- How do you review a Flux manifest change before it merges, and why is plain kustomize build not enough?
- Production is down and you need to make a manual change. Walk through it with Flux in the loop.
- Why is flux create considered an anti-pattern in a GitOps setup, and what is the correct workflow?
- flux get shows a Kustomization as not ready. Walk through your CLI debugging sequence.
Sign up free to read the full topic
More DevOps topics
- Terraform count vs for_each
- Terraform Essentials — Plan and Apply, Variables, Outputs, Data Sources, and Sharing State at Scale
- Terraform in CI/CD Pipelines
- Terraform Remote State — S3 + DynamoDB
- Test Pyramid
- The C/C++ Compilation Model
- The Three Ways
- Toil Reduction & Automation Strategy
- Trunk-Based Development
- Trunk-Based Development with Continuous Deployment
- Twelve-Factor App
- Value Stream Mapping
Start free on Cariara · Coding problems · System design studio