clusterctl
Kubernetes Cluster API management CLI
TLDR
Initialize management cluster
SYNOPSIS
clusterctl command [options]
DESCRIPTION
clusterctl is the command-line tool for managing Kubernetes Cluster API (CAPI) management clusters. It handles the full lifecycle of cluster infrastructure providers, from initial installation through upgrades and deletion.
The tool can initialize a Kubernetes cluster as a CAPI management cluster by installing infrastructure providers (AWS, Azure, vSphere, etc.), bootstrap providers, and control plane providers. Once initialized, it generates cluster templates for creating workload clusters and retrieves their kubeconfigs.
clusterctl also supports moving Cluster API resources between management clusters, which is essential for upgrade scenarios and disaster recovery. The upgrade commands help keep providers in sync with the latest releases and API contract versions.
CONFIGURATION
~/.cluster-api/clusterctl.yaml
Main configuration file for providers, variables, and image overrides.
COMMANDS
init
Install Cluster API componentsgenerate cluster
Generate cluster templategenerate yaml
Process YAML templatesget kubeconfig
Get workload cluster kubeconfigupgrade plan
Show upgrade recommendationsupgrade apply
Apply provider upgradesmove
Move resources between clustersdelete
Delete providersdescribe cluster
Describe cluster resources
INIT OPTIONS
--infrastructure provider
Infrastructure provider (aws, azure, vsphere, etc.)--bootstrap provider
Bootstrap provider--control-plane provider
Control plane provider--target-namespace ns
Target namespace for providers--core provider
Core provider version
CAVEATS
Set GITHUB_TOKEN to avoid API rate limiting. Requires kubectl configured for target cluster. Uses go proxy for version detection.
