Why tiller connect to localhost 8080 for kubernetes api?

我只是一个虾纸丫 提交于 2021-02-19 01:20:11

问题


When use helm for kubernetes package management, after installed the helm client,

after

helm init

I can see tiller pods are running on kubernetes cluster, and then when I run helm ls, it gives an error:

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

and use kubectl logs I can see similar message like:

[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

I can see the tiller pod is running at one of the node instead of master, there is no api server running on that node, why it connects to 127.0.0.1 instead of my master ip?


回答1:


Run this before doing helm init. It worked for me.

kubectl config view --raw > ~/.kube/config



回答2:


First delete tiller deployment and stop the tiller service.By running below commands,

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

By default, helm init installs the Tiller pod into the kube-system namespace, with Tiller configured to use the default service account. Configure Tiller with cluster-admin access with the following command:

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

Then install helm server (Tiller) with the following command:

helm init


来源:https://stackoverflow.com/questions/45914420/why-tiller-connect-to-localhost-8080-for-kubernetes-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!