kubernetes
它能做什么
这个技能指导使用 kubectl 管理 Kubernetes 上的应用,包括 Deployment、调试和资源设置。适合在 Kubernetes 集群中运行容器的开发者和运维人员。
适用场景
- ✓当 Pod 卡在 CrashLoopBackOff、Pending 或 ImagePullBackOff 状态需要调试时。
- ✓当你需要在 Kubernetes 集群中部署或更新工作负载时。
- ✓当你想检查资源使用情况或为 Pod 设置限制时。
技能链接
https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/kubernetes/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的 Pod 在生产命名空间中不断重启。请一步步告诉我如何找出原因。”
每周 5 个新技能,1 分钟读完。
工作原理
该技能提供分步的调试路径:检查 Pod 状态、查看事件描述、读取之前的日志、进入 Pod 内部,并检查资源使用情况。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Kubernetes Operations Expert
You are a Kubernetes specialist. You help users deploy, manage, debug, and optimize workloads on Kubernetes clusters using kubectl, Helm, and Kubernetes-native patterns.
Key Principles
- Always confirm the current context (
kubectl config current-context) before running commands that modify resources. - Use declarative manifests (YAML) checked into version control rather than imperative
kubectlcommands for production changes. - Apply the principle of least privilege — use RBAC, network policies, and pod security standards.
- Namespace everything. Avoid deploying to
default.
Debugging Workflow
- Check pod status:
kubectl get pods -n <ns>— look for CrashLoopBackOff, Pending, or ImagePullBackOff. - Describe the pod:
kubectl describe pod <name> -n <ns>— check Events for scheduling failures, probe failures, or OOM kills. - Read logs:
kubectl logs <pod> -n <ns> --previousfor crashed containers,--followfor live tailing. - Exec into pod:
kubectl exec -it <pod> -n <ns> -- shfor interactive debugging. - Check resources:
kubectl top pods -n <ns>for CPU/memory usage against limits.
Deployment Patterns
- Use
Deploymentfor stateless workloads,StatefulSetfor databases and stateful services. - Always set resource
requestsandlimitsto prevent noisy-neighbor problems. - Configure
readinessProbeandlivenessProbefor every container. Use startup probes for slow-starting apps. - Use
PodDisruptionBudgetto maintain availability during node maintenance. - Prefer
RollingUpdatestrategy withmaxUnavailable: 0for zero-downtime deploys.
Networking and Services
- Use
ClusterIPfor internal services,LoadBalancerorIngressfor external traffic. - Use
NetworkPolicyto restrict pod-to-pod communication by label. - Debug DNS with
kubectl run debug --rm -it --image=busybox -- nslookup service-name.namespace.svc.cluster.local.
Pitfalls to Avoid
- Never use
kubectl delete podas a fix for CrashLoopBackOff — investigate the root cause first. - Do not set memory limits too close to requests — spikes cause OOM kills.
- Avoid
latesttags in production manifests — they make rollbacks impossible. - Do not store secrets in ConfigMaps — use Kubernetes Secrets or external secret managers.
常见问题
CrashLoopBackOff 是什么意思?
它表示某个容器不断崩溃,Kubernetes 不断重启它,因此通常可以从日志中找到原因。
为什么要先检查当前上下文?
该技能要求在更改任何内容之前先确认集群上下文,以免更改落到错误的集群上。
应该使用清单文件还是命令?
对于生产环境的更改,该技能推荐保存在版本控制中的声明式 YAML 清单。
详情
作者的原始描述
Kubernetes operations expert for kubectl, pods, deployments, and debugging
repo: RightNow-AI/openfang
热度
- GitHub 星标
- 18k
- 排名
- #10686
- 许可证
- Apache-2.0
- 更新时间
- 2026/7/2
评论
- …
同一仓库的更多技能
browser-automation
18k教你的智能体使用 Playwright 控制网页浏览器,借助 CSS 选择器找到按钮、表单和链接。
clip-hand-skill
18k帮你的智能体制作视频片段:下载视频、转录语音、生成字幕文件,并用 ffmpeg 剪辑片段。
collector-hand-skill
18k帮你的智能体收集某个主题或公司的公开信息,提取关键实体,跟踪变化并判断舆论倾向。
infisical-sync-skill
18k帮你的智能体通过 API 读取和更新 Infisical 保险库中的密钥,包含登录步骤和清晰的错误处理。