LinuxCommandLibrary

clusterctl

TLDR

Initialize management cluster

$ clusterctl init --infrastructure [aws]
copy
Initialize with specific version
$ clusterctl init --infrastructure [aws:v2.0.0]
copy
Generate cluster template
$ clusterctl generate cluster [mycluster] --kubernetes-version [v1.28.0]
copy
Get workload cluster kubeconfig
$ clusterctl get kubeconfig [mycluster]
copy
Upgrade providers
$ clusterctl upgrade apply --contract [v1beta1]
copy
Move resources between clusters
$ clusterctl move --to-kubeconfig [target.kubeconfig]
copy
Delete provider
$ clusterctl delete --infrastructure [aws]
copy

SYNOPSIS

clusterctl command [options]

DESCRIPTION

clusterctl manages Kubernetes Cluster API management clusters. Installs providers, generates cluster templates, and handles lifecycle operations. Transforms Kubernetes clusters into management clusters.

COMMANDS

init

Install Cluster API components
generate cluster
Generate cluster template
generate yaml
Process YAML templates
get kubeconfig
Get workload cluster kubeconfig
upgrade plan
Show upgrade recommendations
upgrade apply
Apply provider upgrades
move
Move resources between clusters
delete
Delete providers
describe 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

CONFIGURATION

Config file: ~/.cluster-api/clusterctl.yaml

CAVEATS

Set GITHUB_TOKEN to avoid API rate limiting. Requires kubectl configured for target cluster. Uses go proxy for version detection.

SEE ALSO

kubectl(1), kind(1), kubeadm(1)

Copied to clipboard