8 Mart 2023 Çarşamba

Common Pods Errors - Startup errors

Giriş
Bazı hatalar şöyle
1. ImagePullBackoff
2. ImageInspectError
3. ErrImagePull
4. ErrImageNeverPull
5. RegistryUnavailable
6. InvalidImageName
Ayrıca FailedScheduling de çok yaygın

Ne Yapmak Lazım
1. kubectl describe pod $POD_NAME | less ile duruma bakılabilir
2. Eğer bir şeyi değiştirip tekrar denemek istersek şöyle yaparız
kubectl edit pod $POD_NAME
# or
kubectl edit deployment $DEPLOYMENT_NAME

# or if you just want to view the information
kubectl get deployment $DEPLOYMENT_NAME -oyaml
3. loglara bakabiliriz. Şöyle yaparız
kubectl logs $POD_NAME
kubectl logs $POD_NAME -c $CONTAINER_NAME

# or if you want to follow continuous output
kubectl logs -f $POD_NAME

# Another super useful debugging tool is the -p/--previous flag, 
# which you can use in the case that an instance keeps crashing/ 
# there was an unexpected restart.
kubectl logs -p $POD_NAME
ContainerCreating 
Açıklaması şöyle
Generally the pod will be stuck in states like ContainerCreating or if there’s an image issue you might see ImagePullBackoff , possibly indicating the image couldn’t be found or authenticated to.
ImagePullBackOff 
Açıklaması şöyle
This error means K8s is unable to pull the image for one of the containers in the Pod.

Common cause of the error could be one of the following,
1. The Image name is invalid
2. You specified non existing tag for the Image
4. The image that you are trying to pull belongs to a private registry and k8s does not have credentials to access it.

The first two cases can be solved by correcting the image name and tag.

For the last, you should add the credentials to your private registry in a Secret and reference it in your Pods.
FailedScheduling 
nodeSelector veya nodeAffinity kullanılıyorsak olabilir. 
Örnek
kubectl -n <namespace> describe pod <podname> çıktısı şöyledir
Warning FailedScheduling 118s (x26 over 7m43s) default-scheduler 0/53 nodes are available: 53 node(s) didn’t match Pod’s node affinity

Hiç yorum yok:

Yorum Gönder

Cluster Propotional Autoscaler - ReplicaSet Ekler/Siler

Giriş Açıklaması şöyle CPA aims to horizontally scale the number of Pod replicas based on the cluster’s scale. A common example is DNS ser...