Should the k8s dashboard be deployed only on the master node?

5/28/2021

After installing a dashboard, the dashboard pod continued to crashloopbackoff and when I googled, I saw a mention that "should be deployed only on the master node". Looking at the deployment of the dashboard pod, it seems that it has not been designated as master separately, and there is no related content in the official document. Is it correct that the dashboard pod can be deployed only on the master node?

I followed the guide.

I just use it with only the installed ones, but I'm wandering about trying to install it once.

-- Ryan Moon
kubernetes
kubernetes-dashboard

1 Answer

5/28/2021

Dashboard can be deployed on any node. In fact the recommended yaml has tolerations key which lets you prevent it from being deployed on master.

Lines 229 - 232

...
      # Comment the following tolerations if Dashboard must not be deployed on master
      tolerations:
        - key: node-role.kubernetes.io/master
          effect: NoSchedule
...

To confirm that I quickly deployed it on my test cluster, without changing anything in yaml

user@c01-master01:~$ kubectl get nodes
NAME           STATUS   ROLES                  AGE    VERSION
c01-master01   Ready    control-plane,master   7d3h   v1.21.1
c01-node01     Ready    <none>                 7d2h   v1.21.1
c01-node02     Ready    <none>                 7d2h   v1.21.1
user@c01-master01:~$ kubectl describe node c01-node01
...
  kubernetes-dashboard        kubernetes-dashboard-78c79f97b4-lpjjt    0 (0%)        0 (0%)      0 (0%)           0 (0%)         38m
...

As you can see, in my case kubernetes-dashboard is deployed on a worker node

-- p10l
Source: StackOverflow