minikube: apiserver.Authorization.Mode=RBAC dashboard CrashLoopBackOff: secrets is forbidden: User cannot create secrets
Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT
Please provide the following details:
Environment:
Minikube version (use minikube version): v0.25.0
- OS (e.g. from /etc/os-release): Mac OS 10.13.3
- VM Driver (e.g.
cat ~/.minikube/machines/minikube/config.json | grep DriverName): hyper kit - ISO version (e.g.
cat ~/.minikube/machines/minikube/config.json | grep -i ISOorminikube ssh cat /etc/VERSION): - Install tools:
- Others: The above can be generated in one go with the following commands (can be copied and pasted directly into your terminal):
minikube version
echo "";
echo "OS:";
cat /etc/os-release
echo "";
echo "VM driver":
grep DriverName ~/.minikube/machines/minikube/config.json
echo "";
echo "ISO version";
grep -i ISO ~/.minikube/machines/minikube/config.json
What happened: Trying to bring up minikube with default RBAC roles. Simply running minikube start --vm-driver hyperkit without the extra-config yields no roles. To get the default roles, I added the extra-config: minikube start --vm-driver hyperkit --extra-config=apiserver.Authorization.Mode=RBAC.
The expected roles are present, but the dashboard and dns pods do not fully come up:
$ kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system kube-addon-manager-minikube 1/1 Running 0 1m
kube-system kube-dns-54cccfbdf8-vqdgw 2/3 Running 0 1m
kube-system kubernetes-dashboard-77d8b98585-djkcf 0/1 CrashLoopBackOff 3 1m
kube-system storage-provisioner 1/1 Running 0 1m
kube-system tiller-deploy-587df449fb-b8wd6 1/1 Running 0 50s
Tailing the dashboard logs shows:
panic: secrets is forbidden: User "system:serviceaccount:kube-system:default" cannot create secrets in the namespace "kube-system"
The error can be fixed by creating the missing clusterrolebinding:
$ kubectl create clusterrolebinding kube-system-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default
clusterrolebinding "kube-system-cluster-admin" created
This should exist by default.
What you expected to happen: All pods come up without any intervention.
How to reproduce it (as minimally and precisely as possible):
minikube start --vm-driver hyperkit --extra-config=apiserver.Authorization.Mode=RBAC
Output of minikube logs (if applicable):
Anything else do we need to know: The kubeadm bootstrapper installs the RBAC roles correctly by default without requiring the extra-config.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 14
- Comments: 19 (6 by maintainers)
Digging into this, I found the following in the kubedns container under the kube-dns pod:
My pods were in the same state as @berndtj
My fix for this came from kubernetes-incubator/service-catalog/issues/1069:
Environment:
minikube start --kubernetes-version v1.9.0 --vm-driver=hyperkit --extra-config='apiserver.Authorization.Mode=RBAC'I am having this issue, and the above workaround to create the clusterrolebinding worked for me.
example detailing symptoms and workaround