k8s 1.12.1 的坑和解決

k8s 1.12.1 的坑和解決

pull 鏡像:

gcr.io 被牆,需要 pull 自己的鏡像,然後改 tag。具體需要 pull 哪些鏡像呢,kubeadm config images 可查看

提示沒權限:

kubeadm reset 重複安裝的時候,.kube 文件夾不會清空,但 key 已經重新生成了,所有會key secret 不匹配。解決辦法是清空 .kube 目錄,然後將 /etc/kubernetes/kube-admin.json 拷貝過來

coredns

pending,network not ready:安裝對應版本的 flannel。kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

1 node(s) had taints that the pod didn't tolerate:

默認 k8s 不允許往 master 節點裝東西,強行設置下允許:kubectl taint nodes --all node-role.kubernetes.io/master-

azure xxx:

kubelet 自己的 bug, 無視

The connection to the server localhost:8080 was refused :

`sudo cp /etc/kubernetes/admin.conf $HOME/
sudo chown $(id -u):$(id -g) $HOME/admin.conf
export KUBECONFIG=$HOME/admin.conf`

helm 沒權限

That's because you don't have permission to deploy tiller, add an account for it:

kubectl create serviceaccount --namespace kube-system tiller
serviceaccount "tiller" created

kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
clusterrolebinding "tiller-cluster-rule" created

kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
deployment "tiller-deploy" patched
Then run below to check it :

helm list
helm repo update

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