-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
Helm 2.2.3 not working properly with kubeadm 1.6.1 default RBAC rules #2224
Comments
Elsewhere I proposed the idea—casually—of adding an option to helm init to allow specifying the service account name that Tiller should use. |
@seh do you think that |
I do think that would be useful, but a conscientious administrator is going to want to be able to override that by specifying a service account name too—in which case we should trust that he will take care of ensuring the account exists. In my Tiller deployment script, I do create a service account called—believe it or not—"tiller," together with a ClusterRoleBinding granting it the "cluster-admin" role (for now). |
I've done a bunch of testing, now, and I agree with @seh. The right path forward seems to be create the necessary RBAC artifacts during I would suggest that...
Thus, the "conscientious administrator" will be taking upon themselves the task of setting up their own role bindings and service accounts. |
If we create the binding for the service account, presumably we'll create a ClusterRoleBinding granting the "cluster-admin" ClusterRole to Tiller's service account. We should document, though, that it's possible to use Tiller with more restrictive permissions, depending on what's contained in the charts you'll install. In some cases, for a namespace-local Tiller deployment, even the "edit" ClusterRole bound via RoleBinding would be sufficient. |
@IronhandedLayman I'm working on automated installation and trying to bake this last command into Ansible. Any advice would be appreciated! Thanks! |
@MaximF If you want to keep everything in CI I suggest you just copy the deployment from the API and use |
Adding a temporary alternate solution for automation and @MaximF For the Katacoda scenario (https://www.katacoda.com/courses/kubernetes/helm-package-manager), we didn't want users having to use Instead, we "disable" RBAC using the command Thanks to the Weave Cortex team for the command (cortexproject/cortex#392). |
@BenHall after running that I'm getting an error like this on a step
|
@michelleN I think it makes the most sense to do this in two parts:
|
helps with half of helm#2224
helps with half of helm#2224
helps with half of helm#2224
helps with half of helm#2224
Does tiller need |
That depends wholly on what the charts you install try to create. If they create namespaces, ClusterRoles, and ClusterRoleBindings, then Tiller needs the "cluster-admin" role. If all it does is create, say, ConfigMaps in an existing namespace, then it could get by with much less. You have to tune Tiller to what you want to do with Tiller, or, less fruitfully, vice versa. |
Ah, yes. Thanks @seh! It will really depend on the charts as they might be creating different objects. |
@seh Any chance you could whip up a quick entry in the Helm 2.4.0 will ship (later today) with the |
The critical parts are done. Moving to 2.4.1 to remind myself about docs. |
I just faced this again after switching from a kubeadm-controlled k8s to a kops one. Running this: helm init
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"}}}}' Then helm install --name=traefik stable/traefik --set=rbac.enabled=true The kubeadm-controlled cluster does not return an error, but the kops cluster immediately shows this:
Can this be something to do with how kops cluster is being setup by default? Both clusters' version is
|
I've also got this error on a kops 1.7 cluster and a minikube 1.7 cluster, both using helm version 2.5.1 on client side and tiller. I've tried the various suggestions above regarding creating a
Is this likely due to the last line of the error message:
I'm not particularly au fait with RBAC on k8s - should that role exist? Neither the
|
That's not a ServiceAccount; it's a ClusterRole. Try the following: |
Sorry @seh my bad on typing the above, I did check The output shown below is from my kops 1.7 cluster, but also on my minikube 1.7 cluster the
|
Do you have the RBAC authorizer activated? According to the documentation, each time the API server starts with RBAC activated, it will ensure that these roles and bindings are present. |
Thanks @seh I'll go and do some more digging, that link is very useful. |
After running
Thanks to @kujenga! The following commands resolved the errors for me and
|
Not working on Kubrnetes V1.9.0 helm list helm install stable/nginx-ingress |
@thatsk Those steps worked for me in kubernetes 1.8.4. |
See my reply in #3371. |
in case you run the command "kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller " do the following :
|
The error message broad me here
but actually I found a solution here
In my case gcloud user (kubectl as service account ) has to be assigned with Owner privileges in the IAM console |
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, buthelm list
,helm install
, and so on all do not work, citing some missing permission or another.A work-around for this is to create a service account, add the service account to the tiller deployment, and bind that service account to the ClusterRole
cluster-admin
. If that is how it should work out of the box, then those steps should be part ofhelm init
. Ideally, a new ClusterRole should be created based on the privileges of the user instantiating the Tiller instance, but that could get complicated very quickly.At the very least, there should be some word in the documentation so that users installing helm using the instructions included within won't be wondering why they can't install anything.
Specific steps for my workaround:
The text was updated successfully, but these errors were encountered: