2016-04-25 59 views
3

我下面就kubernetes.iokubectl運行命令與連接失敗拒絕錯誤

http://kubernetes.io/docs/hellonode/

嘗試做「製作莢」部分時,我得到一個錯誤的hellonode教程。

當我運行此命令(我創建了一個替換PROJECT_ID)我得到以下幾點:

$ kubectl run hello-node --image=gcr.io/PROJECT_ID/hello-node:v1 --port=8080 

The connection to the server localhost:8080 was refused - did you specify the right host or port? 

,我收到了類似的錯誤只是打字kubectl版本:

$ kubectl version 

Client Version: version.Info{Major:"1", Minor:"2", GitVersion:"v1.2.2", GitCommit:"528f879e7d3790ea4287687ef0ab3f2a01cc2718", GitTreeState:"clean"} 
The connection to the server localhost:8080 was refused - did you specify the right host or port? 

我不知道該怎麼做,因爲除了遵循本教程的步驟外,我對kubernetes沒有任何經驗。

回答

4

我想出了這個問題。 在Create your cluster部分,我錯過了一個關鍵步驟。

我錯過的步驟是:Please ensure that you have configured kubectl to use the cluster you just created.配置的部分是如何做到這一點的鏈接:

的步驟如下:

gcloud config set project PROJECT 
gcloud config set compute/zone ZONE 
gcloud config set container/cluster CLUSTER_NAME 
gcloud container clusters get-credentials CUSTER_NAME 
+0

嗨,我有同樣的問題,但解決不了它遵循這一點。它仍然給出同樣的錯誤。與服務器localhost:8080的連接被拒絕 - 您是否指定了正確的主機或端口?這是否會有其他原因? –

相關問題