为了账号安全,请及时绑定邮箱和手机立即绑定

部署 k8s 1.12.1 的坑和解决方法

标签:
Kubernetes

k8s 1.12.1 的坑和解决

pull 镜像:

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

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.confexport 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



作者:汀三丁
链接:https://www.jianshu.com/p/04f61c94a87d


点击查看更多内容
TA 点赞

若觉得本文不错,就分享一下吧!

评论

作者其他优质文章

正在加载中
JAVA开发工程师
手记
粉丝
50
获赞与收藏
175

关注作者,订阅最新文章

阅读免费教程

  • 推荐
  • 评论
  • 收藏
  • 共同学习,写下你的评论
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
意见反馈 帮助中心 APP下载
官方微信

举报

0/150
提交
取消