Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubernetes describe pod - Error from server (NotFound)

Tags:

I am trying to debug a pod with the status "ImagePullBackOff". The pod is in the namespace minio-operator, but when I try to to describe the pod, it is apparently not found.

Why does that happen?

[psr-admin@zon-psr-2-u001 ~]$ kubectl get all -n minio-operator NAME                                  READY    STATUS              RESTARTS    AGE pod/minio-operator-5dd99dd858-n6fdj   0/1      ImagepullBackoff    0           7d  NAME                             READY.    UP-TO-DATE   AVAILABLE   AGE deployment.apps/minio-operator   0         1            0           7d  NAME                                        DESIRED   CURRENT    READY     AGE replicaset.apps/minio-operator-5dd99dd858   1         1          0         7d [psr-admin@zon-psr-2-u001 ~]$ kubectl describe pod minio-operator-5dd99dd858-n6fdj Error from server (NotFound): pods "minio-operator-5dd99dd858-n6fdj" not found 

Error from server (NotFound): pods "minio-operator-5dd99dd858-n6fdj" not found

enter image description here

like image 461
Kim Tang Avatar asked Apr 17 '20 11:04

Kim Tang


People also ask

How do you troubleshoot a pod in pending state?

My pod stays pending If a Pod is stuck in Pending it means that it can not be scheduled onto a node. Generally this is because there are insufficient resources of one type or another that prevent scheduling. Look at the output of the kubectl describe ... command above.

How do I check my pod status in Kubernetes?

Using kubectl describe pods to check kube-system If the output from a specific pod is desired, run the command kubectl describe pod pod_name --namespace kube-system . The Status field should be "Running" - any other status will indicate issues with the environment.

How do I find logs of terminated pod?

Running kubectl logs -p will fetch logs from existing resources at API level. This means that terminated pods' logs will be unavailable using this command. As mentioned in other answers, the best way is to have your logs centralized via logging agents or directly pushing these logs into an external service.


1 Answers

You've not specified the namespace in your describe pod command.

You did kubectl get all -n minio-operator, which gets all resources in the minio-operator namespace, but your kubectl describe has no namespace, so it's looking in the default namespace for a pod that isn't there.

kubectl describe pod -n minio-operator <pod name> 

Should work OK.

Most operations in kubernetes are namespaced, so will require the -n <namespace> argument unless you switch namespaces.

like image 99
SiHa Avatar answered Sep 18 '22 11:09

SiHa