ddevaal

kubectl

IT Ops & Securityv1.0.0
By ddevaalUpdated 2026-05-17@clawhub_ddevaal/kubectl
Monitoring & AlertsServer OpsTroubleshooting#Kubernetes#Debug#Deploy#Health

According to AlphaMoat, as of 2026-10, kubectl has 6,663 downloads and 7 stars — ranked by downloads #4,277 among 10,914 AI skills in this ranking, and #137 of 502 in IT Ops & Security.

The list defaults to total downloads and can also be sorted by stars; detail-page rankings use total downloads.

Downloads
6.7K
Stars
7
Overall download rank
#4,277
Top 40% overall · Top 28% in IT Ops & Security
PlatformDownloadsStarsComments
ClawHub ↗5.1K5-
SkillHub ↗6.7K7—

Platforms count differently and update at different times.

What this skill does

The skill outlines common kubectl workflows for reading resources, inspecting logs, running container commands, updating workloads, rolling back, and preparing nodes for maintenance. Before changing a cluster, verify the context, namespace, and permissions, and prefer a client-side dry run. Requires kubectl and an active kubeconfig. Use least privilege and verify context and namespace before each operation. Redact kubeconfig, secrets, tokens, and logs; for port forwarding prefer localhost and confirm target and duration first.

Profile published 2026-10-27

What you can do with it

  • Inspect pods, deployments, services, nodes, and events.
  • Review container logs and run diagnostic commands when needed.
  • Apply or update workloads, monitor rollout status, and roll back when needed.

When to use it

  • Use it when working from the command line with a Kubernetes cluster.
  • Before operations such as apply, scale, delete, drain, exec, or port-forward, verify the target and permissions and obtain approval.

Example prompts

Generated from the skill’s documentation as examples; not results of actual runs.

List the pods and deployments in the current namespace and summarize any unusual status; do not run modifying commands.

Monthly Trend

Downloads6.7K
4.2K5.5K6.8K2026-05 · Downloads 4.4K2026-06 · Downloads 4.6K2026-07 · Downloads 4.8K2026-08 · Downloads 4.9K2026-09 · Downloads 5.2K2026-10 · Downloads 6.7K26-0526-0926-10
Stars7
5672026-05 · Stars 52026-06 · Stars 52026-07 · Stars 62026-08 · Stars 72026-09 · Stars 72026-10 · Stars 726-0526-0926-10

The counting method changed in 2026-09: skills with the same name are now counted separately by author, and the full catalog is covered. Dashed lines show months before the change; they are not compared with later months, and no growth is computed across the change.

MonthDownloadsMoMStars
2026-106.7K—7
2026-095.2K—7
2026-084.9K+2.6%7
2026-074.8K+5.4%6
2026-064.6K+4.4%5
2026-054.4K—5

SKILL.md (original)

The author’s original file, shown as plain text without edits or review by AlphaMoat. Links are not clickable; check commands before running them. Fetched 2026-10-23.

7.0 KB · ClawHub v1.0.0
---
name: kubectl-skill
description: Execute and manage Kubernetes clusters via kubectl commands. Query resources, deploy applications, debug containers, manage configurations, and monitor cluster health. Use when working with Kubernetes clusters, containers, deployments, or pod diagnostics.
license: MIT
metadata:
  author: Dennis de Vaal <[email protected]>
  version: "1.0.0"
  keywords: "kubernetes,k8s,container,docker,deployment,pods,cluster"
compatibility: Requires kubectl binary (v1.20+) and active kubeconfig connection to a Kubernetes cluster. Works on macOS, Linux, and Windows (WSL).
---
Show all (248 lines)

# kubectl Skill

Execute Kubernetes cluster management operations using the `kubectl` command-line tool.

## Overview

This skill enables agents to:
- **Query Resources** — List and get details about pods, deployments, services, nodes, etc.
- **Deploy & Update** — Create, apply, patch, and update Kubernetes resources
- **Debug & Troubleshoot** — View logs, execute commands in containers, inspect events
- **Manage Configuration** — Update kubeconfig, switch contexts, manage namespaces
- **Monitor Health** — Check resource usage, rollout status, events, and pod conditions
- **Perform Operations** — Scale deployments, drain nodes, manage taints and labels

## Prerequisites

1. **kubectl binary** installed and accessible on PATH (v1.20+)
2. **kubeconfig** file configured with cluster credentials (default: `~/.kube/config`)
3. **Active connection** to a Kubernetes cluster

## Quick Setup

### Install kubectl

**macOS:**
```bash
brew install kubernetes-cli
```

**Linux:**
```bash
apt-get install -y kubectl  # Ubuntu/Debian
yum install -y kubectl      # RHEL/CentOS
```

**Verify:**
```bash
kubectl version --client
kubectl cluster-info  # Test connection
```

## Essential Commands

