kubectl-basics

kubectl-basics is a skill for Claude Code, Codex from chaterm/terminal-skills. It costs 15 tokens per session (930 once invoked), scanned A, original, Apache-2.0.

A guide to kubectl, the command-line tool used to manage Kubernetes clusters, which run containerized applications.

In plain words
What is it for?
Use it to check cluster and node status, switch between clusters, inspect Pods and Deployments, apply or delete configuration files, edit resources, patch settings, and scale applications.
Why use it?
It provides common commands for inspecting cluster resources and changing them without having to remember each command.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to check cluster and node status, switch between clusters, inspect Pods and Deployments, apply or delete configuration files, edit resources, patch settings, and scale applications.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/chaterm/terminal-skills/kubectl-basics
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add chaterm/terminal-skills --skill kubectl-basics
Clone the repo
git clone --depth 1 https://github.com/chaterm/terminal-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for kubectl-basics

README.md
[![agentmods](https://agentmods.dev/badge/skills/chaterm/terminal-skills/kubectl-basics/github.svg)](https://agentmods.dev/skills/chaterm/terminal-skills/kubectl-basics)
Your own site
<a href="https://agentmods.dev/skills/chaterm/terminal-skills/kubectl-basics"><img src="https://agentmods.dev/badge/skills/chaterm/terminal-skills/kubectl-basics/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for kubectl-basics

Your own site · 80×15
<a href="https://agentmods.dev/skills/chaterm/terminal-skills/kubectl-basics"><img src="https://agentmods.dev/badge/skills/chaterm/terminal-skills/kubectl-basics.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 15 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 930 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00015 $0.00930
Opus 5 $0.00008 $0.00465
Sonnet 5 $0.00003 $0.00186
Haiku 4.5 $0.00002 $0.00093

Measured 11d ago against content hash f6d0b5c0aba8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

kubectl-basics scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

kubernetes/kubectl-basics/SKILL.md · 152 lines

How it starts

The opening of the file, as written. The whole thing — 152 lines — stays where its author put it; the contents beside it link to each section on GitHub.

kubectl 基础操作

概述

kubectl 是 Kubernetes 的命令行工具,用于与集群进行交互。本 skill 涵盖日常运维中最常用的命令。

集群信息

# 集群信息
kubectl cluster-info
kubectl version

# 节点信息
kubectl get nodes
kubectl describe node <node-name>

# 上下文切换
kubectl config get-contexts
kubectl config use-context <context-name>

资源查看

常用资源

# Pod
kubectl get pods
kubectl get pods -o wide
kubectl get pods -A                    # 所有命名空间

# Deployment
kubectl get deployments
kubectl get deploy -o yaml

# Service
kubectl get services
kubectl get svc

# 所有资源
kubectl get all
kubectl get all -n <namespace>

输出格式

kubectl get pods -o wide               # 详细信息
kubectl get pods -o yaml               # YAML 格式
kubectl get pods -o json               # JSON 格式
kubectl get pods -o jsonpath='{.items[*].metadata.name}'

资源操作

创建与删除

# 从文件创建
kubectl apply -f manifest.yaml
kubectl create -f manifest.yaml

# 删除资源
kubectl delete -f manifest.yaml
kubectl delete pod <pod-name>
kubectl delete pod <pod-name> --force --grace-period=0

编辑与更新

# 编辑资源
kubectl edit deployment <name>

# 打补丁
kubectl patch deployment <name> -p '{"spec":{"replicas":3}}'

# 扩缩容
kubectl scale deployment <name> --replicas=5

Pod 调试

# 查看日志
kubectl logs <pod-name>
kubectl logs <pod-name> -c <container>
kubectl logs <pod-name> -f              # 实时跟踪
kubectl logs <pod-name> --previous      # 上一个容器

# 进入容器
kubectl exec -it <pod-name> -- /bin/bash
kubectl exec -it <pod-name> -c <container> -- sh

# 端口转发
kubectl port-forward <pod-name> 8080:80
kubectl port-forward svc/<service> 8080:80

常见场景

场景 1:快速排查 Pod 问题

# 1. 查看 Pod 状态
kubectl get pod <name> -o wide

# 2. 查看事件
kubectl describe pod <name> | grep -A 20 Events

# 3. 查看日志
kubectl logs <name> --tail=100

场景 2:滚动更新

# 更新镜像
kubectl set image deployment/<name> container=image:tag

# 查看更新状态
kubectl rollout status deployment/<name>

# 回滚
kubectl rollout undo deployment/<name>
kubectl rollout history deployment/<name>

Read the full file on GitHub · 152 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 152 lines · 15 tokens per session scan A f6d0b5c0aba8

Subscribe to this mod's changes

kubectl-basics is a skill published in the GitHub repository chaterm/terminal-skills (59 stars, last pushed 6mo ago), licensed Apache-2.0. It adds 15 tokens to every session and 930 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

kubernetes-agent

Kubernetes production patterns — manifests, resource sizing, health probes, scaling, secrets, networking, and troubleshooting.

chandrudp29/skillhub · 25 tokens

container-manager-kubernetes-operations

Full operational Kubernetes surface via the container-manager-mcp MCP server — workloads (pods/rollouts/StatefulSets/DaemonSets/ReplicaSets/Jobs/CronJobs), config (ConfigMaps/Secrets/Namespaces/CRDs/patch), networking (Ingress/native Services/NetworkPolicy/DNS), storage (PV/PVC/StorageClass/snapshots/CSI), RBAC…

Knuckles-Team/container-manager-mcp · 189 tokens

kubernetes-docs

Kubernetes 1.36 — Pods, Deployments, Services, Ingress, ConfigMaps, Secrets, RBAC, CRDs, Operators, kubectl, Helm.

pledgeandgrow/pledge-skills · 40 tokens

bazel-k8s-expert

Expert knowledge for deploying Quarkus/Java applications to Kubernetes using Bazel. Covers rulesk8s, Helm, Kustomize, ConfigMaps, Secrets, and health probes.

kinhluan/rules-quarkus-skills · 45 tokens

Cloud Security & Container Hardening

AWS/Azure/GCP security auditing, container and Kubernetes hardening, Infrastructure as Code scanning, and cloud compliance assessment.

Masriyan/Claude-Code-CyberSecurity-Skill · 30 tokens

kubernetes-expert

Expert-level Kubernetes cluster management, deployment strategies, networking, and production operations. Use when the user mentions containers, orchestration, devops, or cloud native, or when the task involves Kubernetes Architecture, Pods, Deployments, or Services.

personamanagmentlayer/pcl · 53 tokens