.github/skills/tsh-implementing-kubernetes/SKILL.md
Kubernetes deployment patterns, Helm charts, and cluster management. Use when deploying applications to K8s, designing workload configurations, implementing scaling strategies, or managing cluster resources.
npx skillsauth add thesoftwarehouse/copilot-collections tsh-implementing-kubernetesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Check which Kubernetes tooling the project uses:
helm/ or Chart.yaml → Helm chartskustomize/ or kustomization.yaml → Kustomizek8s/ or kubernetes/ with *.yaml → Raw manifestsskaffold.yaml → Skaffold for local devargocd/ or Application resources → ArgoCD GitOpsflux-system/ or Kustomization CRD → Flux GitOpsUse context7 to look up Kubernetes API versions and syntax.
| Workload Type | Use When | |---------------|----------| | Deployment | Stateless apps, web servers, APIs | | StatefulSet | Databases, stateful apps needing stable identity | | DaemonSet | Node-level agents (logging, monitoring) | | Job | One-time tasks, batch processing | | CronJob | Scheduled recurring tasks |
resources:
requests: # Scheduler uses for placement
memory: "256Mi"
cpu: "100m"
limits: # Kubelet enforces these
memory: "512Mi"
cpu: "500m"
Rules:
| Class | Condition | Eviction Priority | |-------|-----------|-------------------| | Guaranteed | requests == limits (all containers) | Last to evict | | Burstable | requests < limits | Medium | | BestEffort | No requests or limits | First to evict |
Rule: Production workloads should be Guaranteed or Burstable, never BestEffort.
livenessProbe: # Restarts container if fails
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 15
periodSeconds: 10
failureThreshold: 3
readinessProbe: # Removes from Service if fails
httpGet:
path: /ready
port: 8080
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 3
startupProbe: # Delays liveness until startup complete
httpGet:
path: /healthz
port: 8080
failureThreshold: 30
periodSeconds: 10
Rules:
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: api-pdb
spec:
minAvailable: 2 # OR maxUnavailable: 1
selector:
matchLabels:
app: api
Rule: Always create PDB for production workloads to ensure availability during node drains.
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchLabels:
app: api
topologyKey: kubernetes.io/hostname
Rule: Spread replicas across nodes/zones for high availability.
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: api-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: api
minReplicas: 2
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
behavior:
scaleDown:
stabilizationWindowSeconds: 300 # Prevent flapping
| Scaling Type | Use When | Tool | |--------------|----------|------| | CPU-based | General compute workloads | HPA | | Memory-based | Memory-intensive apps | HPA | | Custom metrics | Queue depth, request rate | HPA + Prometheus Adapter | | Event-driven | Message queues, scheduled jobs | KEDA | | Vertical | Right-sizing requests/limits | VPA |
mychart/
├── Chart.yaml # Chart metadata
├── values.yaml # Default values
├── values-dev.yaml # Environment overrides
├── values-prod.yaml
├── templates/
│ ├── _helpers.tpl # Template helpers
│ ├── deployment.yaml
│ ├── service.yaml
│ ├── ingress.yaml
│ ├── hpa.yaml
│ ├── pdb.yaml
│ └── configmap.yaml
└── charts/ # Dependencies
# values.yaml - use structured defaults
replicaCount: 2
image:
repository: myapp
tag: "" # Override in CI, not here
pullPolicy: IfNotPresent
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "512Mi"
# Enable/disable optional components
autoscaling:
enabled: true
minReplicas: 2
maxReplicas: 10
Rules:
{{ include "mychart.fullname" . }} for resource names| Ingress Controller | Use When | |-------------------|----------| | nginx-ingress | General purpose, widely supported | | AWS ALB | AWS-native, integrated with WAF/ACM | | Traefik | Simple setup, automatic HTTPS | | Istio Gateway | Service mesh already in use |
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: api-ingress
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "true"
cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec:
ingressClassName: nginx
tls:
- hosts:
- api.example.com
secretName: api-tls
rules:
- host: api.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: api
port:
number: 80
securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
seccompProfile:
type: RuntimeDefault
containers:
- name: app
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
Rule: Always run as non-root with minimal capabilities in production.
kubectl apply --dry-run=server, helm templatelatest in prod)app, version, environment)| Don't | Do |
|-------|-----|
| Use latest image tag | Pin specific versions or SHA |
| Skip resource requests | Always set requests for scheduling |
| Single replica in production | Minimum 2 replicas with PDB |
| Run as root | Use non-root user with minimal caps |
| Missing readiness probe | Configure probes for graceful traffic |
| kubectl apply in production | GitOps with ArgoCD/Flux |
| Hardcode values in manifests | Use Helm values or Kustomize overlays |
| Ignore pod eviction | Set PDB to maintain availability |
tsh-implementing-observability - For K8s monitoring and logging setuptsh-implementing-ci-cd - For K8s deployment pipelinestsh-managing-secrets - For K8s secret management patternstsh-implementing-terraform-modules - For provisioning K8s clustersdevelopment
Custom hook and composable patterns — naming, composition, stable return shapes, lifecycle cleanup, and testing strategies. Use when writing reusable logic units (React hooks, Vue composables), refactoring logic into hooks, debugging hook behavior, or reviewing hook implementations.
testing
UI verification criteria, structure checklists, severity definitions, and tolerance rules for comparing implementations against Figma designs. Use for verifying UI matches design, understanding what to check, and determining acceptable differences.
development
Clean raw workshop or meeting transcripts from small talk, filler words, and off-topic tangents. Extract and structure business-relevant content into a standardized format with discussion topics, key decisions, action items, and open questions.
development
Discover and establish technical context before implementing any feature. Prioritize project instructions, existing codebase patterns, and external documentation in that order. Use for any task requiring understanding of project conventions, coding standards, architecture patterns, and established practices before writing code.