Cluster API (CAPI) in Kubernetes is built around a set of custom resources and controllers designed to declaratively manage cluster lifecycles—creating, updating, and deleting Kubernetes clusters using Kubernetes-style APIs. CAPI separates management concerns and offers modular components to address various environments and providers.cluster-api.sigs.k8s+4
Core Objects
- Cluster: Specifies the overall desired state of a Kubernetes cluster, including its infrastructure, control plane, and networking details.seifrajhi.github+3
- Machine: Represents a single node in a Kubernetes cluster, abstracting over underlying infrastructure, such as VMs or bare metal hosts.superorbital+3
- MachineSet: Ensures a stable set of Machines (nodes), similar to how ReplicaSet ensures a set of Pods.spectrocloud+3
- MachineDeployment: Provides declarative updates for Machines, similar to how Kubernetes Deployments manage pod updates.seifrajhi.github+2
- MachineHealthCheck: Monitors and enforces machine health, with automated remediation triggers for unhealthy nodes.spectrocloud+1
Provider-Specific Objects
- Infrastructure resources: Define cloud or on-prem characteristics for clusters and nodes (for example, AWS, Azure, vSphere, Metal3, etc.).redhat+2
- Bootstrap resources: Handle bootstrapping of Kubernetes (such as kubeadm or Talos), including certificate generation and control plane initialization.seifrajhi.github+1
- Control Plane resources: Manage API controllers, schedulers, and managers for the cluster’s control plane, with customization options for different control plane providers.spectrocloud+1
Major Components
- Management Cluster: A Kubernetes cluster where all CAPI controllers and provider CRDs are installed, responsible for managing the lifecycle of workload clusters.cluster-api.sigs.k8s+2
- Workload Cluster: The cluster being managed and reconciled by CAPI; this is the user-facing Kubernetes cluster.cluster-api.sigs.k8s+2
Controller Roles
- Core Controller: Manages core objects (Cluster, Machine, MachineSet, MachineDeployment) and their lifecycle transitions.superorbital
- Infrastructure Provider Controllers: Reconcile infrastructure-specific resources for various clouds and environments.superorbital+2
- Bootstrap Provider Controller: Handles initialization and joining of nodes to the newly created clusters.seifrajhi.github+2
- Control Plane Controller: Orchestrates the configuration and scaling of the control plane nodes.spectrocloud+1
Conceptual Flow