K8S排错指南
2022-10-01 23:56:19 0 举报
K8S排错指南 kubernetes排错指南
作者其他创作
大纲/内容
Is the Pod statusCrashLoopBackOff?
Relax the ResourceQuots limits
yes
Unknown state
no
Fix the issue inthe application
kubectl logs <pod-name> --previsous
kubectl get pods -o wide
Fix the Service targetPort and the containerPort
kubectl describe pod <pod-name>
Fix the crashing app
START
Is the image tag valid?Dose it exits?
Fix the Service selector.It has to match the Pod labels
The issue is with the node-lifecycle container
kubectl describe ingress <ingress-name>
Are you hitting the ResourceQuotslimits?
Is the Pod restarting frequently?Cycling between Runing and CrashingLoopBackOff?
kubectl describe service <service-name>
The issue is specific to the Ingress controller.Consult the docs for youe ingress
Is the name of the image currect?
Fix the liveness probe
The app should be working.Can you visit it from the public internet?
kubectl port-forward <pod-name> 8080:<pod-port>
kubectl port-forward service/<service-name> 8080:<service-port>
There is an issue with the KUBELET
Is the targetPort on the Service matching the containerPort in the Pod?
Is the cluster full?
Are you pulling images from a privite registry?
Can you visit the app?
Fix the image tag
END
Fix the app. It should listen on 0.0.0.0. Update the containerPort
Fix the image name
Is the port exposed by container correct and listening on 0.0.0.0?
The issue is likely to be mounting volumes
Is the Pod statusImagePullBackOff?
Dose the Pod have an IP address assigned?
Can you accessthe app?
The issue could be with KUBEPROXY
There is an issue with the Scheduler
Did you inspect the logs and fix the craashing app?
The issue is likely to be with the infrastructure and how the cluster is exposed.
Provision a bigger cluster
The issue could be with the CRI or KUBELET
The Ingress is running correctly
Did the contianer died too quickly?
kubectl port-forward <ingress-pod-name> 8080:<ingress-port>
Are the Pods RUNNNING?
Consult StackOverflow
Are you mounting aPENDINGPersistentVolumeClaim?
Is the readiness probe failing?
Pods are running correctly
Is the Selector matching the right Pod label?
Is there any PENDING pod?
Configure pulling images from a privite registry
Fix the Dockerfile
Are the serviceName and servicePort matching the Service?
Fix the ingress serviceName and servicePort
Fix the Readiness probe
The Service is running correctly
kubectl get pods
There is an issuewith the kubelet
Are the Pods READY?
Is there any container Running?
Is the Pod assignedto the Node?
There is an issue with the Controller manager
Fix the PersistentVolumeClaim
Can you see thelogs for the app?
Is the Pod statusRunContainerError?
Did you forget the CMD instruction in the Dockerfile?
kubectl describe pod <pod-name>
Can you see a list of endpoints?
kubectl logs <pod-name>
Can you see a list of backends?
收藏
收藏
0 条评论
下一页