一、etcd集群部署遇到的问题
1.etcd.serverice启动报错,显示–logger=zap有问题
解决:修改配置文件,去掉该参数,重新启动服务
2.publish error: etcdserver: request timed out,由于etcd集群没有同时启动导致
解决:在部署了etcd的节点上,同时启动etcd服务systemctl start etcd
3.error #1: dial tcp 127.0.0.1:2379: connect: connection refused,由于参数ETCD_LISTEN_CLIENT_URLS没有将172.0.0.1:2379包含在内
解决:ETCD_LISTEN_CLIENT_URLS添加https://172.0.0.1:2379或者直接改成0.0.0.0:2379
4.error #1: dial tcp 127.0.0.1:4001: connect: connection refused,由于低版本的peer的监听端口是否4001
解决:ETCD_LISTEN_CLIENT_URLS和ETCD_ADVERTISE_CLIENT_URLS参数上配置4001的监听端口
5.error #1: net/http: HTTP/1.x transport connection broken: malformed HTTP response “\x15\x03\x01\x00\x02\x02”,由于配置信息监听地址写成了http://
解决:将监听地址改成https://
二、kube-apiserver.service遇到的错误
1.error: unable to find suitable network address.error=‘no default routes found in “/proc/net/route” or “/proc/net/ipv6_route”’. Tr… to fix this,由于没有配置网关路由问题
解决:route add default gw 172.16.0.1
2.error: --etcd-servers must be specified
解决:sudo journalctl -xe -u kube-apiserver | more通过查看更多错误信息,除了error: --etcd-servers must be specified错误提示外无其他错误信息,通过手动执行system unit检查是否配置有误,手动能正常启动,说明配置文件可能存在字符错误,重新写入配置后,启动正常
3.watch chan error: etcdserver: mvcc: required revision has been compacted,由于etcd的版本问题导致的,不影响功能的使用
解决:可以安装对应版本的etcd
三、kubelet和kube-proxy部署遇到的错误
1.failed complete: v1alpha1.KubeProxyConfiguration.ClientConnection: readObjectStart: expect { or n, but found “, error found in #10 byte of …|nection”:“kubeconfig|…, bigger context …|pha1”,“bindAddress”:“0.0.0.0”,“clientConnection”:"kubeconfig:/data/kubernetes/cfg/kube-proxy.kubecon|…
解决:检查yml文件格式是否正确,yml配置文件遇到":“或者”-"后面必须留一个空格!
2.Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized,由于没有插件cni
解决:修改kubelet.conf配置文件去掉相关配置参数–network-plugin=cni,重启服务即可或者下在安装cni插件
3.在错误日志中发现:E0927 15:38:12.475997 16586 kubelet.go:1308] Image garbage collection failed once. Stats initialization may not have completed yet: failed to get imageFs info: unable to find data in memory cache
解决:yum -y upgrade systemd
4.failed to run Kubelet: Running with swap on is not supported, please disable swap! or set --fail-swap-on flag to f…
解决:node节点上没有关闭交换分区,临时关闭的swapoff -a,最好就是永久关闭