k8s-manifest-generator
它能做什么
这个工具可以帮你创建 Kubernetes 的“配置文件”(称为 manifest,即清单文件)。这些文件会告诉 Kubernetes 如何运行你的应用,确保它们运行良好且安全。
适用场景
- ✓当你需要创建一个新的 manifest 来运行应用时。
- ✓用来定义应用之间如何通过网络通信。
- ✓用来安全地存储配置信息或密码。
技能链接
https://github.com/wshobson/agents/blob/main/plugins/kubernetes-operations/skills/k8s-manifest-generator/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我创建一个 manifest 来运行我的网页应用,使用镜像 'my-app:latest',并开放 80 端口。”
每周 5 个新技能,1 分钟读完。
工作原理
你告诉我你的应用需要什么(比如要使用的镜像、需要开放的端口等),我就会为你生成 Kubernetes 的配置文件。我会遵循最佳实践,确保一切都能正确、安全地运行。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Kubernetes Manifest Generator
Step-by-step guidance for creating production-ready Kubernetes manifests including Deployments, Services, ConfigMaps, Secrets, and PersistentVolumeClaims.
Purpose
This skill provides comprehensive guidance for generating well-structured, secure, and production-ready Kubernetes manifests following cloud-native best practices and Kubernetes conventions.
When to Use This Skill
Use this skill when you need to:
- Create new Kubernetes Deployment manifests
- Define Service resources for network connectivity
- Generate ConfigMap and Secret resources for configuration management
- Create PersistentVolumeClaim manifests for stateful workloads
- Follow Kubernetes best practices and naming conventions
- Implement resource limits, health checks, and security contexts
- Design manifests for multi-environment deployments
Detailed patterns and worked examples
Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.
Best Practices Summary
- Always set resource requests and limits - Prevents resource starvation
- Implement health checks - Ensures Kubernetes can manage your application
- Use specific image tags - Avoid unpredictable deployments
- Apply security contexts - Run as non-root, drop capabilities
- Use ConfigMaps and Secrets - Separate config from code
- Label everything - Enables filtering and organization
- Follow naming conventions - Use standard Kubernetes labels
- Validate before applying - Use dry-run and validation tools
- Version your manifests - Keep in Git with version control
- Document with annotations - Add context for other developers
Troubleshooting
Pods not starting:
- Check image pull errors:
kubectl describe pod <pod-name> - Verify resource availability:
kubectl get nodes - Check events:
kubectl get events --sort-by='.lastTimestamp'
Service not accessible:
- Verify selector matches pod labels:
kubectl get endpoints <service-name> - Check service type and port configuration
- Test from within cluster:
kubectl run debug --rm -it --image=busybox -- sh
ConfigMap/Secret not loading:
- Verify names match in Deployment
- Check namespace
- Ensure resources exist:
kubectl get configmap,secret
Next Steps
After creating manifests:
- Store in Git repository
- Set up CI/CD pipeline for deployment
- Consider using Helm or Kustomize for templating
- Implement GitOps with ArgoCD or Flux
- Add monitoring and observability
Related Skills
helm-chart-scaffolding- For templating and packaginggitops-workflow- For automated deploymentsk8s-security-policies- For advanced security configurations
常见问题
什么是 Kubernetes?
它是一个系统,可以帮助你同时管理和运行大量应用,并且自动化、可靠地完成这些工作。
什么是“manifest”?
它们是文本文件(通常使用 YAML 格式),用来描述 Kubernetes 应该如何运行你的应用、服务以及其他资源。
为什么要遵循“最佳实践”?
为了确保你的应用稳定、安全地运行,让 Kubernetes 能够高效地管理它们,从而避免出现问题。
详情
作者的原始描述
Create production-ready Kubernetes manifests for Deployments, Services, ConfigMaps, and Secrets following best practices and security standards. Use when generating Kubernetes YAML manifests, creating K8s resources, or implementing production-grade Kubernetes configurations.
repo: wshobson/agents
热度
- GitHub 星标
- 41k
- 排名
- #6718
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …