57

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

SiHa
  • 7,830
  • 13
  • 34
  • 43
Kim Tang
  • 2,330
  • 2
  • 9
  • 34

2 Answers2

112

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.

SiHa
  • 7,830
  • 13
  • 34
  • 43
-1

Your correct statement to describe the pods is

 kubectl describe pod -n <namespace name>

This will list down all the description for all the pods under this namespace

Ayan
  • 411
  • 5
  • 11