File contents Kubernetes 部署
目录
概述
掌握 Kubernetes 部署以大规模管理容器化应用,包括多容器服务、资源分配、健康检查和滚动部署策略。
何时使用
容器编排和管理
多环境部署(开发、预发布、生产)
自动扩缩微服务
滚动更新和蓝绿部署
服务发现和负载均衡
资源配额和限制管理
Pod 网络和安全策略
快速入门
最小工作示例:
# kubernetes-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: api-service
namespace: production
labels:
app: api-service
version: v1
spec:
replicas: 3
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector:
matchLabels:
app: api-service
template:
metadata:
labels:
app: api-service
version: v1
annotations:
// ...(完整实现请参考指南)
参考指南
详细实现在 references/ 目录中:
指南
内容
资源管理的完整部署
包含资源管理的完整部署
部署脚本
部署脚本
服务帐户和 RBAC
服务帐户和 RBAC
最佳实践
✅ 应该做
使用资源请求和限制
实施健康检查(存活探针、就绪探针)
使用 ConfigMaps 进行配置
应用安全上下文限制
使用服务帐户和 RBAC
实现 Pod 反亲和性
使用命名空间进行隔离
启用 Pod 安全策略
❌ 不应该做
在生产中使用 latest 镜像标签
以 root 身份运行容器
设置无限制的资源使用
跳过错落探针
部署无资源限制的应用
在容器镜像中混合配置
使用默认服务帐户
1 --- 2 name: kubernetes-deployment 3 description: Kubernetes 部署 4 --- 5 6 # Kubernetes 部署 7 8 ## 目录 9 10 - [概述](#概述) 11 - [何时使用](#何时使用) 12 - [快速启动](#快速启动) 13 - [参考指南](#参考指南) 14 - [最佳实践](#最佳实践) 15 16 ## 概述 17 18 掌握 Kubernetes 部署以大规模管理容器化应用,包括多容器服务、资源分配、健康检查和滚动部署策略。 19 20 ## 何时使用 21 22 - 容器编排和管理 23 - 多环境部署(开发、预发布、生产) 24 - 自动扩缩微服务 25 - 滚动更新和蓝绿部署 26 - 服务发现和负载均衡 27 - 资源配额和限制管理 28 - Pod 网络和安全策略 29 30 ## 快速入门 31 32 最小工作示例: 33 34 ```yaml 35 # kubernetes-deployment.yaml 36 apiVersion: apps/v1 37 kind: Deployment 38 metadata: 39 name: api-service 40 namespace: production 41 labels: 42 app: api-service 43 version: v1 44 spec: 45 replicas: 3 46 strategy: 47 type: RollingUpdate 48 rollingUpdate: 49 maxSurge: 1 50 maxUnavailable: 0 51 selector: 52 matchLabels: 53 app: api-service 54 template: 55 metadata: 56 labels: 57 app: api-service 58 version: v1 59 annotations: 60 // ...(完整实现请参考指南) 61 ``` 62 63 ## 参考指南 64 65 详细实现在 `references/` 目录中: 66 67 | 指南 | 内容 | 68 |---|---| 69 | [资源管理的完整部署](references/complete-deployment-with-resource-management.md) | 包含资源管理的完整部署 | 70 | [部署脚本](references/deployment-script.md) | 部署脚本 | 71 | [服务帐户和 RBAC](references/service-account-and-rbac.md) | 服务帐户和 RBAC | 72 73 ## 最佳实践 74 75 ### ✅ 应该做 76 77 - 使用资源请求和限制 78 - 实施健康检查(存活探针、就绪探针) 79 - 使用 ConfigMaps 进行配置 80 - 应用安全上下文限制 81 - 使用服务帐户和 RBAC 82 - 实现 Pod 反亲和性 83 - 使用命名空间进行隔离 84 - 启用 Pod 安全策略 85 86 ### ❌ 不应该做 87 88 - 在生产中使用 latest 镜像标签 89 - 以 root 身份运行容器 90 - 设置无限制的资源使用 91 - 跳过错落探针 92 - 部署无资源限制的应用 93 - 在容器镜像中混合配置 94 - 使用默认服务帐户
lza6/claude-code-cli-config/tree/main/skills/kubernetes-deployment commit d6229054c3
Frequently asked questions How do I install the Kubernetes Deployment skill? Run npx skillmds@latest add lza6/kubernetes-deployment in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
What does the Kubernetes Deployment skill do? Kubernetes 部署 It is listed under DevOps & Infra on SkillMD.
Is Kubernetes Deployment safe to use? This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
Which AI agents work with Kubernetes Deployment? This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Is Kubernetes Deployment free to use? Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Who published Kubernetes Deployment? lza6 (@lza6) published this skill. Their other Agent Skills are listed on their SkillMD profile.