How to deploy a Dashboard to your Kubernetes cluster

Sergey Royz
1 min readFeb 4, 2020

--

This article guides you through the steps necessary to deploy Kubernetes Dashboard to your cluster, give it admin access and make it accessible from any host.

Disclaimer: changes you are going to make may pose a serious security threat. The dashboard will have admin access to your cluster and will be available over the Internet without authorization. Be sure you understand what you are doing.

1. Get the deployment configuration

wget https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-rc3/aio/deploy/recommended.yaml

2. Enable Skip button

Make sure args section of the Deployment configuration contains --enable-skip-login. So the section looks as follows:

args:
- --enable-skip-login
- --auto-generate-certificates
- --namespace=kubernetes-dashboard

3. Grant custer-admin role to kubernetes-dashboard

Find kind: ClusterRoleBinding section and change roleRef#name to cluster-admin , so the section should look as follows:

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kubernetes-dashboard
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
— kind: ServiceAccount
name: kubernetes-dashboard
namespace: kubernetes-dashboard

4. Deploy the dashboard

kubectl apply -f recommended.yaml

5. Make the dashboard available from all hosts

kubectl proxy — address 0.0.0.0 — accept-hosts ‘.*’

Access the dashboard at:

http://<YOUR_IP>:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/.

--

--

Sergey Royz
Sergey Royz

Written by Sergey Royz

Co-founder and CTO of a crypto startup. A full-stack software engineer with a passion for creating innovative tech solutions that make a difference.

No responses yet