You are on page 1of 1

Troubleshooting Kubernetes deployments

Read the blog article at


https://learnk8s.io/troubleshooting-deployments

START
~$ kubectl get pods ~$ kubectl describe pod <pod-name> ~$ kubectl get pods -o wide

Are you hitting Are you


Is there any Is the cluster the mounting a Is the Pod There is an issue
PENDING Pod? ? YES full? ? NO
ResourceQuota ? NO
PENDING ? NO assigned to the ? YES
with the Kubelet
limits? PersistentVolum Node
eClaim?
NO YES YES YES NO
The issue is likely
Relax the Fix the to be with
Provision a bigger There is an issue mounting volumes
ResourceQuota PersistentVolumeCl
cluster with the Scheduler
limits aim
YES

Are the Pods Is the Pod status


? NO ~$ kubectl logs <pod-name> ~$ kubectl describe pod <pod-name> RunContainerError?
RUNNING? ?
YES
Is the Pod status Is the Pod status NO
Can you see Fix the issue in the ImagePullBackOff? CrashLoopBackOff?
the logs for the ? YES
application ? NO ? NO
app? Consult
NO YES YES StackOverflow

Is the name of Did you inspect


Did the the image the logs and fix
contaner died ? NO
correct? ? NO Fix the image name
the crashing ? NO Fix crashing app
too quickly? app?
YES YES YES

~$ kubectl logs <pod-name> --previous Is the image tag Did you forget
valid? Does it the CMD
exist? ? NO Fix the tag
instruction in the ? YES Fix the Dockerfile
Dockerfile?
Are the Pods
READY? ? NO ~$ kubectl describe pod <pod-name> YES NO

Is the Pod
YES Are you pulling Configure pulling restarting
Is the images from a frequently? Fix the liveness
Readiness ? YES
Fix the Readiness
private registry? ? YES
NO images from a
Cycling between ? YES
probe
probe failing? probe private registry Running and
CrashLoopBackoff?
NO NO
NO

The issue could be


with the CRI or Unknown state
Unknown state
Kubelet

~$ kubectl port-forward <pod-name> 8080:<pod-port> Fix the app. It


should listen on
NO
Is the port 0.0.0.0. Update the
containerPort
Can you access
? NO
exposed by
container correct
?
Pods are
the app?
and listening on running
0.0.0.0?
Unknown state correctly
YES YES

~$ kubectl describe ingress <ingress-name> ~$ kubectl describe service <service-name>

NO Fix the ingress


Are the serviceName and Fix the Service
Can you see a list serviceName and servicePort Can you see a list Is the Selector selector. It has to
of Backends? ? NO servicePort ? of endpoints? ? NO matching the ? NO
match the Pod
matching the right Pod label?
Service? labels
YES YES YES YES

Does the Pod There is an issue


~$ kubectl port-forward <ingress-pod-name> 8080:<ingress-port> have an IP ? NO with the Controller
address manager
assigned?
The issue is
YES
specific to the
Can you visit the
app? ? NO Ingress controller.
Consult the docs
for your Ingress. There is an issue
YES with the Kubelet

~$ kubectl port-forward service/<service-name> 8080:<service-port>


The Ingress is
running
correctly NO Fix the Service
Can you visit the
app? ? NO Is the targetPort targetPort and the
on the Service containerPort
matching the ?
containerPort in
The issue is likely YES the Pod? The issue could be
The app should be to be with the with Kube Proxy
working. Can you YES
visit it from the ? NO infrastructure and
how the cluster is
public internet?
exposed. The Service is
YES running
correctly

END

You might also like