Pcornel
Automation · Kubernetes Automation

Kubernetes Automation Troubleshooting

Cheat sheet · https://pcornel.dk/topic.php?topic=5804

Back to the Topic

Answer

Troubleshoot Kubernetes automation with kubectl get events, describe and logs, kubectl diff and --dry-run=server for manifests, RBAC checks with kubectl auth can-i, and Helm or GitOps controller status.

Remember

  • Events explain most failures.
  • kubectl diff and server-side dry run catch errors early.
  • RBAC denials look like failures.

First checks

  • kubectl describe <obj> — events
  • kubectl get events -n <ns> --sort-by=.lastTimestamp — recent events
  • kubectl logs <pod> --previous — crashed container logs

Commands

kubectl apply
kubectl describe

Verify in this order

manifest → API admission → scheduling → container → events

Where it usually breaks

Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5804

Confirmation

Confirm action

Continue?