kubernetes
Kubernetes best practices — cluster management, RBAC, NetworkPolicies, workload configuration, networking, and troubleshooting. Invoke when the user asks about K8s operations, pod debugging, or cluster management.
- License 许可
- MIT
- 最近更新
- 2026-04-08
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- kubernetes
- description
- Kubernetes best practices — cluster management, RBAC, NetworkPolicies, workload configuration, networking, and troubleshooting. Invoke when the user asks about K8s operations, pod debugging, or cluster management.
03 SKILL.md 正文
Kubernetes Best Practices
Workload configuration
Pod resource management
- Always set resource requests AND limits
- Use
resources.requestsfor scheduling,resources.limitsfor throttling - Start conservative and tune based on metrics
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
Health checks
- livenessProbe — restart if unhealthy (use for deadlock detection)
- readinessProbe — remove from service if not ready (use for startup/dependency checks)
- startupProbe — delay liveness checks during startup (use for slow-starting apps)
Pod disruption budgets
- Always define PDBs for production workloads
minAvailable: 1ormaxUnavailable: 1for small deployments
Troubleshooting
Pod not starting
kubectl describe pod <name>— check Events sectionkubectl logs <name> --previous— check crash logs- Common causes: image pull errors, resource limits, missing secrets
Service not reachable
kubectl get endpoints <service>— verify endpoints existkubectl get pods -l <selector>— check pod readinesskubectl exec -it <pod> -- curl localhost:<port>/health— test from inside
OOMKilled
- Check
kubectl describe podfor last termination reason - Increase memory limits
- Profile the application for memory leaks
Security
- Use NetworkPolicies to restrict pod-to-pod traffic
- Never run containers as root — use
securityContext.runAsNonRoot: true - Use ServiceAccounts with minimal RBAC permissions
- Scan images for vulnerabilities before deploying
04 同仓库更多 Skills
vue
Use when building Vue 3 applications with Composition API, Nuxt 3, or Quasar. Invoke for Pinia, TypeScript, PWA, Capacitor mobile apps, Vite configuration.
update
暂无简介
uninstall
暂无简介
typescript
Use when working with TypeScript's advanced type system — generics, conditional types, mapped types, or full-stack type safety. Assumes ES2023+ JavaScript knowledge (see javascript for fundamentals). Invoke for type guards, utility types, tRPC integration, monorepo setup.
testing
Use when writing tests, creating test strategies, or building automation frameworks. Invoke for unit tests, integration tests, E2E, coverage analysis, performance testing, security testing.
terraform
Use when working with Terraform or OpenTofu — creating modules, writing tests, setting up CI/CD pipelines, reviewing configurations, debugging state issues, implementing security scanning, or making IaC architecture decisions. For Pulumi see pulumi-best-practices, for general CI/CD see devops.