CentOS 7 Kubernetes Setup Error
按照以下链接中的步骤
http://kubernetes.io/docs/getting-started-guides/centos/centos_manual_config/
走到
Start the appropriate services on node (centos-minion-n). for SERVICES in kube-proxy kubelet flanneld docker; do systemctl restart $SERVICES systemctl enable $SERVICES systemctl status $SERVICES done
时候报错如下:
systemd[1]: Dependency failed for Kubernetes Kubelet Server. -- Subject: Unit kubelet.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit kubelet.service has failed.
使用以下命令查看具体错误信息:
systemctl status docker -l
错误信息:
Error initializing network controller: Error creating default \"bridge\" network: cannot create network docker0 (3957ed36665a4b84d522807cc1e4f65c8d7e06ad9e4ce9e993b7bfafc6baa489): conflicts with network d7f59ab014ac2171210c0af56b74d7646a95f2090bf559a02290c0694ac094d5 (docker0): networks have same bridge name"
原因:
网络冲突。
解决方法:
删除原有的网络,并重新启动kubernetes相关服务:
rm -rf /var/lib/docker/network for SERVICES in kube-proxy kubelet flanneld docker; do systemctl restart $SERVICES systemctl enable $SERVICES systemctl status $SERVICES done
继续下面的配置,并在master机器使用以下命令查看集群状态:
kubectl get nodes