枚举问题POD及输出其问题

1.获取当前所有的命名空间
kubectl get ns
2.遍历命名空间,检查非Running状态的容器如ImagePullBackOff/ContainerCreating等,如下。
kubectl get pods -n kube-system

 [root@k8smaster ~]# kubectl get pods -n kube-system
NAME                                       READY   STATUS              RESTARTS   AGE
calico-kube-controllers-5b8b769fcd-lsjt4   1/1     Running             2          6d3h
calico-node-6l6r4                          1/1     Running             2          6d2h
calico-node-gt95n                          1/1     Running             2          6d3h
coredns-546565776c-4bn2d                   1/1     Running             2          6d3h
coredns-546565776c-cwpk7                   1/1     Running             2          6d3h
etcd-k8smaster                             1/1     Running             2          6d3h
kube-apiserver-k8smaster                   1/1     Running             3          6d3h
kube-controller-manager-k8smaster          1/1     Running             2          6d3h
kube-proxy-7s8dw                           1/1     Running             2          6d2h
kube-proxy-cbgtv                           1/1     Running             2          6d3h
kube-scheduler-k8smaster                   1/1     Running             2          6d3h
kuboard-7bb89b4cc4-bk7d4                   0/1     ContainerCreating   0          15m
metrics-server-7f96bbcc66-qjk5b            0/1     ContainerCreating   0          15m
 

3.获取问题POD的输出内容。

kubectl describe pod kuboard-7bb89b4cc4-bk7d4 --namespace=kube-system