Helm: Error: no available release name found

余生颓废 提交于 2019-12-02 16:13:57
Simon I

I think it's an RBAC issue. It seems that helm isn't ready for 1.6.1's RBAC.

There is a issue open for this on Helm's Github.

https://github.com/kubernetes/helm/issues/2224

"When installing a cluster for the first time using kubeadm v1.6.1, the initialization defaults to setting up RBAC controlled access, which messes with permissions needed by Tiller to do installations, scan for installed components, and so on. helm init works without issue, but helm list, helm install, and so on all do not work, citing some missing permission or another."

A temporary work around has been suggest:

"We "disable" RBAC using the command kubectl create clusterrolebinding permissive-binding --clusterrole=cluster-admin --user=admin --user=kubelet --group=system:serviceaccounts;"

But I can not speak for it's validity. The good news is that this is a known issue and work is being done to fix it. Hope this helps.

karthik101

The solution given by kujenga from the GitHub issue worked without any other modifications:

kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
MrMackey

I had the same issue with the kubeadm setup on to CentOS 7.

Helm doesn't make a service account when you "helm init" and the default one doesn't have the permissions to read from the configmaps - so it will fail to be able to run a check to see if the deployment name it wants to use is unique.

This got me past it:

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

But that is giving the default account tons of power, I just did this so I could get on with my work. Helm needs to add the creation of their own service account to the "helm init" code.

All addons in the kubernetes use the "defaults" service account. So Helm also runs with "default" service account. You should provide permissions to it. Assign rolebindings to it.

For read-only permissions:

kubectl create rolebinding default-view --clusterrole=view \ --serviceaccount=kube-system:default --namespace=kube-system

For admin access: Eg: to install packages.

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

You can also install tiller server in adifferent namespace using the below command.

  1. First create the namesapce
  2. Create the serviceaccount for the namespace
  3. install the tiller in this respective namespace using the below command.

helm init --tiller-namespace test-namespace

This solution has worked for me: https://github.com/helm/helm/issues/3055#issuecomment-397296485

$ kubectl create serviceaccount --namespace kube-system tiller

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

$ helm init --service-account tiller --upgrade

$ helm update repo

$ helm install stable/redis --version 3.3.5

But after that, something has changed ; I have to add --insecure-skip-tls-verify=true flag to my kubectl commands ! I don't know how to fix that knowing that I am interacting with a gcloud containers cluster.

Per https://github.com/kubernetes/helm/issues/2224#issuecomment-356344286, the following commands resolved the error for me too:

kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'

Per https://github.com/kubernetes/helm/issues/3055

helm init --service-account default

This worked for me when the RBAC (serviceaccount) commands didn't.

It's an RBAC issue. You need to have a service account with a cluster-admin role. And you should pass this service account during HELM initialization.

For example, if you have created a service account with the name tiller, you heml command would look like the following.

helm init --service-account=tiller

I followed this blog to resolve this issue. https://scriptcrunch.com/helm-error-no-available-release/

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