我在一个代理服务器后面,遵循下面列出的"Kubernetes Installation with Vagrant & CoreOS“步骤:https://coreos.com/kubernetes/docs/latest/kubernetes-on-vagrant.html
在完成安装后,当我运行
$ kubectl get nodes我得到了错误。
Unable to connect to the server: Service Unavailablee1、c1和w1已经启动,我可以分别发出$vagrant ssh命令。
当我检查w1时,我看到docker服务没有运行,错误列在下面。
----------------------------------------------------------------------------
-- Unit docker.service has failed.
--
-- The result is dependency.
Aug 19 04:09:25 w1 systemd[1]: docker.service: Job docker.service/start failed with result 'dependency'.
Aug 19 04:09:25 w1 systemd[1]: flanneld.service: Unit entered failed state.
Aug 19 04:09:25 w1 systemd[1]: flanneld.service: Failed with result 'exit-code'.
Aug 19 04:09:30 w1 systemd[1]: flanneld.service: Service hold-off time over, scheduling restart.
Aug 19 04:09:30 w1 systemd[1]: Stopped Network fabric for containers.
-- Subject: Unit flanneld.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit flanneld.service has finished shutting down.
Aug 19 04:09:30 w1 systemd[1]: Starting Network fabric for containers...
-- Subject: Unit flanneld.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit flanneld.service has begun starting up.
Aug 19 04:09:30 w1 rkt[6888]: image: using image from file /usr/lib/rkt/stage1-images/stage1-fly.aci
Aug 19 04:09:31 w1 rkt[6888]: image: searching for app image quay.io/coreos/flannel
Aug 19 04:09:31 w1 rkt[6888]: run: discovery failed
Aug 19 04:09:31 w1 systemd[1]: flanneld.service: Main process exited, code=exited, status=1/FAILURE
Aug 19 04:09:31 w1 systemd[1]: Failed to start Network fabric for containers.
-- Subject: Unit flanneld.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit flanneld.service has failed.
--
-- The result is failed.
Aug 19 04:09:31 w1 systemd[1]: flanneld.service: Unit entered failed state.
Aug 19 04:09:31 w1 systemd[1]: flanneld.service: Failed with result 'exit-code'.
----------------------------------------------------------------------------我猜这个问题是因为我在代理后面。在运行安装步骤之前,我发出以下命令
$export "HTTP_PROXY=http://http-proxy.xxxxxx.com:8080"
$export "HTTPS_PROXY=http://http-proxy.xxxxxx.com:8080"
$export "http_proxy=http://http-proxy.xxxxxx.com:8080"
$export "https_proxy=http://http-proxy.xxxxxx.com:8080"您是否知道这对于proxy后面的安装是否足够,或者我是否需要将proxy设置添加到其他位置。
提前谢谢你,大个子
发布于 2016-08-20 15:55:37
您要导出的变量仅在当前shell会话中有效,它们对您的法兰绒systemd单元不可用。
在systemd单元目录中创建以下插件,然后使用systemctl daemon-reload重新加载守护进程,它应该会用flannel修复您的问题:
/etc/systemd/system/flannel.service.d/proxy.conf
[Service]
Environment="HTTP_PROXY=http://http-proxy.xxx:8080"
Environment="...在CoreOS文档中提供了一个类似的示例:Customizing Docker
https://stackoverflow.com/questions/39044885
复制相似问题