Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forbidden: User "system:serviceaccount:kube-system:default" cannot get namespaces in the namespace "default #21

Closed
postak opened this issue Apr 9, 2018 · 21 comments

Comments

@postak
Copy link

postak commented Apr 9, 2018

Following the instruction in the documentation when running
helm install --name myfn fn
I get the error forbidden: User "system:serviceaccount:kube-system:default" cannot get namespaces in the namespace "default

I solved running these commands to my k8s cluster:

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"}}}}'

if confirmed should be added to the documentation

@kocic11
Copy link

kocic11 commented Apr 14, 2018

I had the same issue and followed this link to resolve it.

Not sure how much should be added to the documentation as it is strictly Helm and RBAC related issue.

@gopimails
Copy link

gopimails commented Jul 4, 2018

kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'

I am getting below error
kubectl : Error from server (BadRequest): invalid character 's' looking for beginning of object key string

@amos6224
Copy link

thanks all, I had the same and was able to fix the issue by following the doc https://docs.helm.sh/using_helm/#tiller-and-role-based-access-control

@peterj
Copy link
Contributor

peterj commented Aug 17, 2018

@postak were you able to resolve the issue with the links mentioned in the thread?

@postak
Copy link
Author

postak commented Aug 20, 2018 via email

@peterj
Copy link
Contributor

peterj commented Aug 20, 2018

Perfect. Since this was resolved and it's not really related to Fn, I'll close it. Feel free to open a new issue if you ran into issues. Thanks!

@thiagodiogo
Copy link

Worked here as well, thanks guys

@rnkhouse
Copy link

kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
Error from server (BadRequest): invalid character 's' looking for beginning of object key string

@peterj
Copy link
Contributor

peterj commented Sep 18, 2018

@rnkhouse if the problem you're seeing is related to Fn, please open a separate issue and explain what you're seeing. This issue is closed.

@e-desouza
Copy link

helm init --upgrade --service-account tiller worked for me

@denismakogon
Copy link
Member

Closing one. Please reopen if necessary or if you see the following problem with the latest chart.

@paraspatidar
Copy link

kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
Error from server (BadRequest): invalid character 's' looking for beginning of object key string

Try this :

 $jsondata=  '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'| ConvertTo-Json
kubectl patch deploy --namespace kube-system tiller-deploy -p $jsondata

@loxal
Copy link

loxal commented May 8, 2019

Why is this is not part of the Helm documentation?!

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"}}}}'

@encarvlucas
Copy link

kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
Error from server (BadRequest): invalid character 's' looking for beginning of object key string

Try this :

 $jsondata=  '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'| ConvertTo-Json
kubectl patch deploy --namespace kube-system tiller-deploy -p $jsondata

@gopimails @rnkhouse

I had this same issue, you need to escape the double quotes characters on the json:
kubectl patch deploy --namespace kube-system tiller-deploy -p '{\"spec\":{\"template\":{\"spec\":{\"serviceAccount\":\"tiller\"}}}}'

@miraj-godha-guavus
Copy link

I solved running all of these commands in given sequence to my k8s cluster:

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"}}}}'
helm init --upgrade --service-account tiller

And then you can run your helm command like:
helm install --name postgres stable/postgresql --set postgresqlPassword=secretpass,postgresqlDatabase=cdap

@loxal
Copy link

loxal commented Oct 23, 2019

The latest v2.15 HELM is finally compatible with K8s v1.16.2.

@mklueh
Copy link

mklueh commented Dec 26, 2019

$ kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'

produces

Error from server (NotFound): deployments.apps "tiller-deploy" not found

and

helm init --upgrade --service-account tiller

produces

Error: unknown flag: --upgrade

I´m running an automanaged cluster on Digital Ocean. Tiller has been installed through the Gitlab Dashboard after connecting to my cluster.

Appreciate any help

@imriss
Copy link

imriss commented Feb 19, 2020

kubectl --namespace kube-system create serviceaccount tiller;
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller;
helm init --service-account tiller --upgrade;
sleep 30;
kubectl get po --all-namespaces;
helm list; 

@man-csl
Copy link

man-csl commented May 6, 2020

I had to escape double quotes and also use " instead of '.
kubectl patch deploy --namespace kube-system tiller-deploy -p "{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}"

@bsamadi
Copy link

bsamadi commented Aug 14, 2021

Isn't tiller gone with helm 2?

A Gentle Farewell to Tiller

@Ravi-Macha
Copy link

@miraj-godha-guavus - Your suggested worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests