kubectl get pods: No resources found.

问题重现

[root@ltd kub]# kubectl create -f mysql-rc.yaml 
replicationcontroller "mysql" created
[root@ltd kub]# kubectl get rc
NAME      DESIRED   CURRENT   READY     AGE
mysql     1         0         0         4s
[root@ltd kub]# kubectl get pods
No resources found.

解决办法:

[root@ltd tomcat]# vi /etc/kubernetes/apiserver

……
KUBE_ADMISSION_CONTROL="--admission-control=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota"

#去掉ServiceAccount,保存

再看:

[root@ltd ~]# kubectl get pods
NAME          READY     STATUS    RESTARTS   AGE
mysql-36gjv   1/1       Running   0          10s

问题解决。

你可能感兴趣的:(问题集合)