k8s-capi
Provides tools for provisioning, scaling, and upgrading Kubernetes clusters using Cluster API.
Install
mkdir -p .claude/skills/k8s-capi && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/6046" && unzip -o skill.zip -d .claude/skills/k8s-capi && rm skill.zipInstalls to .claude/skills/k8s-capi
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Cluster API lifecycle management for provisioning, scaling, and upgrading Kubernetes clusters. Use when managing cluster infrastructure or multi-cluster operations.Key capabilities
- →Detect Cluster API installation
- →List Kubernetes clusters and their phases
- →Retrieve kubeconfig for workload clusters
- →Scale worker nodes by adjusting machine deployment replicas
- →List machine deployments, machines, machine sets, and machine health checks
- →Create new Kubernetes clusters using manifest files
How it works
The skill uses kubectl-mcp-server's Cluster API tools to manage Kubernetes cluster lifecycles. It detects CAPI installations, lists clusters, gets kubeconfigs, and scales machine deployments.
Inputs & outputs
When to use k8s-capi
- →Provision new Kubernetes clusters
- →Scale worker nodes via CAPI
- →Retrieve cluster kubeconfig
About this skill
Cluster API Lifecycle Management
Manage Kubernetes clusters using kubectl-mcp-server's Cluster API tools (11 tools).
When to Apply
Use this skill when:
- User mentions: "Cluster API", "CAPI", "cluster lifecycle", "machine", "workload cluster"
- Operations: provisioning clusters, scaling nodes, upgrading Kubernetes versions
- Keywords: "provision cluster", "scale workers", "machine deployment", "cluster class"
Priority Rules
| Priority | Rule | Impact | Tools |
|---|---|---|---|
| 1 | Detect CAPI installation first | CRITICAL | capi_detect_tool |
| 2 | Check cluster phase before operations | HIGH | capi_cluster_get_tool |
| 3 | Monitor machines during scaling | HIGH | capi_machines_list_tool |
| 4 | Get kubeconfig after provisioning | MEDIUM | capi_cluster_kubeconfig_tool |
Quick Reference
| Task | Tool | Example |
|---|---|---|
| Detect CAPI | capi_detect_tool | capi_detect_tool() |
| List clusters | capi_clusters_list_tool | capi_clusters_list_tool(namespace) |
| Get cluster kubeconfig | capi_cluster_kubeconfig_tool | capi_cluster_kubeconfig_tool(name, namespace) |
| Scale workers | capi_machinedeployment_scale_tool | capi_machinedeployment_scale_tool(name, namespace, replicas) |
Check Installation
capi_detect_tool()
List Clusters
# List all CAPI clusters
capi_clusters_list_tool(namespace="default")
# Shows:
# - Cluster name
# - Phase (Provisioning, Provisioned, Deleting)
# - Infrastructure ready
# - Control plane ready
Get Cluster Details
capi_cluster_get_tool(name="my-cluster", namespace="default")
# Shows:
# - Spec (control plane, infrastructure)
# - Status (phase, conditions)
# - Network configuration
Get Cluster Kubeconfig
# Get kubeconfig for workload cluster
capi_cluster_kubeconfig_tool(name="my-cluster", namespace="default")
# Returns kubeconfig to access the cluster
Machines
List Machines
capi_machines_list_tool(namespace="default")
# Shows:
# - Machine name
# - Cluster
# - Phase (Running, Provisioning, Failed)
# - Provider ID
# - Version
Get Machine Details
capi_machine_get_tool(name="my-cluster-md-0-xxx", namespace="default")
Machine Deployments
List Machine Deployments
capi_machinedeployments_list_tool(namespace="default")
# Shows:
# - Deployment name
# - Cluster
# - Replicas (ready/total)
# - Version
Scale Machine Deployment
# Scale worker nodes
capi_machinedeployment_scale_tool(
name="my-cluster-md-0",
namespace="default",
replicas=5
)
Machine Sets
capi_machinesets_list_tool(namespace="default")
Machine Health Checks
capi_machinehealthchecks_list_tool(namespace="default")
# Health checks automatically remediate unhealthy machines
Cluster Classes
# List cluster templates
capi_clusterclasses_list_tool(namespace="default")
# ClusterClasses define reusable cluster configurations
Create Cluster
kubectl_apply(manifest="""
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: my-cluster
namespace: default
spec:
clusterNetwork:
pods:
cidrBlocks:
- 192.168.0.0/16
services:
cidrBlocks:
- 10.96.0.0/12
controlPlaneRef:
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KubeadmControlPlane
name: my-cluster-control-plane
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AWSCluster
name: my-cluster
""")
Create Machine Deployment
kubectl_apply(manifest="""
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachineDeployment
metadata:
name: my-cluster-md-0
namespace: default
spec:
clusterName: my-cluster
replicas: 3
selector:
matchLabels:
cluster.x-k8s.io/cluster-name: my-cluster
template:
spec:
clusterName: my-cluster
version: v1.28.0
bootstrap:
configRef:
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
name: my-cluster-md-0
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: AWSMachineTemplate
name: my-cluster-md-0
""")
Cluster Lifecycle Workflows
Provision New Cluster
1. kubectl_apply(cluster_manifest)
2. capi_clusters_list_tool(namespace) # Wait for Provisioned
3. capi_cluster_kubeconfig_tool(name, namespace) # Get access
Scale Workers
1. capi_machinedeployments_list_tool(namespace)
2. capi_machinedeployment_scale_tool(name, namespace, replicas)
3. capi_machines_list_tool(namespace) # Monitor
Upgrade Cluster
1. # Update control plane version
2. # Update machine deployment version
3. capi_machines_list_tool(namespace) # Monitor rollout
Troubleshooting
Cluster Stuck Provisioning
1. capi_cluster_get_tool(name, namespace) # Check conditions
2. capi_machines_list_tool(namespace) # Check machine status
3. get_events(namespace) # Check events
4. # Check infrastructure provider logs
Machine Failed
1. capi_machine_get_tool(name, namespace)
2. get_events(namespace)
3. # Common issues:
# - Cloud provider quota
# - Invalid machine template
# - Network issues
Related Skills
- k8s-multicluster - Multi-cluster operations
- k8s-operations - kubectl operations
When not to use it
- →When managing Kubernetes clusters without Cluster API
- →When the user does not mention Cluster API, CAPI, cluster lifecycle, machine, or workload cluster
Limitations
- →The skill requires an existing Cluster API installation to function.
- →Troubleshooting steps may require checking cloud provider quotas or infrastructure provider logs.
How it compares
This skill provides a structured, tool-based approach to managing Kubernetes cluster lifecycles via Cluster API, contrasting with direct kubectl commands for individual resources.
Compared to similar skills
k8s-capi side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| k8s-capi (this skill) | 1 | 6mo | No flags | Intermediate |
| devops-iac-engineer | 2 | 7mo | Review | Advanced |
| deployment-engineer | 4 | 4mo | No flags | Advanced |
| devops | 2 | 6mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by rohitg00
View all by rohitg00 →You might also like
devops-iac-engineer
davila7
Implements infrastructure as code using Terraform, Kubernetes, and cloud platforms. Designs scalable architectures, CI/CD pipelines, and observability solutions. Provides security-first DevOps practices and site reliability engineering guidance.
deployment-engineer
sickn33
Expert deployment engineer specializing in modern CI/CD pipelines, GitOps workflows, and advanced deployment automation. Masters GitHub Actions, ArgoCD/Flux, progressive delivery, container security, and platform engineering. Handles zero-downtime deployments, security scanning, and developer experience optimization. Use PROACTIVELY for CI/CD design, GitOps implementation, or deployment automation.
devops
mrgoonie
Deploy to Cloudflare (Workers, R2, D1), Docker, GCP (Cloud Run, GKE), Kubernetes (kubectl, Helm). Use for serverless, containers, CI/CD, GitOps, security audit.
devops-engineer
Jeffallan
Use when setting up CI/CD pipelines, containerizing applications, or managing infrastructure as code. Invoke for pipelines, Docker, Kubernetes, cloud platforms, GitOps.
bazel-build-optimization
wshobson
Optimize Bazel builds for large-scale monorepos. Use when configuring Bazel, implementing remote execution, or optimizing build performance for enterprise codebases.
senior-devops
davila7
Comprehensive DevOps skill for CI/CD, infrastructure automation, containerization, and cloud platforms (AWS, GCP, Azure). Includes pipeline setup, infrastructure as code, deployment automation, and monitoring. Use when setting up pipelines, deploying applications, managing infrastructure, implementing monitoring, or optimizing deployment processes.