helm: User "system:serviceaccount:kube-system:default" cannot get namespaces in the namespace "default"
When install a helm package, I got the following error like this:
[root@k8s-master3 ~]# helm install --name nginx stable/nginx-ingress
Error: release nginx failed: namespaces "default" is forbidden: User "system:serviceaccount:kube-system:default" cannot get namespaces in the namespace "default"
Here is my helm version:
[root@k8s-master3 ~]# helm version
Client: &version.Version{SemVer:"v2.7.0", GitCommit:"08c1144f5eb3e3b636d9775617287cc26e53dba4", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.7.0", GitCommit:"08c1144f5eb3e3b636d9775617287cc26e53dba4", GitTreeState:"clean"}
And my kubectl version:
[root@k8s-master3 ~]# kubectl version
Client Version: version.Info{Major:"1", Minor:"8+", GitVersion:"v1.8.1-alicloud", GitCommit:"19408ab2a1b736fe97a9d9cf24c6fb228f23f12f", GitTreeState:"clean", BuildDate:"2017-10-19T04:05:24Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.1", GitCommit:"f38e43b221d08850172a9a4ea785a86a3ffa3b3a", GitTreeState:"clean", BuildDate:"2017-10-11T23:16:41Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
Any help will be appreciated, thanks a lot!
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 61
- Comments: 30 (3 by maintainers)
That’s because you don’t have the permission to deploy tiller, add an account for it:
Console output:
Then run command below to check it :
@noprom try this
delete the deployment of tiller manually
create these rbac config for tiller
run delete (yes delete) on that rbac config run create again then run helm init --upgrade to replace
you should not have any more errors.
helm init --upgrade --service-account tiller
this worked for me:
kubectl --namespace kube-system create serviceaccount tiller kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller helm init --service-account tiller --upgrade
It seems that you have encountered a problem related to privileges. You could enable rbac in when deploying the chart:
the above doesn’t work Still getting
Hi, @bacongobbler Thanks for help. I follow your instructions mentioned above, and I’ve done the following things: First of all, I reset the tiller:
After doing this, I create a RBAC yaml file:
And then init my tiller:
However, the tiller is not installed successfully:
And I sew the deployments in
kube-systemnamespace is like this:Any ideas about how to solve this problem? Thanks in advance!
What you need to do is grant tiller (via the default service account) access to install resources in the default namespace. See https://github.com/kubernetes/helm/blob/master/docs/service_accounts.md
@noprom please check my post on how to setup helm and tiller with rbac per namespace
@antran89 If you use the official tiller installation instruction, you’ll have to do so:
helm initSo, there is another way to make it easer - install via yaml file:
vim tiller.yamlThen create the resourses:
Make sure to check your service .
the above yaml content was exported from a running cluster, using command:
This yaml hasn’t tested yet, if you have any question, make a comment.
@innovia Nevermind, I figured it out. Just had to run
The file name is now
rbac.mdand the link is at https://github.com/helm/helm/blob/master/docs/rbac.md.