k8s 1.12.1 的坑和解决方法

k8s 1.12.1 的坑和解决方法

pull 镜像:

gcr.io 被墙,需要 pull 自己的镜像,然后改 tag。具体需要 pull 哪些镜像呢,kubeadm config images 可查看
我自己 build 的都放到了 https://github.com/FingerLiu/... , 需要的话也可以直接用里面的脚本:


wget -O - https://raw.githubusercontent.com/FingerLiu/k8s.gcr.io/master/pull.sh | bash

提示没权限:

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值