2017-08-28 86 views
0

使用時掌舵kubernetes包管理,安裝後掌舵客戶端,爲什麼tiller連接到本地主機8080的kubernets api?

helm init 

我可以看到分櫱豆莢kubernetes羣集上運行,然後當我運行helm ls,它給出了一個錯誤:

Error: Get http://localhost:8080/api/v1/namespaces/kube-system/configmaps?labe 
lSelector=OWNER%3DTILLER: dial tcp 127.0.0.1:8080: getsockopt: connection 
refused 

,並使用kubectl logs我可以看到類似的消息,如:

[storage/driver] 2017/08/28 08:08:48 list: failed to list: Get 
http://localhost:8080/api/v1/namespaces/kube-system/configmaps? 
labelSelector=OWNER%3DTILLER: dial tcp 127.0.0.1:8080: getsockopt: connection 
refused 

我可以看到tiller pod運行在其中一個節點上,而不是master,沒有在該節點上運行的api服務器,爲什麼它連接到127.0.0.1而不是我的主ip?

回答

0

首先刪除分櫱部署和停止service.By運行下面的命令分櫱,

kubectl delete deployment tiller-deploy --namespace=kube-system 
kubectl delete service tiller-deploy --namespace=kube-system 
rm -rf $HOME/.helm/ 

默認情況下,掌舵初始化安裝分櫱莢到KUBE-系統命名空間,具有分櫱配置爲使用默認服務帳戶。 配置分櫱與以下命令集羣管理員訪問:

kubectl create clusterrolebinding tiller-cluster-admin \ 
    --clusterrole=cluster-admin \ 
    --serviceaccount=kube-system:default 

然後安裝舵服務器(分櫱)用下面的命令:

helm init 
相關問題