Kubernetes describe pod - Error from server (NotFound)

Kim*_*ang 14 unix docker kubernetes kubectl

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
Run Code Online (Sandbox Code Playgroud)

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

在此处输入图片说明

SiH*_*iHa 27

您尚未在 describe pod 命令中指定命名空间。

你做了kubectl get all -n minio-operator,它获取了minio-operator命名空间中的所有资源,但你kubectl describe没有命名空间,所以它在default命名空间中寻找一个不存在的 pod。

kubectl describe po -n minio-operator <pod name> 应该可以正常工作。

kubernetes 中的大多数操作都是命名空间的,因此-n <namespace>除非您切换命名空间,否则将需要该参数