-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
User "system:serviceaccount:kube-system:default" cannot get namespaces in the namespace "default" #3130
Comments
It seems that you have encountered a problem related to privileges. $ helm install --name nginx --set rbac.create=true stable/nginx-ingress |
Same problem here. Enabling rbac does not help.
Help would really be appreciated! |
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 |
Hi, @bacongobbler
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
Any ideas about how to solve this problem? |
@noprom try this delete the deployment of tiller manually create these rbac config for tiller apiVersion: v1
kind: ServiceAccount
metadata:
name: tiller
namespace: kube-system
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: tiller-clusterrolebinding
subjects:
- kind: ServiceAccount
name: tiller
namespace: kube-system
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: "" run delete (yes delete) on that rbac config you should not have any more errors. |
@innovia |
Happy to help :) |
@noprom please check my post on how to setup helm and tiller with rbac per namespace |
@innovia |
Thanks! |
the above doesn't work Still getting
|
That's because you don't have the permission to deploy tiller, add an account for it: kubectl --namespace kube-system create serviceaccount tiller
kubectl create clusterrolebinding tiller-cluster-rule \
--clusterrole=cluster-admin --serviceaccount=kube-system:tiller
kubectl --namespace kube-system patch deploy tiller-deploy \
-p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}' Console output: serviceaccount "tiller" created
clusterrolebinding "tiller-cluster-rule" created
deployment "tiller-deploy" patched Then run command below to check it :
|
@ykfq Thanks a ton, it works! But every time, we deploy on a new cluster, we need to do this? What a inconvenience! |
@antran89
So, there is another way to make it easer - install via yaml file:
Then 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. |
@ykfq I don't like the idea of giving Tiller full cluster admin privileges, but nothing else worked for me. I tried following this example. I was trying to restrict Tiller to acting only on namespaces I let it act. But always ran into this issue (was deploying Concourse):
Any ideas of how to make that specific example work? I changed some parameters around, the entire YAML with RBACs was this one:
|
helm init --upgrade --service-account tiller |
@brunoban helm v3 will remove tiller so from what i understood the permissions will be by the user who apply it |
@innovia Oh... I did not know that. Gonna try to get up to speed now then. Thanks! |
@innovia Where to put the rbac config file? |
@cjbottaro did you read the post i wrote Hwo to setup helm and tiller per namespace ? I don't follow your question, can you please re-explain? |
@innovia Nevermind, I figured it out. Just had to run
|
this worked for me: kubectl --namespace kube-system create serviceaccount tiller |
I'm following the official Helm documentation for "Deploy Tiller in a namespace, restricted to deploying resources only in that namespace". Here is my bash script:
Running
Is there a bug in the official documentation? Have I read it wrong? |
What was the full command for |
@bacongobbler Moved issue here #4933 |
Follow below Command:- helm init --service-account tiller --upgrade -i registry.cn-hangzhou.aliyuncs.com/google_containers/tiller:v2.14.0 --stable-repo-url https://kubernetes.oss-cn-hangzhou.aliyuncs.com/charts |
The file name is now |
It would be great if tiller installation docs be updated with these precise instructions apiVersion: v1
kind: ServiceAccount
metadata:
name: tiller
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: tiller
roleRef:
apiGroup: ""
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: tiller
namespace: kube-system If I'm correct i was missing the |
The above command fixes this issue, highly recommend this step at first :) |
When install a helm package, I got the following error like this:
Here is my helm version:
And my kubectl version:
Any help will be appreciated, thanks a lot!
The text was updated successfully, but these errors were encountered: