Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

clusterctl

$ clusterctl Foundation High Risk
Kubernetes SIGs · Cloud & Infra · Apache-2.0 · macos / linux / windows

clusterctl 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.

FCRS-1.0 Score
76 /100
Good
Medium Confidence
Zero-Friction Install
brew install clusterctl
CLI vs MCP Decision CLI Preferred vs MCP

clusterctl generate renders pure YAML locally for kubectl apply, while describe cluster summarizes CAPI CRDs in one command.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 16 / 25

Outputs clean YAML from generate and non-interactive trees from describe cluster, but lacks a universal --json output flag across subcommands.

  • generate cluster prints YAML manifests to stdout
  • Lacks --json output on describe cluster and upgrade plan
Trust & Safety 19 / 25

generate is local read-only and upgrade plan previews upgrades, though init, move, and delete mutate management cluster CRDs without --dry-run.

  • generate and upgrade plan separate preview from mutation
Setup & Portability 14 / 15

Single static Go binary via Homebrew or GitHub Releases on macOS, Linux, and Windows.

  • Cross-platform binary via brew install clusterctl
Utility & Efficiency 11 / 15

Simplifies CAPI provider installation, template rendering, and move pivot operations across clusters.

  • Consolidates multi-CRD CAPI lifecycle and health views
Maintenance & Lineage 9 / 10

Official Kubernetes SIG Cluster Lifecycle project (kubernetes-sigs/cluster-api) under Apache-2.0.

  • Official kubernetes-sigs/cluster-api repository
Docs & Verifiability 7 / 10

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

Auth Modes
Config File Env API Key
Credential Storage

Reads Kubernetes contexts from ~/.kube/config (--kubeconfig) and provider variables/credentials from ~/.cluster-api/clusterctl.yaml or environment variables.

Side Effects
Read-Only Local Write Remote Write Destructive
Cost & Quotas

CLI is free (Apache-2.0); generated workload clusters provision infrastructure via configured cloud providers.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

Render a workload cluster manifest locally
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.

Inspect workload cluster health tree
clusterctl describe cluster my-workload -n default --show-conditions all

Displays the hierarchical condition status of Cluster, ControlPlane, and Machine objects.

Controlled Writes & Previews

Initialize CAPI providers on a management cluster
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 cluster renders complete CAPI manifests locally before applying.
  • + clusterctl describe cluster aggregates deeply nested CAPI machine conditions in one view.
  • + clusterctl upgrade plan provides a clear pre-upgrade check.

Caveats & Pitfalls

  • ! No --json output flag on describe cluster or upgrade plan; JSON inspection requires kubectl get ... -o json.
  • ! clusterctl init and move lack --dry-run.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI