手动创建安全的 Kubernetes 清单容易出错且耗时。此技能提供了遵循云原生标准的 Deployment、Service、ConfigMap 和 Secret 模板及最佳实践。
下载技能 ZIP
在 Claude 中上传
前往 设置 → 功能 → 技能 → 上传技能
开启并开始使用
测试它
正在使用“k8s-manifest-generator”。 为 nginx Web 服务器创建基本 Deployment
预期结果:
YAML manifest,包含 Deployment resource:带有 labels 的 metadata、3 replicas 的 spec、nginx:1.25 image 的 container definition、暴露端口 80、resource requests/limits(256Mi/512Mi memory,250m/500m CPU)以及端口 80 的 HTTP health probes。
正在使用“k8s-manifest-generator”。 为应用程序设置生成 ConfigMap
预期结果:
YAML manifest,包含 ConfigMap resource:带有 app labels 的 metadata、data section 包含 APP_ENV=production、LOG_LEVEL=info、DATABASE_HOST、DATABASE_PORT,以及嵌入的 application.yaml 配置文件,包含 server、logging 和 database settings。
安全审计
安全Static analyzer detected 285 pattern matches across 7 files, but all findings are FALSE POSITIVES. This skill contains only YAML templates and Markdown documentation - no executable code. Shell scripts in ConfigMap templates are meant to be stored in Kubernetes, not executed by the skill. URLs and IPs are placeholder examples. No actual security risks exist.
质量评分
你能构建什么
DevOps 工程师部署微服务
为多个微服务生成一致、安全的 manifests,包含适当的资源限制、健康检查和安全性上下文,符合组织标准。
开发者容器化应用程序
在从 Docker Compose 迁移或本地运行应用程序时创建初始 Kubernetes manifests,提供有关探针、资源和配置的指导。
平台团队构建参考模板
为内部开发者平台生成标准化 templates,包含预配置的安全策略、监控注解和日志配置。
试试这些提示
为运行在端口 3000 的 Node.js API 创建 Kubernetes Deployment manifest,镜像为 myregistry/api:v1.2.0。包含基本资源限制和 /health 健康检查端点。
为 Python Web 应用程序生成完整的 Kubernetes manifest 集,包括:3 个 replicas 的 Deployment、ClusterIP Service、用于环境变量(DATABASE_URL、LOG_LEVEL、CACHE_TTL)的 ConfigMap、用于数据库凭证的 Secret。包含 liveness 和 readiness probes。
创建生产就绪的 Kubernetes Deployment,包括:用于高可用性的 pod anti-affinity、pod disruption budget、network policy 建议、以非 root 用户运行并 dropped capabilities 的 security context、resource quotas 以及 Prometheus monitoring annotations。应用程序是 Java Spring Boot service。
生成支持多环境(dev、staging、prod)的 ConfigMap 和 Deployment manifests,包含环境特定的副本数、资源限制、日志级别和 feature flags 值。使用 Kubernetes 配置分离最佳实践。
最佳实践
- 始终设置 resource requests 和 limits 以防止资源饥饿并确保可预测的调度
- 实现 liveness、readiness 和 startup probes 以启用 Kubernetes 健康管理
- 使用特定镜像标签而非 latest 以确保可重现的部署
避免
- 使用 :latest 镜像标签会导致不可预测的部署和回滚问题
- 在没有 security context 的情况下以 root 用户运行容器,增加权限提升风险
- 将 secrets 直接硬编码在 manifests 中而非使用 Kubernetes Secret resources