Flux CD: Git as the Source of Truth for Kubernetes

Flux CD makes Git your cluster's source of truth. It automatically syncs Kubernetes manifests from a repo to your cluster, ensuring the live state matches your config. This is for continuous delivery, not CI.
Why it exists
Traditional CI/CD pipelines often push changes to Kubernetes, which requires giving the CI system powerful cluster credentials and can lead to 'configuration drift' where the live cluster state no longer matches version control. Flux was created to solve this by having an in-cluster agent pull changes, making Git the indisputable source of truth.
The mental model
Think of Flux as a robot living inside your Kubernetes cluster. Its only job is to stare at a Git repository you've designated. When it sees a new commit, it pulls the changes and methodically makes the cluster's state match the configuration defined in the Git repo's manifests. It's a one-way synchronization from Git to Kubernetes.
How it works
Flux is a set of controllers that run inside your cluster. After a flux bootstrap command, these controllers begin a reconciliation loop. The main components are: the Source Controller, which fetches artifacts from Git, Helm, or OCI repositories; the Kustomize Controller, which applies plain Kubernetes YAML; the Helm Controller, which manages Helm chart releases; and Image Automation Controllers, which can update YAML in Git when a new container image is published. These agents work together to continuously align the cluster's state with the desired state in Git.
When to use it
Use Flux to implement GitOps for Kubernetes. It's ideal for teams wanting a declarative, auditable, and automated way to manage cluster configuration and application delivery. Because it ensures consistency from a central repository, it excels in managing multiple environments or clusters (dev, staging, prod) from different branches or folders in Git.
When not to use it
Flux is Kubernetes-native; it is not a general-purpose automation tool for other infrastructure. Crucially, Flux is not a CI tool. It does not build your code, run tests, or publish artifacts. You still need a separate system like GitHub Actions or Jenkins for the CI part of your pipeline. Flux handles the Continuous Delivery (CD) from an artifact source to the cluster.
One canonical example
A developer changes the container image tag in a deployment.yaml file and pushes the commit to the main branch. Flux's Source Controller, polling the Git repo, detects the change. It signals to the Kustomize Controller that there's a new version of the manifest. The Kustomize Controller applies the change, and Kubernetes triggers a rolling update of the application to the new version. The entire process is automated after the git push.
Interview question
Which statement best describes Flux CD's primary role in a software delivery pipeline?
- a.It automates infrastructure provisioning and configuration management for various cloud platforms.
- b.It pushes new application images from a CI system directly to the Kubernetes cluster.
- c.It continuously synchronizes Kubernetes cluster state with configurations defined in a Git repository.Correct
- d.It compiles application code and runs unit tests before deploying to Kubernetes.
Why? this is the answer
Flux CD's core function is to ensure the live state of a Kubernetes cluster continuously matches the desired configuration specified in a Git repository, making Git the source of truth for continuous delivery. It does not perform CI tasks like compiling code or running tests, nor is it a general-purpose automation tool for non-Kubernetes infrastructure.
Just read this? Test yourself on what you have been reading.
Read the original → fluxcd.io
- #gitops
- #kubernetes
- #cd
- #automation
- #declarative-config
You just looked this up. Could you explain it out loud?
That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on gitops — each one lists the topics its interview covers.
See open roles