Cluster API and Declarative Cluster Lifecycle

Managing Kubernetes clusters as Kubernetes objects: the Cluster, Machine, MachineSet, MachineDeployment and MachineHealthCheck CRDs, the three-provider model, ClusterClass topologies, rolling upgrades, the bootstrap paradox, and when the complexity actually pays for itself.

Overview

Clusters as Kubernetes resources

Every organization that runs more than a few Kubernetes clusters confronts the same asymmetry. Inside a cluster everything is declarative, reconciled and self-healing; outside it, cluster creation is a Terraform run or a wiki page.

Cluster API removes that asymmetry by making the cluster itself a Kubernetes resource. You describe the desired cluster in a Cluster object, controllers reconcile toward it, and drift is corrected the same way a Deployment corrects a deleted Pod.

In practice the loop looks like this. A Cluster manifest lives in Git. Argo CD or Flux applies it to a management cluster, an ordinary cluster that runs the Cluster API and provider controllers. Those controllers build and maintain the workload clusters, whether they run on EKS, vSphere or bare metal. When a workload cluster drifts from its manifest, reconciliation from the management cluster corrects it.

Key concepts

  • Management cluster
  • Machine
  • MachineSet and MachineDeployment
  • KubeadmControlPlane
  • Provider triad
  • MachineHealthCheck
  • ClusterClass and managed topology
  • Pivot (clusterctl move)

Interview questions

  • Why manage clusters as Kubernetes objects at all? What does Cluster API give you that Terraform or a managed service does not, and when is it the wrong choice?
  • Walk me through exactly what happens from applying a Cluster manifest to a working workload cluster.
  • How does a control-plane upgrade work in Cluster API, and what makes it safe?
  • Explain MachineHealthCheck and its remediation safeguards. What goes wrong without them?
  • What is the bootstrap paradox in Cluster API, and how do you resolve it? What happens to your fleet if the management cluster dies?
  • What problem does ClusterClass solve, and what are the risks of adopting it?

Sign up free to read the full topic

More DevOps topics

Start free on Cariara · Coding problems · System design studio