Maven / GitOps Interview Questions
How does Flux's source-controller and kustomize-controller work together?
Flux splits the responsibilities of fetching config and applying config into two separate controllers, connected through an intermediate Artifact object.
source-controller is responsible for watching external sources — Git repositories, Helm repositories, OCI registries, and S3-compatible buckets. When the source changes (new commit, new chart version, new image tag), the source-controller downloads the content, archives it as a compressed tarball, and stores a reference to it in a GitRepository (or HelmRepository, OCIRepository) status field as a versioned Artifact. Subsequent controllers consume this Artifact rather than fetching from the network themselves.
kustomize-controller watches Kustomization CRs. Each Kustomization references a source (typically a GitRepository) and specifies a path within it. When the source's Artifact revision changes, the kustomize-controller:
- Downloads the Artifact tarball from source-controller.
- Runs
kustomize buildon the specified path to render final manifests. - Validates the manifests (optional: dry-run or server-side validation).
- Applies them to the cluster using server-side apply.
- Monitors the health of applied resources and updates the Kustomization
Readycondition.
# source-controller watches this repo
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: gitops-config
namespace: flux-system
spec:
interval: 1m
url: https://github.com/org/gitops-config.git
ref:
branch: main
---
# kustomize-controller deploys from this repo/path
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: apps-prod
namespace: flux-system
spec:
interval: 10m
sourceRef:
kind: GitRepository
name: gitops-config
path: ./apps/overlays/prod
prune: true
wait: true
timeout: 5m
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
