Linux command
clusterctl 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Initialize management cluster
clusterctl init --infrastructure [aws]
Initialize with specific version
clusterctl init --infrastructure [aws:v2.0.0]
Generate cluster template
clusterctl generate cluster [mycluster] --kubernetes-version [v1.28.0]
Get workload cluster kubeconfig
clusterctl get kubeconfig [mycluster]
Upgrade providers
clusterctl upgrade apply --contract [v1beta1]
Move resources between clusters
clusterctl move --to-kubeconfig [target.kubeconfig]
Delete provider
clusterctl delete --infrastructure [aws]
说明
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.
FAQ
What is the clusterctl command used for?
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.
How do I run a basic clusterctl example?
Run `clusterctl init --infrastructure [aws]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
Where can I find more clusterctl examples?
This page includes 7 examples for clusterctl, plus related commands for nearby Linux tasks.