跳到正文
Skillpedia
部署与云(DevOps)41k · #6718

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/wshobson/agents/blob/main/plugins/kubernetes-operations/skills/k8s-manifest-generator/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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

  1. Always set resource requests and limits - Prevents resource starvation
  2. Implement health checks - Ensures Kubernetes can manage your application
  3. Use specific image tags - Avoid unpredictable deployments
  4. Apply security contexts - Run as non-root, drop capabilities
  5. Use ConfigMaps and Secrets - Separate config from code
  6. Label everything - Enables filtering and organization
  7. Follow naming conventions - Use standard Kubernetes labels
  8. Validate before applying - Use dry-run and validation tools
  9. Version your manifests - Keep in Git with version control
  10. 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:

  1. Store in Git repository
  2. Set up CI/CD pipeline for deployment
  3. Consider using Helm or Kustomize for templating
  4. Implement GitOps with ArgoCD or Flux
  5. Add monitoring and observability

Related Skills

  • helm-chart-scaffolding - For templating and packaging
  • gitops-workflow - For automated deployments
  • k8s-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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能