Why tiller connect to localhost 8080 for kubernetes api?

8/28/2017

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?

-- Jakim
kubernetes
kubernetes-helm

2 Answers

12/31/2019

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

kubectl config view --raw > ~/.kube/config
-- Jose Peinado
Source: StackOverflow

11/9/2017

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
-- snehal
Source: StackOverflow