How would you use GitOps to manage Kubernetes cluster lifecycles?

This tests cluster lifecycle GitOps, not just app delivery. A strong answer uses Flux plus Cluster API on a hub cluster, stores cluster definitions in Git, and rolls upgrades via MachineDeployments.
What's really being asked
Whether you understand that GitOps applies to infrastructure lifecycle, not just workloads. The interviewer wants to see if you can separate the control plane that does the GitOps work from the clusters being managed, and if you know how to make cluster creation, upgrades, and teardown fully declarative and auditable through a Git repository.
The full answer
Four things in order. First, the hub and spoke pattern: a persistent management cluster runs Flux and Cluster API providers, while workload clusters are ephemeral. Second, the Git source of truth holds Cluster API objects like Cluster, MachineDeployment, and KubeadmControlPlane templates, plus any infrastructure-specific custom resources. Third, the reconciliation flow: Flux detects a commit, applies the manifests to the management cluster, and Cluster API controllers provision or mutate the target clusters. Fourth, upgrade mechanics: changing a Kubernetes version field in Git triggers a rolling update through MachineDeployment or control plane templates, and day-two addons are delivered via HelmRelease or Kustomization resources scoped to each workload cluster.
The mistakes people make
Candidates often answer as if the question were about application deployment, describing Helm charts and namespace-scoped resources while ignoring Cluster API entirely. Another red flag is proposing that CI pipelines run Terraform or kubectl apply directly against a cloud provider; this is push-based infrastructure management, not GitOps. Suggesting that the GitOps agent runs inside the cluster it is trying to provision is also a bootstrap error that shows weak systems design.
What usually comes next
How do you handle secrets like cloud provider credentials or node bootstrap tokens in a GitOps cluster lifecycle workflow? How would you roll back a failed Kubernetes minor version upgrade across a fleet of clusters? What is your strategy for managing cluster addons like CNI or CSI drivers that must exist before workloads schedule? How do you enforce policy or drift detection when infrastructure engineers can still change resources via the cloud console?
A concrete example
Imagine a platform team operating fifty workload clusters on AWS. They maintain a management cluster running Flux and the Cluster API AWS provider. Their Git repository contains a Kustomization per environment, each referencing a Cluster API Cluster object with machine templates using AMI IDs and instance types. When the team commits a change to the Kubernetes version field from 1.28.0 to 1.29.0, Flux reconciles the management cluster within two minutes. Cluster API creates new nodes with the updated AMI, cordons old nodes, and drains workloads until the control plane and all node pools are rolled. Addon updates, such as a new CNI Helm chart version, are applied by a separate Flux HelmRelease object targeting each workload cluster through a KubeConfig secret stored on the management cluster.
Interview question
In a hub-and-spoke GitOps cluster lifecycle workflow, how should day-two addons like CNI or CSI drivers be delivered to ephemeral workload clusters?
- a.Configure the CI pipeline to run kubectl apply against workload clusters whenever addon files change in Git
- b.Embed addon bootstrap commands into Cluster API machine templates so nodes join with addons pre-installed
- c.Store addon definitions in Git and have the management cluster's Flux apply them via HelmRelease or Kustomization resources using workload cluster KubeConfig secretsCorrect
- d.Run a dedicated GitOps agent inside each workload cluster to pull addon manifests directly from Git
Why? this is the answer
The management cluster's Flux reconciles addon manifests from Git and pushes them to each ephemeral workload cluster using stored KubeConfig secrets, keeping delivery declarative and auditable. Running an agent inside the workload cluster it manages is a bootstrap error, because that cluster may not yet exist or may be torn down, breaking the GitOps loop.
Just read this? Test yourself on what you have been reading.
Read the original → fluxcd.io
- #gitops
- #kubernetes
- #cluster-api
- #infrastructure-as-code
- #flux
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