Kubernetes Cluster API
Kubernetes Cluster API (CAPI) is a Kubernetes sub-project focused on providing declarative APIs and tooling to simplify provisioning, upgrading, and operating multiple Kubernetes clusters.
Overview
Started by SIG Cluster Lifecycle, Cluster API uses Kubernetes-style APIs and patterns to automate cluster lifecycle management. The infrastructure (VMs, networks, load balancers, VPCs) and Kubernetes configuration are defined declaratively, enabling consistent and repeatable cluster deployments across environments.
Why Cluster API?
While kubeadm reduces installation complexity, it doesn't address day-to-day cluster management:
- How to consistently provision infrastructure across providers and locations?
- How to automate cluster lifecycle (upgrades, deletion)?
- How to scale processes to manage any number of clusters?
Cluster API addresses these gaps with declarative, Kubernetes-style APIs that automate cluster creation, configuration, and management.
Goals
- Manage lifecycle (create, scale, upgrade, destroy) of Kubernetes-conformant clusters via declarative API
- Work in different environments (on-premises and cloud)
- Define common operations with swappable implementations
- Reuse existing ecosystem components (cluster-autoscaler, node-problem-detector)
- Provide transition path for existing tools to adopt incrementally
Non-Goals
- Add APIs to Kubernetes core
- Manage infrastructure unrelated to Kubernetes clusters
- Force all lifecycle products to use these APIs
- Manage non-CAPI provisioned clusters
- Manage single cluster spanning multiple providers
- Configure machines after create/upgrade
Quick Navigation
| Topic |
Reference |
| Getting Started |
getting-started.md |
| Concepts & Architecture |
concepts.md |
| Certificates |
certificates.md |
| Bootstrap (Kubeadm/MicroK8s) |
bootstrap.md |
| Cluster Operations |
cluster-operations.md |
| Experimental Features |
experimental.md |
| clusterctl CLI |
clusterctl.md |
| Developer Guide |
developer.md |
| Troubleshooting |
troubleshooting.md |
| API Reference & Providers |
api-reference.md |
| Security & PSS |
security.md |
| Controllers |
controllers.md |
| Version Migrations |
migrations.md |
| FAQ |
faq.md |
| Best Practices |
best-practices.md |
When to Use
- Provisioning Kubernetes clusters across multiple infrastructure providers
- Managing cluster lifecycle (create, scale, upgrade, destroy)
- Automating cluster operations with declarative APIs
- Implementing GitOps workflows for cluster management
- Building custom infrastructure providers
Core Concepts
Architecture
┌─────────────────────────────────────────┐
│ Management Cluster │
│ ┌─────────────┐ ┌─────────────────┐ │
│ │ CAPI Core │ │ Infrastructure │ │
│ │ Controllers │ │ Provider │ │
│ └─────────────┘ └─────────────────┘ │
│ ┌─────────────┐ ┌─────────────────┐ │
│ │ Bootstrap │ │ Control Plane │ │
│ │ Provider │ │ Provider │ │
│ └─────────────┘ └─────────────────┘ │
└─────────────────────┬───────────────────┘
│ manages
┌───────────┴───────────┐
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Workload │ │ Workload │
│ Cluster 1 │ │ Cluster N │
└─────────────────┘ └─────────────────┘
Key Components
| Component |
Purpose |
| Management Cluster |
Hosts CAPI controllers, manages workloads |
| Workload Cluster |
User clusters managed by CAPI |
| Infrastructure Provider |
Provisions VMs, networks, load balancers |
| Bootstrap Provider |
Generates cloud-init/ignition configs |
| Control Plane Provider |
Manages control plane nodes lifecycle |
Core Resources
| Resource |
Description |
| Cluster |
Represents a Kubernetes cluster |
| Machine |
Represents a single node/VM |
| MachineSet |
Manages replicas of Machines |
| MachineDeployment |
Declarative updates for MachineSets |
| MachineHealthCheck |
Automatic remediation of unhealthy nodes |
Quick Start
# Install clusterctl
curl -L https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.12.0/clusterctl-linux-amd64 -o clusterctl
chmod +x clusterctl
sudo mv clusterctl /usr/local/bin/
# Initialize management cluster
clusterctl init --infrastructure docker
# Create workload cluster
clusterctl generate cluster my-cluster --kubernetes-version v1.32.0 --control-plane-machine-count 1 --worker-machine-count 3 | kubectl apply -f -
# Get cluster kubeconfig
clusterctl get kubeconfig my-cluster > my-cluster.kubeconfig
# Delete cluster
kubectl delete cluster my-cluster
Common Workflows
Cluster Lifecycle
# Create cluster from template
clusterctl generate cluster prod-cluster \
--infrastructure aws \
--kubernetes-version v1.32.0 \
--control-plane-machine-count 3 \
--worker-machine-count 5 \
| kubectl apply -f -
# Scale workers
kubectl scale machinedeployment prod-cluster-md-0 --replicas=10
# Upgrade Kubernetes version
kubectl patch cluster prod-cluster --type merge -p '{"spec":{"topology":{"version":"v1.33.0"}}}'
# Move cluster to new management cluster
clusterctl move --to-kubeconfig target-mgmt.kubeconfig
Health Monitoring
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachineHealthCheck
metadata:
name: my-cluster-mhc
spec:
clusterName: my-cluster
maxUnhealthy: 40%
nodeStartupTimeout: 10m
selector:
matchLabels:
cluster.x-k8s.io/cluster-name: my-cluster
unhealthyConditions:
- type: Ready
status: "False"
timeout: 5m
- type: Ready
status: Unknown
timeout: 5m
Critical Prohibitions
- Do NOT modify management cluster directly without proper backup
- Do NOT delete Machine objects directly (use MachineDeployment scale)
- Do NOT mix provider versions without checking compatibility
- Do NOT skip cluster upgrade steps (control plane before workers)
- Do NOT ignore MachineHealthCheck alerts
Release Highlights (1.14.x)
- Kubernetes compatibility moves to management clusters
v1.33.x -> v1.37.x and workload clusters v1.31.x -> v1.37.x by the 1.14.1 line.
- API types move into a dedicated Golang module: stronger compatibility guarantees and a much smaller, tightly controlled dependency tree that reduces CVE exposure from transitive dependencies.
- Kubeadm control plane robustness: safe joining of worker nodes on older Kubernetes versions, improved forward etcd leadership during control plane machine deletion, and remediation of unhealthy machines during intermediate steps of chained upgrades.
- Observability: the upgrade plan is surfaced in cluster status, aggregated machine versions are exposed in status, and runtime extension errors appear in cluster conditions.
- Scale/performance: ClusterCache clients expose cache tuning options for a smaller memory footprint, and managedFields interning reduces stored state.
- Deprecation warning: the
v1beta1 API is on track to be unserved in CAPI v1.16 (migrate to v1beta2), and Docker* resources will be removed in v1.15 (migrate to Dev* resources). An experimental clusterctl convert command is available.
Release Highlights (1.13.x)
- Kubernetes compatibility moves to management clusters
v1.32.x -> v1.36.x and workload clusters v1.30.x -> v1.36.x by the 1.13.2 line.
v1alpha3 and v1alpha4 API versions are now removed; providers should keep moving toward the v1beta2 contract because v1beta1 remains on the path to becoming unserved in a later release.
- Cluster topology can now drive
rolloutAfter for both control plane and MachineDeployment resources.
- KubeadmControlPlane improves remediation tolerance for multiple failures and better surfaces common join/remediation symptoms.
PriorityQueue and ReconcilerRateLimiting are now beta defaults in the 1.13 line, which can change reconciliation behavior under load.
Scripts
Go-based tools in scripts/. Run via go run ./tool-name from the scripts directory.
| Tool |
Purpose |
validate-manifests |
Validate YAML manifests against CRD schemas |
run-clusterctl-diagnose |
Run clusterctl describe and save diagnostic report |
migration-checker |
Check v1beta1→v1beta2 migration readiness |
check-cluster-health |
Analyze conditions across all cluster objects |
analyze-conditions |
Parse and report False/Unknown conditions |
scaffold-provider |
Generate new provider directory structure |
generate-cluster-template |
Generate templates from ClusterClass |
export-cluster-state |
Export cluster state for backup/move |
audit-security |
Check PSS compliance and security posture |
timeline-events |
Build provisioning event timeline |
compare-versions |
Compare CAPI version specs and API changes |
check-provider-contract |
Verify provider CRD compliance with contracts |
lint-cluster-templates |
Lint and validate CAPI manifests |
Assets
Reusable templates in assets/:
- Cluster templates:
cluster-minimal.yaml, cluster-production.yaml, cluster-clusterclass.yaml, clusterclass-example.yaml
- Provider configs:
docker-quickstart.yaml, aws-credentials.yaml, azure-credentials.yaml, provider-matrix.md
- Operations:
upgrade-checklist.md, migration-v1beta2.md, troubleshooting-flow.md, security-audit-report.md, dr-backup-restore.md, etcd-backup.yaml
- GitOps:
argocd-cluster-app.yaml, flux-kustomization.yaml, gitops-rbac.yaml
- Monitoring:
prometheus-alerts.yaml
Links
1---
2name: k8s-cluster-api
3description: "Kubernetes Cluster API v1.12. Covers clusterctl CLI, ClusterClass, GitOps integration. Scripts for health checks, backup, migration, linting. Templates: clusters, DR, Prometheus. Use when provisioning, upgrading, or operating Kubernetes clusters with CAPI, or running clusterctl and ClusterClass workflows. Keywords: CAPI, clusterctl, kubeadm, cluster lifecycle."
4metadata:
5 version: "1.14.1"
6 release_date: "2026-09-04"
7---
8
9# Kubernetes Cluster API
10
11Kubernetes Cluster API (CAPI) is a Kubernetes sub-project focused on providing declarative APIs and tooling to simplify provisioning, upgrading, and operating multiple Kubernetes clusters.
12
13## Overview
14
15Started by SIG Cluster Lifecycle, Cluster API uses Kubernetes-style APIs and patterns to automate cluster lifecycle management. The infrastructure (VMs, networks, load balancers, VPCs) and Kubernetes configuration are defined declaratively, enabling consistent and repeatable cluster deployments across environments.
16
17### Why Cluster API?
18
19While kubeadm reduces installation complexity, it doesn't address day-to-day cluster management:
20
21- How to consistently provision infrastructure across providers and locations?
22- How to automate cluster lifecycle (upgrades, deletion)?
23- How to scale processes to manage any number of clusters?
24
25Cluster API addresses these gaps with declarative, Kubernetes-style APIs that automate cluster creation, configuration, and management.
26
27### Goals
28
29- Manage lifecycle (create, scale, upgrade, destroy) of Kubernetes-conformant clusters via declarative API
30- Work in different environments (on-premises and cloud)
31- Define common operations with swappable implementations
32- Reuse existing ecosystem components (cluster-autoscaler, node-problem-detector)
33- Provide transition path for existing tools to adopt incrementally
34
35### Non-Goals
36
37- Add APIs to Kubernetes core
38- Manage infrastructure unrelated to Kubernetes clusters
39- Force all lifecycle products to use these APIs
40- Manage non-CAPI provisioned clusters
41- Manage single cluster spanning multiple providers
42- Configure machines after create/upgrade
43
44## Quick Navigation
45
46| Topic | Reference |
47| ---------------------------- | --------------------------------------------------------- |
48| Getting Started | [getting-started.md](references/getting-started.md) |
49| Concepts & Architecture | [concepts.md](references/concepts.md) |
50| Certificates | [certificates.md](references/certificates.md) |
51| Bootstrap (Kubeadm/MicroK8s) | [bootstrap.md](references/bootstrap.md) |
52| Cluster Operations | [cluster-operations.md](references/cluster-operations.md) |
53| Experimental Features | [experimental.md](references/experimental.md) |
54| clusterctl CLI | [clusterctl.md](references/clusterctl.md) |
55| Developer Guide | [developer.md](references/developer.md) |
56| Troubleshooting | [troubleshooting.md](references/troubleshooting.md) |
57| API Reference & Providers | [api-reference.md](references/api-reference.md) |
58| Security & PSS | [security.md](references/security.md) |
59| Controllers | [controllers.md](references/controllers.md) |
60| Version Migrations | [migrations.md](references/migrations.md) |
61| FAQ | [faq.md](references/faq.md) |
62| Best Practices | [best-practices.md](references/best-practices.md) |
63
64## When to Use
65
66- Provisioning Kubernetes clusters across multiple infrastructure providers
67- Managing cluster lifecycle (create, scale, upgrade, destroy)
68- Automating cluster operations with declarative APIs
69- Implementing GitOps workflows for cluster management
70- Building custom infrastructure providers
71
72## Core Concepts
73
74### Architecture
75
76```
77┌─────────────────────────────────────────┐
78│ Management Cluster │
79│ ┌─────────────┐ ┌─────────────────┐ │
80│ │ CAPI Core │ │ Infrastructure │ │
81│ │ Controllers │ │ Provider │ │
82│ └─────────────┘ └─────────────────┘ │
83│ ┌─────────────┐ ┌─────────────────┐ │
84│ │ Bootstrap │ │ Control Plane │ │
85│ │ Provider │ │ Provider │ │
86│ └─────────────┘ └─────────────────┘ │
87└─────────────────────┬───────────────────┘
88 │ manages
89 ┌───────────┴───────────┐
90 ▼ ▼
91┌─────────────────┐ ┌─────────────────┐
92│ Workload │ │ Workload │
93│ Cluster 1 │ │ Cluster N │
94└─────────────────┘ └─────────────────┘
95```
96
97### Key Components
98
99| Component | Purpose |
100| ----------------------- | ----------------------------------------- |
101| Management Cluster | Hosts CAPI controllers, manages workloads |
102| Workload Cluster | User clusters managed by CAPI |
103| Infrastructure Provider | Provisions VMs, networks, load balancers |
104| Bootstrap Provider | Generates cloud-init/ignition configs |
105| Control Plane Provider | Manages control plane nodes lifecycle |
106
107### Core Resources
108
109| Resource | Description |
110| ------------------ | ---------------------------------------- |
111| Cluster | Represents a Kubernetes cluster |
112| Machine | Represents a single node/VM |
113| MachineSet | Manages replicas of Machines |
114| MachineDeployment | Declarative updates for MachineSets |
115| MachineHealthCheck | Automatic remediation of unhealthy nodes |
116
117## Quick Start
118
119```bash
120# Install clusterctl
121curl -L https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.12.0/clusterctl-linux-amd64 -o clusterctl
122chmod +x clusterctl
123sudo mv clusterctl /usr/local/bin/
124
125# Initialize management cluster
126clusterctl init --infrastructure docker
127
128# Create workload cluster
129clusterctl generate cluster my-cluster --kubernetes-version v1.32.0 --control-plane-machine-count 1 --worker-machine-count 3 | kubectl apply -f -
130
131# Get cluster kubeconfig
132clusterctl get kubeconfig my-cluster > my-cluster.kubeconfig
133
134# Delete cluster
135kubectl delete cluster my-cluster
136```
137
138## Common Workflows
139
140### Cluster Lifecycle
141
142```bash
143# Create cluster from template
144clusterctl generate cluster prod-cluster \
145 --infrastructure aws \
146 --kubernetes-version v1.32.0 \
147 --control-plane-machine-count 3 \
148 --worker-machine-count 5 \
149 | kubectl apply -f -
150
151# Scale workers
152kubectl scale machinedeployment prod-cluster-md-0 --replicas=10
153
154# Upgrade Kubernetes version
155kubectl patch cluster prod-cluster --type merge -p '{"spec":{"topology":{"version":"v1.33.0"}}}'
156
157# Move cluster to new management cluster
158clusterctl move --to-kubeconfig target-mgmt.kubeconfig
159```
160
161### Health Monitoring
162
163```yaml
164apiVersion: cluster.x-k8s.io/v1beta1
165kind: MachineHealthCheck
166metadata:
167 name: my-cluster-mhc
168spec:
169 clusterName: my-cluster
170 maxUnhealthy: 40%
171 nodeStartupTimeout: 10m
172 selector:
173 matchLabels:
174 cluster.x-k8s.io/cluster-name: my-cluster
175 unhealthyConditions:
176 - type: Ready
177 status: "False"
178 timeout: 5m
179 - type: Ready
180 status: Unknown
181 timeout: 5m
182```
183
184## Critical Prohibitions
185
186- Do NOT modify management cluster directly without proper backup
187- Do NOT delete Machine objects directly (use MachineDeployment scale)
188- Do NOT mix provider versions without checking compatibility
189- Do NOT skip cluster upgrade steps (control plane before workers)
190- Do NOT ignore MachineHealthCheck alerts
191
192## Release Highlights (1.14.x)
193
194- Kubernetes compatibility moves to management clusters `v1.33.x -> v1.37.x` and workload clusters `v1.31.x -> v1.37.x` by the `1.14.1` line.
195- API types move into a dedicated Golang module: stronger compatibility guarantees and a much smaller, tightly controlled dependency tree that reduces CVE exposure from transitive dependencies.
196- Kubeadm control plane robustness: safe joining of worker nodes on older Kubernetes versions, improved forward etcd leadership during control plane machine deletion, and remediation of unhealthy machines during intermediate steps of chained upgrades.
197- Observability: the upgrade plan is surfaced in cluster status, aggregated machine versions are exposed in status, and runtime extension errors appear in cluster conditions.
198- Scale/performance: ClusterCache clients expose cache tuning options for a smaller memory footprint, and managedFields interning reduces stored state.
199- Deprecation warning: the `v1beta1` API is on track to be unserved in CAPI `v1.16` (migrate to `v1beta2`), and `Docker*` resources will be removed in `v1.15` (migrate to `Dev*` resources). An experimental `clusterctl convert` command is available.
200
201## Release Highlights (1.13.x)
202
203- Kubernetes compatibility moves to management clusters `v1.32.x -> v1.36.x` and workload clusters `v1.30.x -> v1.36.x` by the `1.13.2` line.
204- `v1alpha3` and `v1alpha4` API versions are now removed; providers should keep moving toward the `v1beta2` contract because `v1beta1` remains on the path to becoming unserved in a later release.
205- Cluster topology can now drive `rolloutAfter` for both control plane and `MachineDeployment` resources.
206- KubeadmControlPlane improves remediation tolerance for multiple failures and better surfaces common join/remediation symptoms.
207- `PriorityQueue` and `ReconcilerRateLimiting` are now beta defaults in the `1.13` line, which can change reconciliation behavior under load.
208
209## Scripts
210
211Go-based tools in `scripts/`. Run via `go run ./tool-name` from the scripts directory.
212
213| Tool | Purpose |
214| --------------------------- | -------------------------------------------------- |
215| `validate-manifests` | Validate YAML manifests against CRD schemas |
216| `run-clusterctl-diagnose` | Run clusterctl describe and save diagnostic report |
217| `migration-checker` | Check v1beta1→v1beta2 migration readiness |
218| `check-cluster-health` | Analyze conditions across all cluster objects |
219| `analyze-conditions` | Parse and report False/Unknown conditions |
220| `scaffold-provider` | Generate new provider directory structure |
221| `generate-cluster-template` | Generate templates from ClusterClass |
222| `export-cluster-state` | Export cluster state for backup/move |
223| `audit-security` | Check PSS compliance and security posture |
224| `timeline-events` | Build provisioning event timeline |
225| `compare-versions` | Compare CAPI version specs and API changes |
226| `check-provider-contract` | Verify provider CRD compliance with contracts |
227| `lint-cluster-templates` | Lint and validate CAPI manifests |
228
229## Assets
230
231Reusable templates in `assets/`:
232
233- **Cluster templates**: `cluster-minimal.yaml`, `cluster-production.yaml`, `cluster-clusterclass.yaml`, `clusterclass-example.yaml`
234- **Provider configs**: `docker-quickstart.yaml`, `aws-credentials.yaml`, `azure-credentials.yaml`, `provider-matrix.md`
235- **Operations**: `upgrade-checklist.md`, `migration-v1beta2.md`, `troubleshooting-flow.md`, `security-audit-report.md`, `dr-backup-restore.md`, `etcd-backup.yaml`
236- **GitOps**: `argocd-cluster-app.yaml`, `flux-kustomization.yaml`, `gitops-rbac.yaml`
237- **Monitoring**: `prometheus-alerts.yaml`
238
239## Links
240
241- [Documentation](https://cluster-api.sigs.k8s.io/)
242- [GitHub](https://github.com/kubernetes-sigs/cluster-api)
243- [Releases](https://github.com/kubernetes-sigs/cluster-api/releases)