gke-letsencrypt icon indicating copy to clipboard operation
gke-letsencrypt copied to clipboard

Installing cert manager throws error

Open timuckun opened this issue 5 years ago • 8 comments

Error: namespaces "kube-system" is forbidden: User "system:serviceaccount:kube-system:default" cannot get namespaces in the namespace "kube-system"

I have followed all the instructions up to this point. I have ran them twice and gotten confirmation that they were properly installed.

timuckun avatar Nov 25 '18 22:11 timuckun

Are you on GKE? Do you have owner permissions on the cluster?

ahmetb avatar Nov 25 '18 22:11 ahmetb

I do have permissions. After searching around quite a bit I found that if I do this before it works

kubectl create serviceaccount -n kube-system tiller
kubectl create clusterrolebinding tiller-binding \
    --clusterrole=cluster-admin \
    --serviceaccount kube-system:tiller

helm init --service-account tiller

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


helm repo update

so I had to create that extra role binding. My understanding is weak at this point but this did allow me to go on with the tutorial. You may want to add that to the docs.

Thanks.

timuckun avatar Nov 26 '18 21:11 timuckun

Hmm so the instructions at https://github.com/ahmetb/gke-letsencrypt/blob/master/10-install-helm.md were not enough?

I'm not sure why we need to give kube-system:default user a permission as well. Maybe that's a recent change. What's your GKE/Kubernetes version?

ahmetb avatar Nov 26 '18 21:11 ahmetb

No the instructions were not enough in that when it came to install the cert manager I got the permission error. My GKE version is 1.10.9-gke.5

timuckun avatar Nov 26 '18 22:11 timuckun

I just tried this on a clean 1.10.6-gke.11 cluster (technically the same as yours since both are 1.10) and it didn't require me to do anything with --serviceaccount=kube-system:default.

I'll open this issue as others may also run into it, but as far as I can tell, it doesn't warrant a change.

ahmetb avatar Nov 26 '18 22:11 ahmetb

OK. For some reason I had to do that.

timuckun avatar Nov 26 '18 23:11 timuckun

I bumped into this same issue on GKE 1.11.5-gke.4. @timuckun solution worked for me.

FreakTheMighty avatar Dec 20 '18 20:12 FreakTheMighty

Don't we have the same steps listed in that comment already in https://github.com/ahmetb/gke-letsencrypt/blob/master/10-install-helm.md ? I don't really understand where the problem comes from (existing helm installations?)

ahmetb avatar Dec 20 '18 22:12 ahmetb