Rohit Ghumare

Kubernetes Skills

運維安全v1.0.0
作者:Rohit Ghumare更新於 2026-05-18k8s-capi@clawhub_rohitg00/k8s-capi
伺服器運維DevOps#Kubernetes

據 AlphaMoat 統計,截至 2026-09,Kubernetes Skills 累計下載 3,460 次、獲 2 個星標,在全部 5,078 個 AI 技能中排名第 3,206 位,在「運維安全」分類(264 個)中排名第 207 位。

累計安裝
102
累計下載
3460
星標
2
全站排名
#3,206
全站前 64% · 「運維安全」前 79%
平台累計安裝累計下載星標評論
ClawHub ↗10231261-
SkillHub ↗10134602—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

可檢查叢集、機器和部署狀態,獲取工作負載叢集 kubeconfig,並規劃叢集建立、工作節點擴縮和版本升級。應用 manifest、改變副本數或升級可能影響工作負載和基礎設施成本;kubeconfig 含訪問憑據。執行前應核對目標叢集、配置和變更範圍。

資料釋出於 2026-10-29

可以用來做什麼

  • 檢查 CAPI 安裝情況及叢集、機器和部署狀態。
  • 獲取工作負載叢集 kubeconfig 或檢視叢集配置。
  • 規劃叢集建立、工作節點擴縮或 Kubernetes 版本升級。

什麼時候用

  • 需要檢查或管理 Kubernetes Cluster API 叢集生命週期時。
  • 需要診斷叢集或機器 provisioning 狀態時。
  • 應用配置、擴縮節點、升級版本或輸出 kubeconfig 前,需要核實目標、影響和訪問許可權時。

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

只讀檢查指定 namespace 中的叢集和機器狀態,不應用 manifest 或改變副本數。
在擴縮或升級叢集前列出目標叢集、當前狀態和預期變更,等待確認;不要輸出 kubeconfig 憑據。

月度資料趨勢

累計下載3460
1927275135742026-03 · 累計下載 20412026-05 · 累計下載 25702026-06 · 累計下載 26972026-07 · 累計下載 29532026-08 · 累計下載 31712026-09 · 累計下載 346026-0326-09
星標2
1222026-03 · 星標 12026-05 · 星標 22026-06 · 星標 12026-07 · 星標 22026-08 · 星標 22026-09 · 星標 226-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-093460—2
2026-083171+7.4%2
2026-072953+9.5%2
2026-062697+4.9%1
2026-052570—2
2026-032041—1

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

5.8 KB · ClawHub v2.0.0
---
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
---
展開全部(共 259 行)

# Cluster API Lifecycle Management

Manage Kubernetes clusters using kubectl-mcp-server's Cluster API tools (11 tools).

> Requires the `capi` toolset: start kubectl-mcp-server with `--toolsets default,capi` (or `MCP_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 clusters
capi_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 cluster
capi_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 nodes
capi_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 templates
capi_list_clusterclasses(namespace="default")

# ClusterClasses define reusable cluster configurations
```

## Create Cluster

```python
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

```python
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
```python
1. kubectl_apply(cluster_manifest)
2. capi_list_clusters(namespace)  # Wait for Provisioned
3. 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 version
2. # Update machine deployment version
3. capi_list_machines(namespace)  # Monitor rollout
```

## Troubleshooting

### Cluster Stuck Provisioning

```python
1. capi_get_cluster(name, namespace)  # Check conditions
2. capi_list_machines(namespace)  # Check machine status
3. kubectl_get(resource_type="events", namespace)  # Check events
4. # 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](../k8s-multicluster/SKILL.md) - Multi-cluster operations
- [k8s-operations](../k8s-operations/SKILL.md) - kubectl operations

「運維安全」分類下的熱門技能

資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。