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

Hello All,

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.

Running the script only installs the client, in your output it shows a running server component (tiller), guessing it wasn’t installed with RBAC properly before. And the install steps from Rancher Helm Init will just say it’s already installed. Both errors indicate issues with auth, can you supply exact steps and outputs or retry using https://rancher.com/docs/rancher/v2.x/en/installation/ha/helm-init/troubleshooting/#helm-commands-show-forbidden

# bash helm.sh
Downloading https://kubernetes-helm.storage.googleapis.com/helm-v2.12.3-linux-amd64.tar.gz
Preparing to install helm and tiller into /usr/local/bin
helm installed into /usr/local/bin/helm
tiller installed into /usr/local/bin/tiller
Run 'helm init' to configure helm.
# helm version
Client: &version.Version{SemVer:"v2.12.3", GitCommit:"eecf22f77df5f65c823aacd2dbd30ae6c65f186e", GitTreeState:"clean"}
Error: Get http://localhost:8080/api/v1/namespaces/kube-system/pods?labelSelector=app%3Dhelm%2Cname%3Dtiller: dial tcp 127.0.0.1:8080: connect: connection refused                     

Hi @superseb

The issue was missing = in –clusterrole cluster-admin. I have copied the command from Rancher docs and executed as it is. Now I submitted a pull request for the correction.

Thanks,
Vishnu

That equals shouldn’t be significant… are you sure it’s not because of the dashes? Your post has “smart dashes” instead of two hyphens for the flag, != --.

@vincent I was using two dashes and even my post had dashes, When formatting I think it got converted to smartdashes. Good find.
To get it working all I did was to add that single “=” nothing else.