Declarative APIs and tooling to simplify provisioning, upgrading and operating multiple Kubernetes clusters
open sourceApache-2.0self-hostablefree
Cluster API is a Kubernetes subproject, started by SIG Cluster Lifecycle, that manages the lifecycle of Kubernetes clusters (create, scale, upgrade, delete) with Kubernetes-style custom resources applied to a management cluster. A Cluster, Machines, MachineDeployments and a control plane object describe each workload cluster, and controllers reconcile real infrastructure to match, the way Deployments manage Pods. Providers plug in the infrastructure (AWS, Azure, vSphere, Hetzner and many more), the bootstrap (K3s, Talos, RKE2; kubeadm is built in) and the control plane. MachineHealthChecks replace unhealthy Machines, and KubeadmControlPlane can replace an unhealthy control-plane Machine when doing so keeps etcd quorum. The clusterctl CLI installs and upgrades the providers. Apache-2.0.
Ways to install
Package managers
Problems it solves
- manage the lifecycle of dozens of Kubernetes clusters the way I deploy apps, with YAML files and kubectl
- create, upgrade and delete Kubernetes clusters on AWS, Azure and vSphere from one declarative definition
- automatically replace a worker VM when its Kubernetes node stays NotReady for five minutes
- replace a broken control plane machine in a self-managed Kubernetes cluster without hand-editing etcd membership
- roll a Kubernetes version upgrade through control plane and worker machines one at a time
- scale a group of Kubernetes worker machines up and down by changing a replica count
- let the cluster autoscaler add and remove VMs for our self-managed Kubernetes clusters
- platform team wants to hand out new Kubernetes clusters from a shared template
- move the definitions of running clusters from a throwaway bootstrap cluster to a permanent management cluster
- stop maintaining a pile of bash and Terraform scripts that bootstrap kubeadm clusters
- keep one cluster definition format whether our nodes run on-prem or in a public cloud
- bootstrap nodes with k3s, Talos or kubeadm while managing every cluster through the same resources
- stop a node health check from deleting half the cluster when the network blips
- upgrade the controllers that run our clusters using a plan of recommended versions
- rotate the admin kubeconfig certificate of every cluster before it expires
Features
- Cluster, Machine, MachineSet, MachineDeployment and MachinePool custom resources, managed with kubectl like Pods and Deployments
- KubeadmControlPlane manages control-plane Machines: scaling, rolling upgrades, and an admin kubeconfig renewed when under 6 months of validity remain
- MachineHealthCheck marks Machines unhealthy on node conditions or a node startup timeout (10 minutes by default) and remediates them by delete and recreate
- Control-plane remediation: KCP replaces an unhealthy Machine when it has at least two, the previous replacement finished and etcd quorum is preserved
- KCP remediation retries with maxRetry, retryPeriodSeconds and minHealthyPeriodSeconds
- Remediation short-circuiting with unhealthyLessThanOrEqualTo or unhealthyInRange so a widespread outage doesn't trigger mass replacement
- External remediation: providers can plug in their own remediation in place of delete and recreate
- Infrastructure providers for AWS, Azure, vSphere, Hetzner and many more; bootstrap and control plane providers for kubeadm, K3s, RKE2, Talos, k0s, MicroK8s
- clusterctl CLI: init, upgrade plan, upgrade apply, delete, generate cluster, get kubeconfig, move and alpha rollout
- ClusterClass: a managed topology so one Cluster object controls the whole cluster
View 2 more
- Cluster Autoscaler integration through min and max size annotations on MachineDeployments
- Label, annotation and drain timeout changes propagate in place without a full rollout
Limitations
- Doesn't run one Kubernetes cluster across several infrastructure providers: a cluster spanning providers is a stated non-goal3
- Doesn't manage Kubernetes clusters it didn't create: managing clusters not provisioned with Cluster API is a stated non-goal3
Capabilities
| Has an API | plan not known |
|---|---|
| Has a command line tool | plan not known |
| Takes plugins | plan not known |
Alternatives
The same job
These do what Cluster API does.
- Rancher Kubernetes management tool to deploy and run clusters anywhere and on any provider
- kOps The easiest way to get a production grade Kubernetes cluster up and running
- Omni Fleet management for Talos Kubernetes clusters: SaaS-simple deployment of Kubernetes on your own hardware
- Kubespray Deploy a Production Ready Kubernetes Cluster
- Gardener Homogeneous Kubernetes clusters at scale on any infrastructure using hosted control planes.
- k0smotron Manage k0s Kubernetes control planes as pods in a management cluster
