
Kubernetes
- 275 installs
- 63 repo stars
- Updated July 18, 2026
- bobmatnyc/claude-mpm-skills
Deploy, scale, and operate containerized apps on Kubernetes with manifests, services, ingress, health checks, and rollout practices.
About
Provides Kubernetes operations knowledge for running production workloads: deployments, services, ingress, config maps, secrets, probes, scaling, rollouts, and troubleshooting for SaaS APIs and containerized services.
- Deployment manifests
- Service and ingress setup
- Health probes and rollouts
- Resource limits and scaling
- Cluster troubleshooting
Kubernetes by the numbers
- 275 all-time installs (skills.sh)
- Ranked #349 of 1,435 DevOps & CI/CD skills by installs in the Skillselion catalog
- Data as of Aug 1, 2026 (Skillselion catalog sync)
npx skills add https://github.com/bobmatnyc/claude-mpm-skills --skill kubernetesAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 275 |
|---|---|
| repo stars | ★ 63 |
| Last updated | July 18, 2026 |
| Repository | bobmatnyc/claude-mpm-skills ↗ |
What it does
Deploy, scale, and operate containerized apps on Kubernetes with manifests, services, ingress, health checks, and rollout practices.
Files
Kubernetes
Quick Start (kubectl)
kubectl describe pod/<pod> -n <ns>
kubectl get events -n <ns> --sort-by=.lastTimestamp | tail -n 30
kubectl logs pod/<pod> -n <ns> --previous --tail=200Production Minimums
- Health:
readinessProbeandstartupProbefor safe rollouts - Resources: set
requests/limitsto prevent noisy-neighbor failures - Security: run as non-root and grant least privilege
Load Next (References)
references/core-objects.md— choose the right workload/controller and service typereferences/rollouts-and-probes.md— probes, rollouts, graceful shutdown, rollbackreferences/debugging-runbook.md— common failure modes and a fast triage flowreferences/security-hardening.md— pod security, RBAC, network policy, supply chain
{
"name": "kubernetes",
"version": "1.0.0",
"category": "universal",
"toolchain": null,
"tags": [
"kubernetes",
"k8s",
"infrastructure",
"deployment",
"operations",
"reliability",
"debugging",
"security"
],
"entry_point_tokens": 150,
"full_tokens": 2470,
"related_skills": [
"docker",
"github-actions",
"systematic-debugging",
"verification-before-completion",
"security-scanning"
],
"author": "Claude MPM Team",
"license": "MIT",
"subcategory": "infrastructure",
"description": "Kubernetes operations playbook for deploying and running services: core objects, probes, resource sizing, safe rollouts, and fast kubectl debugging",
"self_contained": true,
"requires": [],
"repository": "https://github.com/bobmatnyc/claude-mpm-skills",
"created": "2025-12-17",
"updated": "2025-12-17",
"notes": [
"Progressive disclosure: entry-point SKILL.md + reference runbooks and hardening guides",
"Vendor-neutral Kubernetes patterns with kubectl-first diagnostics"
]
}
Kubernetes Core Objects (Cheat Sheet)
Mental Model
- Control plane stores desired state; controllers reconcile actual state toward it.
- Pods are ephemeral; prefer controllers (Deployment/StatefulSet/DaemonSet/Job).
- Selectors bind things together (Service → Pods, Deployment → ReplicaSet → Pods).
Workload Controllers
| Controller | Use When | Notes |
|---|---|---|
| Deployment | Stateless services | Rolling updates, easy rollback |
| StatefulSet | Stateful workloads | Stable identity + per-replica PVCs |
| DaemonSet | One Pod per node | Agents, log collectors, CNI addons |
| Job / CronJob | Batch and scheduled work | Retries, backoff, completions |
Networking
Service types
ClusterIP: internal service discovery (default)NodePort: exposes a port on every node (often avoided in production)LoadBalancer: cloud LB integration (when available)- Ingress: HTTP routing (path/host TLS termination) to Services
Selector sanity check
kubectl get svc/<svc> -n <ns>
kubectl get endpoints/<svc> -n <ns> -o wide
kubectl get pods -n <ns> -l app=<label>If endpoints is empty, check:
- Service selector matches Pod labels
- Pods pass readiness checks (not ready ⇒ not in endpoints)
Configuration
ConfigMap: non-secret configuration (mounted files or env vars)Secret: sensitive configuration (protect etcd + RBAC; treat cluster access as secret access)
Prefer mounted files for large configs; prefer env vars for small values.
Scheduling and Scaling
- Resources: set
requestsandlimitsfor CPU/memory - Placement:
nodeSelector,affinity,taints/tolerations - Autoscaling: HPA based on CPU/memory/custom metrics (avoid scaling on high-cardinality metrics)
Minimal Deployment Template
apiVersion: apps/v1
kind: Deployment
metadata:
name: app
spec:
replicas: 2
selector:
matchLabels:
app: app
template:
metadata:
labels:
app: app
spec:
containers:
- name: app
image: example/app:1.2.3
ports:
- containerPort: 8080Labels (Recommended)
Use the standard label keys to keep tooling compatible:
app.kubernetes.io/nameapp.kubernetes.io/instanceapp.kubernetes.io/versionapp.kubernetes.io/componentapp.kubernetes.io/part-ofapp.kubernetes.io/managed-by
Kubernetes Debugging Runbook
Triage Flow (Fast)
1) Identify what is failing (Pod, Service routing, Ingress, dependency, node capacity). 2) Inspect events and current state before changing manifests. 3) Verify labels/selectors and readiness gating.
Snapshot the state
kubectl get deploy,rs,po,svc,ing -n <ns> -o wide
kubectl get events -n <ns> --sort-by=.lastTimestamp | tail -n 50Drill into a single Pod
kubectl describe pod/<pod> -n <ns>
kubectl logs pod/<pod> -n <ns> --tail=200
kubectl logs pod/<pod> -n <ns> --previous --tail=200
kubectl exec -it pod/<pod> -n <ns> -- shCommon Failure Modes
Pending
Signals:
kubectl describe podshows scheduling errors.
Likely causes:
- Insufficient CPU/memory on nodes
- Node selectors/affinity too strict
- Missing tolerations for taints
- PVC not bound
Next actions:
- Inspect
Events:indescribe - Check cluster capacity:
kubectl top nodes(if metrics-server exists) - Validate PVC:
kubectl get pvc -n <ns>
ImagePullBackOff / ErrImagePull
Likely causes:
- Wrong image name/tag
- Registry auth missing (
imagePullSecrets) - Rate limits or network egress blocked
Next actions:
- Check events for registry error details
- Confirm pull secret exists and is referenced in the Pod spec
CrashLoopBackOff
Likely causes:
- App exits on startup (config/secrets/migrations)
- Liveness probe too aggressive
- OOM kills or file permission issues
Next actions:
- Read
--previouslogs first - Check container exit code and
Reason:indescribe - Look for
OOMKilledand memory limits
Service returns 503/504
Likely causes:
- No ready endpoints (readiness failing)
- Service selector mismatch
- Ingress routes to wrong Service/port
Next actions:
- Verify endpoints:
kubectl get endpoints/<svc> -n <ns> -o wide
kubectl get pods -n <ns> -l app=<label> -o wideIngress not routing
Likely causes:
- Ingress controller missing or misconfigured
- TLS secret missing/invalid
- Path/host rules mismatch
Next actions:
- Inspect Ingress events and controller logs
- Validate DNS/host rule and backend Service port mapping
Debugging Without Changing the Image
If the image lacks tooling, use ephemeral containers (requires cluster support):
kubectl debug -it pod/<pod> -n <ns> --image=busybox:1.36 --target=<container-name>Use this for DNS checks, curl, and filesystem inspection without rebuilding.
Rollouts, Probes, and Graceful Shutdown
Health Probes
Readiness
- Gate traffic.
- Fail readiness when dependencies are unavailable (DB down, migrations running) if serving requests would fail.
Liveness
- Restart stuck/crashed processes.
- Avoid liveness probes that depend on external services; prefer process health only.
Startup
- Prevent liveness/readiness from failing during slow boot.
Minimal Probe Example
containers:
- name: app
image: example/app:1.2.3
ports:
- containerPort: 8080
startupProbe:
httpGet: { path: /healthz, port: 8080 }
failureThreshold: 30
periodSeconds: 2
readinessProbe:
httpGet: { path: /readyz, port: 8080 }
periodSeconds: 5
timeoutSeconds: 2
livenessProbe:
httpGet: { path: /healthz, port: 8080 }
periodSeconds: 10
timeoutSeconds: 2Rolling Updates
Prefer RollingUpdate for stateless services.
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 1Rollout Commands
kubectl rollout status deploy/<name> -n <ns>
kubectl rollout history deploy/<name> -n <ns>
kubectl rollout undo deploy/<name> -n <ns>Graceful Shutdown
Kubernetes sends SIGTERM and waits terminationGracePeriodSeconds.
Checklist:
- Handle
SIGTERMin the app (stop accepting new work, drain connections, flush buffers). - Keep readiness failing during shutdown so traffic drains.
- Use
preStoponly when an explicit delay is required (prefer app-level drains).
terminationGracePeriodSeconds: 30
containers:
- name: app
lifecycle:
preStop:
exec:
command: ["sh", "-c", "sleep 5"]Disruption and Availability
Use a Pod Disruption Budget (PDB) to keep at least N replicas available during voluntary disruptions:
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: app
spec:
minAvailable: 1
selector:
matchLabels:
app: appKubernetes Security Hardening
Pod Security (Baseline)
Prefer restrictive defaults:
- Run as non-root
- Drop Linux capabilities
- Use a read-only root filesystem where possible
- Set a seccomp profile
securityContext:
runAsNonRoot: true
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
seccompProfile:
type: RuntimeDefaultRBAC (Least Privilege)
Checklist:
- Grant namespace-scoped roles where possible.
- Avoid
cluster-adminand broad wildcard rules. - Separate “read” roles from “write” roles.
Network Policy (Default Deny)
If the CNI supports NetworkPolicy, adopt a default-deny stance and allow only required traffic between namespaces and workloads.
Key patterns:
- Allow ingress only from the ingress controller namespace.
- Allow egress only to required dependencies (DB/cache) and DNS.
Secrets Handling
Assume the cluster can read Secrets; treat cluster access as secret access.
Checklist:
- Restrict Secrets with RBAC and namespace boundaries
- Prefer external secret managers (external-secrets, CSI drivers) for high-value secrets
- Avoid logging environment values and full config dumps
Supply Chain
Checklist:
- Pin images by digest for critical workloads (
image@sha256:...) - Scan images in CI and block known critical CVEs
- Use minimal base images and drop unused packages