clusterctl
$ clusterctl Foundation High Riskclusterctl manages Cluster API (CAPI) management clusters and renders declarative workload cluster manifests via clusterctl generate cluster. It provides rich hierarchical health trees with clusterctl describe cluster and pre-upgrade inspection via clusterctl upgrade plan.
brew install clusterctl clusterctl generate renders pure YAML locally for kubectl apply, while describe cluster summarizes CAPI CRDs in one command.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Outputs clean YAML from generate and non-interactive trees from describe cluster, but lacks a universal --json output flag across subcommands.
generate clusterprints YAML manifests to stdout- Lacks
--jsonoutput ondescribe clusterandupgrade plan
generate is local read-only and upgrade plan previews upgrades, though init, move, and delete mutate management cluster CRDs without --dry-run.
generateandupgrade planseparate preview from mutation
Single static Go binary via Homebrew or GitHub Releases on macOS, Linux, and Windows.
- Cross-platform binary via
brew install clusterctl
Simplifies CAPI provider installation, template rendering, and move pivot operations across clusters.
- Consolidates multi-CRD CAPI lifecycle and health views
Official Kubernetes SIG Cluster Lifecycle project (kubernetes-sigs/cluster-api) under Apache-2.0.
- Official
kubernetes-sigs/cluster-apirepository
Well-documented in The Cluster API Book, though provider-specific template env vars vary per infrastructure provider.
- Official Cluster API Book documentation
Security, Auth & Guardrails
Reads Kubernetes contexts from ~/.kube/config (--kubeconfig) and provider variables/credentials from ~/.cluster-api/clusterctl.yaml or environment variables.
CLI is free (Apache-2.0); generated workload clusters provision infrastructure via configured cloud providers.
# clusterctl Agent Rules - Always pass `--kubeconfig` and `-n <namespace>` explicitly when targeting management clusters. - Use `clusterctl generate cluster` to inspect manifests locally before piping to `kubectl apply --dry-run=server`. - Run `clusterctl upgrade plan` before running `clusterctl upgrade apply`.
Agent-Ready Command Recipes
Safe Read-Only Queries
clusterctl generate cluster my-workload --infrastructure docker --kubernetes-version v1.31.0 --worker-machine-count 3
Generates CAPI cluster YAML to stdout without mutating any management cluster.
clusterctl describe cluster my-workload -n default --show-conditions all
Displays the hierarchical condition status of Cluster, ControlPlane, and Machine objects.
Controlled Writes & Previews
clusterctl init --infrastructure docker --kubeconfig ./mgmt.kubeconfig
Installs Cluster API core, bootstrap, control-plane, and infrastructure controllers into an explicit management kubeconfig.
Strengths for Agents
- +
clusterctl generate clusterrenders complete CAPI manifests locally before applying. - +
clusterctl describe clusteraggregates deeply nested CAPI machine conditions in one view. - +
clusterctl upgrade planprovides a clear pre-upgrade check.
Caveats & Pitfalls
- ! No
--jsonoutput flag ondescribe clusterorupgrade plan; JSON inspection requireskubectl get ... -o json. - !
clusterctl initandmovelack--dry-run.