Search code examples
kuberneteskubectl

Kubernetes describe pod - Error from server (NotFound)


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


Solution

  • 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 resources in kubernetes are namespaced, so will require the -n <namespace> argument unless you switch namespaces.