解決kubectl get pods時 No resources found.問題

環境:CentOS Linux release 7.2.1511 (Core)

使用yum 直接安裝

yum install -y etcd kubernetes

啓動

systemctl start etcd
systemctl start docker
systemctl start kube-apiserver
systemctl start kube-controller-manager
systemctl start kube-scheduler
systemctl start kubelet
systemctl start kube-proxy

創建mysql.rc.yaml

執行kubectl create -f mysql.yaml  執行成功。

執行kubectl get rc    反饋正常

執行kubectl get pods .顯示 : No resources found

========================解決辦法==============================

1.vim /etc/kubernetes/apiserver

2.找到這
”KUBE_ADMISSION_CONTROL="--admission_control=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota"
去掉ServiceAccount,保存退出。

3.systemctl restart kube-apiserver  重啓此服務

再次執行kubectl get pods 顯示正常

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章