Helm error : Error: the server has asked for the client to provide credentials


#1

I have installed Rancher 2 and created a kubernetes cluster of internal vm’s ( no AWS / gcloud).

The cluster is up and running.

I logged into one of the nodes.

  1. Installed Kubectl and executed kubectl cluster-info . It listed my cluster information correctly.

  2. Installed helm

    curl https://raw.githubusercontent.com/helm/helm/master/scripts/get > get_helm.sh
    chmod 700 get_helm.sh
    ./get_helm.sh

    root@lnmymachine # helm version
    Client: &version.Version{SemVer:“v2.12.3”, GitCommit:“eecf22f77df5f65c823aacd2dbd30ae6c65f186e”, GitTreeState:“clean”}
    Server: &version.Version{SemVer:“v2.12.3”, GitCommit:“eecf22f77df5f65c823aacd2dbd30ae6c65f186e”, GitTreeState:“clean”}

  3. Configured helm referencing Rancher Helm Init

    kubectl -n kube-system create serviceaccount tiller

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

    helm init --service-account tiller

Tried installing Jenkins via helm

root@lnmymachine # helm ls
Error: Unauthorized
root@lnmymachine # helm install --name initial stable/jenkins
Error: the server has asked for the client to provide credentials

Browsed similar issues and few of them were due to multiple clusters. I have only one cluster. kubectl gives all information correctly.

Any idea whats happening.


#2

I’m running Rancher on-prem and followed the exact steps you have but have not encountered that issue (yet). The only difference I can see is that you are running Helm on one of the host nodes as root. Have you tried installing Helm on a client machine as a non-root user and connecting that way?

Also have you tried installing the chart through Ranchers Catalog interface? If you can that confirms Helm will work within the cluster.

Also why are you running the commands on the Nodes?


#3

Hi,
I found the solution. It was because of missing “=” in below command after --clusterrole. Now all working good.

kubectl create clusterrolebinding tiller  –clusterrole cluster-admin

It should be

kubectl create clusterrolebinding tiller  –clusterrole=cluster-admin

Thanks.