Minikube running in Docker mode returns 503 when l

2019-08-26 08:56发布

I have started to learn Minikube using some of this tutorial and a bit of this one. My plan is to use the "none" driver to use Docker rather than the standard Virtual Box.

My purpose is to learn some infra/operations techniques that are more flexible than Docker Swarm. There are a few docker run switches that Swarm does not support, so I am looking at alternatives.

When setting this up, I had a couple of false starts, as I did not specify the --vm-driver=none initially, and I had to do a sudo -rf ~/.minikube and/or a sudo minikube delete to not use VirtualBox. (Although I don't think it is relevant, I will mention anyway that I am working inside a VirtualBox Linux Mint VM as a matter of long-standing security preference).

So, I think I have a mostly working installation of Minikube, but something is not right with the dashboard, and since the Hello World tutorial asks me to get that working, I would like to persist with this.

Here is the command and error:

$ sudo minikube dashboard
                

1条回答
霸刀☆藐视天下
2楼-- · 2019-08-26 09:28

It looks like I needed the rubber-ducking of this question in order to find an answer. The Go crash was the thing to have researched, and is documented in this bug report.

The commands to create a missing role is:

$ kubectl create clusterrolebinding kube-system-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default
clusterrolebinding.rbac.authorization.k8s.io/kube-system-cluster-admin created

Then we need to get the name of the system pod for the dashboard:

$ sudo kubectl get pods -n kube-system

Finally, use the ID of the dashboard pod instead of kubernetes-dashboard-5498ccf677-dq2ct:

$ kubectl delete pods -n kube-system  kubernetes-dashboard-5498ccf677-dq2ct
pod "kubernetes-dashboard-5498ccf677-dq2ct" deleted

I think this removes the misconfigured dashboard, leaving a new one to spawn in its place when you issue this command:

sudo minikube dashboard

To my mind, the Go error looks sufficiently naked and unhandled that it needs catching, but then I am not au fait with Go. The bug report has been auto-closed by a CI bot, and several attempts to reopen it seem to have failed.

At a guess, I could have avoided this pain with setting the role config to start with. However, this is not noted in the Hello World tutorial, so it would not be reasonable to expect beginners not to step into this trap:

sudo minikube start --vm-driver=none --extra-config='apiserver.Authorization.Mode=RBAC'
查看更多
登录 后发表回答