Kubernetes Operator
Overview
Debug Kubernetes with read-first habits. Mutating prod requires approval.
Common commands
kubectl config current-context
kubectl get pods -A
kubectl describe pod <name> -n <ns>
kubectl logs <pod> -n <ns> --tail=200
kubectl get svc,ingress -n <ns>
kubectl get events -n <ns> --sort-by=.lastTimestamp
Workflow
- Confirm context/namespace (never assume prod).
- Locate unhealthy resources (CrashLoop, Pending, ImagePull).
- Correlate describe + logs + events.
- Propose a fix; apply only with approval on shared clusters.
Rules
kubectl delete, scale-to-zero, and apply on prod →human-approval.- Prefer dry-run:
kubectl apply --dry-run=client -o yaml.