2016-08-19 73 views
0

我是代理服務器的後面,並繼「Kubernetes安裝與流浪& CoreOS」這裏列出的步驟:https://coreos.com/kubernetes/docs/latest/kubernetes-on-vagrant.htmlKubernetes安裝與流浪&CoreOS背後代理

敲定安裝後,當我運行

$ kubectl get nodes 

我得到錯誤。

Unable to connect to the server: Service Unavailable 

e1,c1和w1都啓動了,我可以發出$ vagrant ssh每個。

當我檢查w1時,我看到碼頭服務沒有運行,下面列出的錯誤。

---------------------------------------------------------------------------- 
-- 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" 

你還是知道這是足以讓後面的代理安裝,我需要代理設置添加到別的地方去。

謝謝你在前進, turgos

回答

1

要導出的變量只是在當前的shell會話是有效的,他們不提供給您的絨布systemd單元。

創建下面的下拉式的systemd單元目錄中,然後用systemctl daemon-reload重載守護進程,它應該絨布解決您的問題:

/etc/systemd/system/flannel.service.d/proxy.conf

[Service] 
Environment="HTTP_PROXY=http://http-proxy.xxx:8080" 
Environment="... 

一個類似的例子可在CoreOS文檔中:Customizing Docker

+0

是的,這有助於解決法蘭絨問題,我可以看到在所有3臺機器上運行的Docker e1,c1和w1。但是當我進行「$ kubectl get nodes」調用時,我仍然收到「Unable to connect to the server:Service Unavailable」回覆。是否有任何Kubernetes日誌用於診斷問題? – turgos

+0

這取決於你的API服務器是如何啓動的,也是一個systemd單元?在這種情況下,試試'journalctl -u kube-apiserver'。在容器內(rkt,Docker)?然後只需檢查該特定容器的日誌。 –

+0

如果您的kubernetes組件在rkt容器內運行(這似乎是您的設置中的情況),此文檔頁面可能會對您有所幫助:https://coreos.com/rkt/docs/latest/commands.html#logging –