<< All versions
Skill v1.0.1
currentAutomated scan96/100rohitg00/kubectl-mcp-server/k8s-capi
4 files
──Details
PublishedOctober 26, 2026 at 04:38 AM
Content Hashsha256:62d33f0d07606b25...
Git SHAa3fef9fe2310
Bump Typepatch
──Files
Files (1 file, 5.8 KB)
SKILL.md5.8 KBactive
SKILL.md · 260 lines · 5.8 KB
version: "1.0.1" name: k8s-capi description: Cluster API lifecycle management for provisioning, scaling, and upgrading Kubernetes clusters. Use when managing cluster infrastructure or multi-cluster operations. license: MIT-0 metadata: author: rohitg00 version: "2.0.0" tools: 13 category: infrastructure
Cluster API Lifecycle Management
Manage Kubernetes clusters using kubectl-mcp-server's Cluster API tools (11 tools).
Requires thecapitoolset: start kubectl-mcp-server with--toolsets default,capi(orMCP_TOOLSETS=default,capi).
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 | detect_ecosystem | |
| 2 | Check cluster phase before operations | HIGH | capi_get_cluster | |
| 3 | Monitor machines during scaling | HIGH | capi_list_machines | |
| 4 | Get kubeconfig after provisioning | MEDIUM | capi_get_cluster_kubeconfig |
Quick Reference
| Task | Tool | Example | |
|---|---|---|---|
| Detect CAPI | detect_ecosystem | detect_ecosystem() | |
| List clusters | capi_list_clusters | capi_list_clusters(namespace) | |
| Get cluster kubeconfig | capi_get_cluster_kubeconfig | capi_get_cluster_kubeconfig(name, namespace) | |
| Scale workers | capi_scale_machinedeployment | capi_scale_machinedeployment(name, namespace, replicas) |
Check Installation
python
detect_ecosystem()
List Clusters
python
# List all CAPI clusterscapi_list_clusters(namespace="default")# Shows:# - Cluster name# - Phase (Provisioning, Provisioned, Deleting)# - Infrastructure ready# - Control plane ready
Get Cluster Details
python
capi_get_cluster(name="my-cluster", namespace="default")# Shows:# - Spec (control plane, infrastructure)# - Status (phase, conditions)# - Network configuration
Get Cluster Kubeconfig
python
# Get kubeconfig for workload clustercapi_get_cluster_kubeconfig(name="my-cluster", namespace="default")# Returns kubeconfig to access the cluster
Machines
List Machines
python
capi_list_machines(namespace="default")# Shows:# - Machine name# - Cluster# - Phase (Running, Provisioning, Failed)# - Provider ID# - Version
Get Machine Details
python
capi_get_machine(name="my-cluster-md-0-xxx", namespace="default")
Machine Deployments
List Machine Deployments
python
capi_list_machinedeployments(namespace="default")# Shows:# - Deployment name# - Cluster# - Replicas (ready/total)# - Version
Scale Machine Deployment
python
# Scale worker nodescapi_scale_machinedeployment(name="my-cluster-md-0",namespace="default",replicas=5)
Machine Sets
python
capi_list_machinesets(namespace="default")
Machine Health Checks
python
capi_list_machinehealthchecks(namespace="default")# Health checks automatically remediate unhealthy machines
Cluster Classes
python
# List cluster templatescapi_list_clusterclasses(namespace="default")# ClusterClasses define reusable cluster configurations
Create Cluster
python
kubectl_apply(manifest="""apiVersion: cluster.x-k8s.io/v1beta1kind: Clustermetadata:name: my-clusternamespace: defaultspec:clusterNetwork:pods:cidrBlocks:- 192.168.0.0/16services:cidrBlocks:- 10.96.0.0/12controlPlaneRef:apiVersion: controlplane.cluster.x-k8s.io/v1beta1kind: KubeadmControlPlanename: my-cluster-control-planeinfrastructureRef:apiVersion: infrastructure.cluster.x-k8s.io/v1beta1kind: AWSClustername: my-cluster""")
Create Machine Deployment
python
kubectl_apply(manifest="""apiVersion: cluster.x-k8s.io/v1beta1kind: MachineDeploymentmetadata:name: my-cluster-md-0namespace: defaultspec:clusterName: my-clusterreplicas: 3selector:matchLabels:cluster.x-k8s.io/cluster-name: my-clustertemplate:spec:clusterName: my-clusterversion: v1.28.0bootstrap:configRef:apiVersion: bootstrap.cluster.x-k8s.io/v1beta1kind: KubeadmConfigTemplatename: my-cluster-md-0infrastructureRef:apiVersion: infrastructure.cluster.x-k8s.io/v1beta1kind: AWSMachineTemplatename: my-cluster-md-0""")
Cluster Lifecycle Workflows
Provision New Cluster
python
1. kubectl_apply(cluster_manifest)2. capi_list_clusters(namespace) # Wait for Provisioned3. capi_get_cluster_kubeconfig(name, namespace) # Get access
Scale Workers
python
1. capi_list_machinedeployments(namespace)2. capi_scale_machinedeployment(name, namespace, replicas)3. capi_list_machines(namespace) # Monitor
Upgrade Cluster
python
1. # Update control plane version2. # Update machine deployment version3. capi_list_machines(namespace) # Monitor rollout
Troubleshooting
Cluster Stuck Provisioning
python
1. capi_get_cluster(name, namespace) # Check conditions2. capi_list_machines(namespace) # Check machine status3. kubectl_get(resource_type="events", namespace) # Check events4. # Check infrastructure provider logs
Machine Failed
python
1. capi_get_machine(name, namespace)2. kubectl_get(resource_type="events", namespace)3. # Common issues:# - Cloud provider quota# - Invalid machine template# - Network issues
Related Skills
- k8s-multicluster - Multi-cluster operations
- k8s-operations - kubectl operations