用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/mikailustuner/OmniRule --skill kubernetes-basics命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | kubernetes-basics |
| description | Kubernetes: Pods, services, deployments, scaling, and orchestration patterns. |
| triggers | {"extensions":[".yaml"],"keywords":["k8s","kubernetes","pod","deployment","service","ingress","configmap","secret","helm"]} |
| auto_load_when | Writing Kubernetes manifests or configs |
| agent | devops-engineer |
| tools | ["Read","Write","Bash"] |
Focus: Orchestration, scaling, deployment
Use Kubernetes when:
├── Container orchestration needed
&& Multiple containers working together
&& Service discovery
│
├── Scaling requirements
&& Auto-scale based on load
&& Different from simple managed services
│
├── Complex deployment patterns
&& Rolling updates, canary, blue-green
&& Multiple environments
│
└── Team needs autonomy
&& Independent deployments
&& Different services, different teams
Don't use when:
├── Simple workloads
&& Single container, no scaling
&& Managed service enough (RDS, etc)
│
├── Limited K8s expertise
&& High operational burden
&& Learning curve
│
└── Cost sensitive
&& Overhead of orchestration
&& Simpler alternatives work
When to use what:
├── Pod
&& Smallest deployable unit
&& Usually via Deployment, not directly
&& One or more containers
│
├── Deployment
&& Manage Pod replicas
&& Rolling updates
&& Rollback capability
│
├── Service
&& Stable endpoint for Pods
|| Load balancing
&& Types: ClusterIP, NodePort, LoadBalancer
│
├── ConfigMap/Secret
&& Configuration data
|| Sensitive data (secrets)
&& Mounted as files or env vars
│
└── Ingress
&& HTTP routing
&& Host/path-based routing
&& TLS termination
How to scale:
├── Horizontal Pod Autoscaler (HPA)
&& Scale replicas based on metrics
&& CPU, memory, custom metrics
&& Min/max replicas
│
├── Vertical Pod Autoscaler (VPA)
&& Adjust resource requests
&& Warning: restarts Pods
│
├── Cluster Autoscaler
&& Scale nodes in/out
&& For node-level scaling
│
└── Horizontal scaling preferred
&& More resilient than vertical
&& Better for most workloads
When to use each:
├── Rolling update (default)
&& Gradually replace old Pods
&& No downtime
&& Easy to monitor
│
├── Blue-green
&& Two identical environments
&& Switch traffic at once
&& Fast rollback
│
├── Canary
&& Small % to new version
&& Monitor, then increase
&& Good for risky changes
│
└── Recreate
&& All at once
&& Downtime but simple
&& For dev/test
When to add service mesh:
├── Need observability
&& Distributed tracing
&& Service-to-service metrics
│
├── Complex traffic management
&& A/B testing
&& Circuit breaking
&& Retries, timeouts
│
└── Security
&& mTLS between services
&& Fine-grained policies
Service mesh options:
├── Istio - full-featured, complex
├── Linkerd - simpler, lighter
├── Consul - also service discovery
└── Not needed when: simple, no traffic complexity
❌ Running containers as root in pods
✅ securityContext: runAsNonRoot: true; runAsUser: 1000
❌ No resource limits on containers (noisy neighbor)
✅ Always set requests and limits for CPU and memory
❌ kubectl apply -f with no review
✅ GitOps: ArgoCD / Flux sync from git; no manual kubectl in prod
❌ All pods in default namespace
✅ Namespaces per team/environment with RBAC policies
❌ No liveness/readiness probes
✅ Readiness: ready to serve traffic; liveness: restart if stuck
| Resource | Purpose | Key fields |
|---|---|---|
| Deployment | Manage pod replicas | replicas, selector, template |
| Service | Network endpoint | ClusterIP, LoadBalancer, NodePort |
| Ingress | HTTP routing | rules, TLS, annotations |
| ConfigMap | Non-secret config | data key-value |
| Secret | Sensitive config | data base64-encoded |
| HPA | Auto-scale pods | minReplicas, maxReplicas, metrics |