本人根据github上的指引一步步安装了k8s的插件,包括1.6与1.8版本,详情见https://github.com/opsnull/follow-me-install-kubernetes-cluster;
具体的安装步骤就不提了,这儿主要提一下安装过程中遇到的坑和注意事项。
参考:
1.etcd集群安装时,注意关闭防火墙
2..kube/config需要授权
3,kubectl得在apiserver装完之后才能使用,被误导了
4.注意修改kubelet中的镜像
5.exec执行时:Error fromserver: error dialing backend: dial tcp 192.168.101.93:10250: getsockopt:connection timed out
iptables -I INPUT -p tcp -m tcp --dport10250 -j ACCEPT
6.(安装etcd集群)
etcd[12559]: request sent was ignored(cluster ID mismatch: remote[f87a4e0dc647059a]=4e2ac6101dae49a2,local=1d3352092049d79d)
删除掉配置文件/var/lib/etcd中的配置文件,因为第一次的配置和第二次不一样,系统认定为两个集群,所以连接不上
7.
证书只有ca证书是共享的,其他的证书都是各个机器自己生成的;
8.
kubelet cgroup driver: "cgroupfs"is different from docker cgroup driver: "systemd"
在kubelet.service最后一行加的--cgroup-driver=systemd
9.
podsis forbidden: User "system:node:192.168.101.96" cannot list pods atthe cluster scope
kubectl create clusterrolebindingkubelet-node-clusterbinding --clusterrole=system:node--user=system:node:192.168.101.93
10.
[Failed to start ContainerManager failed toinitialise top level QOS containers: failed to create top level Burstable QOScgroup : Unit kubepods-burstable.slice already exists.]
常见错误:https://jimmysong.io/posts/kubernetes-network-config/
11.
注意env文件中的token是一样的(各个机器)
四、安装node节点时报错:
https://www.cnblogs.com/fengjian2016/p/6689212.html?utm_source=itdadao&utm_medium=referral
有个文件也不存在--kube-config改为了/etc/kubernetes/bootstrap.kubeconfig还是不对,报新的错误
都不是前面这些错,重新执行了一遍所有命令,然后把rolebinding放到最后面就好了;
二、【可能】
http://blog.csdn.net/freewebsys/article/details/70159228;
记录:journalctl -f -u kubelet