Pod nefunguje? Tady je systematický troubleshooting flowchart.
Pod Not Starting¶
kubectl describe pod
kubectl get events –sort-by=.lastTimestamp
Podívejte se na Events sekci. Nejčastější příčiny:
- ImagePullBackOff — špatný image name nebo registry credentials
- Pending — nedostatek resources, node selector/affinity
- Init:Error — init container selhal
CrashLoopBackOff¶
kubectl logs
kubectl describe pod
- Chyba v aplikaci (podívejte se do logů)
- Chybějící config/secret
- Health check selhává příliš rychle
Networking¶
kubectl run debug –rm -it –image=nicolaka/netshoot – /bin/bash
Uvnitř: curl, nslookup, traceroute, tcpdump¶
- Service nemá endpoints? → Zkontrolujte label selector
- DNS nefunguje? → nslookup svc.namespace.svc.cluster.local
- NetworkPolicy blokuje traffic?
Storage¶
kubectl get pv,pvc
- PVC Pending → StorageClass neexistuje nebo nemá provisioner
- Volume mount error → Zkontrolujte permissions
Autoscaling¶
kubectl get hpa
kubectl describe hpa
Postup¶
describe pod → events → logs → exec do podu → network debug kontejner.