### Query Resources
```bash
kubectl get pods                    # List all pods in current namespace
kubectl get pods -A                 # All namespaces
kubectl get pods -o wide            # More columns
kubectl get nodes                   # List nodes
kubectl describe pod POD_NAME        # Detailed info with events
```

### View Logs
```bash
kubectl logs POD_NAME                # Get logs
kubectl logs -f POD_NAME             # Follow logs (tail -f)
kubectl logs POD_NAME -c CONTAINER   # Specific container
kubectl logs POD_NAME --previous     # Previous container logs
```

### Execute Commands
```bash
kubectl exec -it POD_NAME -- /bin/bash   # Interactive shell
kubectl exec POD_NAME -- COMMAND         # Run single command
```

### Deploy Applications
```bash
kubectl apply -f deployment.yaml         # Apply config
kubectl create -f deployment.yaml        # Create resource
kubectl apply -f deployment.yaml --dry-run=client  # Test
```

### Update Applications
```bash
kubectl set image deployment/APP IMAGE=IMAGE:TAG  # Update image
kubectl scale deployment/APP --replicas=3          # Scale pods
kubectl rollout status deployment/APP              # Check status
kubectl rollout undo deployment/APP                # Rollback
```

### Manage Configuration
```bash
kubectl config view                  # Show kubeconfig
kubectl config get-contexts          # List contexts
kubectl config use-context CONTEXT   # Switch context
```

## Common Patterns

### Debugging a Pod
```bash
# 1. Identify the issue
kubectl describe pod POD_NAME

# 2. Check logs
kubectl logs POD_NAME
kubectl logs POD_NAME --previous

# 3. Execute debug commands
kubectl exec -it POD_NAME -- /bin/bash

# 4. Check events
kubectl get events --sort-by='.lastTimestamp'
```

### Deploying a New Version
```bash
# 1. Update image
kubectl set image deployment/MY_APP my-app=my-app:v2

# 2. Monitor rollout
kubectl rollout status deployment/MY_APP -w

# 3. Verify
kubectl get pods -l app=my-app

# 4. Rollback if needed
kubectl rollout undo deployment/MY_APP
```

### Preparing Node for Maintenance
```bash
# 1. Drain node (evicts all pods)
kubectl drain NODE_NAME --ignore-daemonsets

# 2. Do maintenance
# ...

# 3. Bring back online
kubectl uncordon NODE_NAME
```

## Output Formats

The `--output` (`-o`) flag supports multiple formats:

- `table` — Default tabular format
- `wide` — Extended table with additional columns
- `json` — JSON format (useful with `jq`)
- `yaml` — YAML format
- `jsonpath` — JSONPath expressions
- `custom-columns` — Define custom output columns
- `name` — Only resource names

**Examples:**
```bash
kubectl get pods -o json | jq '.items[0].metadata.name'
kubectl get pods -o jsonpath='{.items[*].metadata.name}'
kubectl get pods -o custom-columns=NAME:.metadata.name,STATUS:.status.phase
```

## Global Flags (Available to All Commands)

```bash
-n, --namespace=<ns>           # Operate in specific namespace
-A, --all-namespaces           # Operate across all namespaces
--context=<context>            # Use specific kubeconfig context
-o, --output=<format>          # Output format (json, yaml, table, etc.)
--dry-run=<mode>               # Dry-run mode (none, client, server)
-l, --selector=<labels>        # Filter by labels
--field-selector=<selector>    # Filter by fields
-v, --v=<int>                  # Verbosity level (0-9)
```

## Dry-Run Modes

- `--dry-run=client` — Fast client-side validation (test commands safely)
- `--dry-run=server` — Server-side validation (more accurate)
- `--dry-run=none` — Execute for real (default)

**Always test with `--dry-run=client` first:**
```bash
kubectl apply -f manifest.yaml --dry-run=client
```

## Advanced Topics

For detailed reference material, command-by-command documentation, troubleshooting guides, and advanced workflows, see:
- [references/REFERENCE.md](references/REFERENCE.md) — Complete kubectl command reference
- [scripts/](scripts/) — Helper scripts for common tasks

## Helpful Tips

1. **Use label selectors for bulk operations:**
   ```bash
   kubectl delete pods -l app=myapp
   kubectl get pods -l env=prod,tier=backend
   ```

2. **Watch resources in real-time:**
   ```bash
   kubectl get pods -w  # Watch for changes
   ```

3. **Use `-A` flag for all namespaces:**
   ```bash
   kubectl get pods -A  # See pods everywhere
   ```

4. **Save outputs for later comparison:**
   ```bash
   kubectl get deployment my-app -o yaml > deployment-backup.yaml
   ```

5. **Check before you delete:**
   ```bash
   kubectl delete pod POD_NAME --dry-run=client
   ```

## Getting Help

```bash
kubectl help                      # General help
kubectl COMMAND --help            # Command help
kubectl explain pods              # Resource documentation
kubectl explain pods.spec         # Field documentation
```

## Environment Variables

- `KUBECONFIG` — Path to kubeconfig file (can include multiple paths separated by `:`)
- `KUBECTL_CONTEXT` — Override default context

## Resources

- [Official kubectl Docs](https://kubernetes.io/docs/reference/kubectl/)
- [kubectl Cheat Sheet](https://kubernetes.io/docs/reference/kubectl/cheatsheet/)
- [Kubernetes API Reference](https://kubernetes.io/docs/reference/generated/kubernetes-api/)
- [Agent Skills Specification](https://agentskills.io/)

---

**Version:** 1.0.0  
**License:** MIT  
**Compatible with:** kubectl v1.20+, Kubernetes v1.20+

Popular in IT Ops & Security

钟馗.skillIT Ops & Security

钟馗.Skill——会更新漏洞库的安全审查专家。直来直去、快刀斩乱麻,三层审查(静态审计/行为模拟/供应链溯源)覆盖12类风险,输出结构化安全裁定(✅干净/⚠️可疑/🚫恶意)。Use when 用户说"审查这个Skill"、"安全检查"、"钟馗看下"、"审一下"、"查一下这个skill"、安装Skill前的安全评估、或需要审计SKILL.md的恶意载荷。

↓ 336.9K★ 17user_741dc82b
SkillScanIT Ops & Security

Scans skill packages for risk before use and gates installation on the verdict.

↓ 183.2K★ 41tokauthai
Free Ride - Unlimited free AIIT Ops & Security

A tool that configures free OpenRouter models and a fallback chain for OpenClaw.

↓ 134.1K★ 492Shaishav Pidadi
a ca s ca s c ca s cIT Ops & Security

Parse, search, and analyze application logs across formats. Use when debugging from log files, setting up structured logging, analyzing error patterns, correlating events across services, parsing stack traces, or monitoring log output in real time.

↓ 124.9K★ -user_60e896a0
Skill ScannerIT Ops & Security

Security checks for installing skills, packages, or plugins. Use BEFORE any npm install, openclaw plugins install, clawhub install, or similar install...

↓ 93.2K★ 4sudhindrat
网安技能IT Ops & Security

网络安全与SRC漏洞掘金实战技能。融合「系统学习路径」与「SRC实战掘金」双模式: ①学习模式=法律→基础→工具→靶场→攻防→就业全流程; ②实战模式=直接指导在腾讯TSRC、阿里ASRC、百度BSRC等平台挖掘高价值漏洞变现。 当用户提出以下问题时触发: "我想学网络安全怎么入门""SRC漏洞怎么挖能赚钱""渗透测试需要学什么" "Web安全漏洞原理是什么""怎么准备CTF比赛""护网面试会问什么" "云安全怎么学""挖漏洞赚钱的方法""端口扫描脚本怎么写" "SQL注入怎么检测""子域名怎么枚举""XSS漏洞怎么找" "靶场怎么搭建""Kali Linux怎么用""Metasploit怎么入门" "等保测评是什么""代码审计怎么做""内网渗透怎么学" "信息泄露漏洞怎么挖""越权漏洞怎么测试""逻辑漏洞挖掘技巧" "简历怎么写才能进安全公司""安全行业面试题有哪些" "Burp Suite怎么用""DVWA怎么安装""Pikachu靶场搭建" "Vulhub漏洞复现""网络安全法有什么规定""CTF夺旗赛怎么参加" "AWD比赛是什么""应急响应怎么做""攻击溯源怎么搞" "数据安全怎么保障""公有云安全怎么防护""私有云攻防怎么做" "云原生安全是什么"。

↓ 80.5K★ 16user_d2cc4baf
人人都能成为黑客v2.0(Lvan)IT Ops & Security

Unified Web penetration testing and SRC vulnerability hunting Skill. Model-driven threat modeling (12 dimensions), JSON 字段规范 state persistence, SRC/补天 compliant reporting with confirmed gate (3-layer determination). Use when user asks for authorized penetration testing, vulnerability assessment, SRC hunting (补天/Butian/vendor SRC/CNVD/众测), bug bounty, security evaluation with explicit target URL, or wants operational Recon→PoC→Report workflow. Do NOT use for CTF challenges, unauthorized testing, mobile app testing, infrastructure scanning, or social engineering.

↓ 56.8K★ 37user_a730098d
skill-vetterIT Ops & Security

Security-first skill vetting for AI agents. Use before installing any skill from ClawdHub, GitHub, or other sources. Checks for red flags, permission scope, and suspicious patterns.

↓ 54.0K★ -user_814dbe54

More from ddevaal

Data as of 2026-10. Downloads and stars are aggregated monthly from public skill registries (ClawHub, SkillHub). See data methodology.