上周左右,我一直在尝试使用本指南在OpenStack中设置一个Kubernetes集群。我在这个过程中遇到了一些问题,其中一个问题在这个问题中描述了->kube-up.sh在OpenStack 中失败
在发出./cluster/kube-up.sh
脚本时,它会尝试使用openstack堆栈创建步骤(Log)来启动集群。在这里,由于某种原因,kubernetes master没有正确出现,这里是安装失败的地方。我能够SSH到主节点,并在/var/log/cloud-init-output.log
中发现了这一点
[..]
Complete!
* INFO: Running install_centos_stable_post()
* INFO: Running install_centos_check_services()
* INFO: Running install_centos_restart_daemons()
* INFO: Running daemons_running()
* INFO: Salt installed!
2017-01-02 12:57:31,574 - cc_scripts_user.py[WARNING]: Failed to run module scripts-user (scripts in /var/lib/cloud/instance/scripts)
2017-01-02 12:57:31,576 - util.py[WARNING]: Running scripts-user (<module 'cloudinit.config.cc_scripts_user' from '/usr/lib/python2.7/site-packages/cloudinit/config/cc_scripts_user.pyc'>) failed
Cloud-init v. 0.7.5 finished at Mon, 02 Jan 2017 12:57:31 +0000. Datasource DataSourceOpenStack [net,ver=2]. Up 211.20 seconds
在进一步挖掘时,我在/var/log/messages文件->中发现了这个片段https://paste.ubuntu.com/23733430/
所以我假设Docker守护进程没有启动。此外,我的etcd配置也出现了问题,因此法兰绒服务也没有启动。这是service flanneld status
的输出
● flanneld.service - Flanneld overlay address etcd agent
Loaded: loaded (/usr/lib/systemd/system/flanneld.service; enabled; vendor preset: disabled)
Active: activating (start) since Tue 2017-01-03 13:32:37 UTC; 48s ago
Main PID: 15666 (flanneld)
CGroup: /system.slice/flanneld.service
└─15666 /usr/bin/flanneld -etcd-endpoints= -etcd-prefix= -iface=eth0 --ip-masq
Jan 03 13:33:16 kubernetesstack-master flanneld[15666]: E0103 13:33:16.229827 15666 network.go:53] Failed to retrieve network config: client: etcd cluster is unavailable or misconfigured
Jan 03 13:33:17 kubernetesstack-master flanneld[15666]: E0103 13:33:17.230082 15666 network.go:53] Failed to retrieve network config: client: etcd cluster is unavailable or misconfigured
Jan 03 13:33:18 kubernetesstack-master flanneld[15666]: E0103 13:33:18.230326 15666 network.go:53] Failed to retrieve network config: client: etcd cluster is unavailable or misconfigured
Jan 03 13:33:19 kubernetesstack-master flanneld[15666]: E0103 13:33:19.230560 15666 network.go:53] Failed to retrieve network config: client: etcd cluster is unavailable or misconfigured
Jan 03 13:33:20 kubernetesstack-master flanneld[15666]: E0103 13:33:20.230822 15666 network.go:53] Failed to retrieve network config: client: etcd cluster is unavailable or misconfigured
Jan 03 13:33:21 kubernetesstack-master flanneld[15666]: E0103 13:33:21.231325 15666 network.go:53] Failed to retrieve network config: client: etcd cluster is unavailable or misconfigured
Jan 03 13:33:22 kubernetesstack-master flanneld[15666]: E0103 13:33:22.231581 15666 network.go:53] Failed to retrieve network config: client: etcd cluster is unavailable or misconfigured
Jan 03 13:33:23 kubernetesstack-master flanneld[15666]: E0103 13:33:23.232140 15666 network.go:53] Failed to retrieve network config: client: etcd cluster is unavailable or misconfigured
Jan 03 13:33:24 kubernetesstack-master flanneld[15666]: E0103 13:33:24.234041 15666 network.go:53] Failed to retrieve network config: client: etcd cluster is unavailable or misconfigured
Jan 03 13:33:25 kubernetesstack-master flanneld[15666]: E0103 13:33:25.234277 15666 network.go:53] Failed to retrieve network config: client: etcd cluster is unavailable or misconfigured
我的etcd守护进程正在运行:
[root@kubernetesstack-master salt]# netstat -tanlp | grep etcd
tcp 0 0 192.168.173.3:4379 0.0.0.0:* LISTEN 20338/etcd
tcp 0 0 192.168.173.3:4380 0.0.0.0:* LISTEN 20338/etcd
尽管它在非标准端口上运行。
我也在一个代理下的公司网络中。任何关于如何进一步调试的建议都将受到赞赏。到目前为止,我对如何进行这项工作已经走到了死胡同。在kubernetes松弛的渠道询问也产生了零结果!
/usr/bin/flanneld -etcd-endpoints=
假设你在发布输出之前没有删除输出,那么这一行就是你的麻烦来源。在非标准端口上运行etcd会让你的情况变得更糟,但谢天谢地,我认为这两个问题的解决方案实际上是相同的。
我希望运行systemctl cat flanneld.service
(根据系统设置的严格程度,您可能需要sudo
)来输出flanneld
的统一系统描述符,包括任何"插入"、覆盖等。如果我的理论正确,其中一个将是Environment=
或EnvironmentFile=
,这就是我打赌flanneld.service
希望ETCD_ENDPOINTS=
或FLANNELD_ETCD_ENDPOINTS=
(如图所示)可用于Exec
的地方。
因此,希望该文件要么缺失,要么实际上是空白的,在任何一种情况下,你都只需要一个快速的vi
,就可以教法兰绒关于你的etcd端点的知识,让世界上的一切都恢复正常。