Kubernetes Web UI(Dashboard) Activation without Authentication

Sarp Köksal
2 min readNov 14, 2019

--

In this tutorial, I will explain you how to enable Kubernetes Dashboard after you fully deployed your K8S cluster. However, this is not adviced for production environment because we are dashboard authentication stage.

Firstly, we are running following command:

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta4/aio/deploy/recommended.yaml

Then, we are giving admin role to our current user. Run the following command:

cat <<EOF | kubectl create -f -
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: kubernetes-dashboard2
labels:
k8s-app: kubernetes-dashboard
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: kubernetes-dashboard
namespace: kubernetes-dashboard
EOF

**Be careful while copying this script because indentation can change when you copy it and it may give error.

Then, we will edit the our deployment file so that will enable login without authentication.

kubectl edit deployment/kubernetes-dashboard — namespace=kubernetes-dashboardAdd the line below- --enable-skip-login

Now we are ready to start proxy and reach Kubernetes Dashboard:

kubectl proxy --address 0.0.0.0 --accept-hosts '.*'

You see your dashboard from link below:

http://<k8s-master-IP>:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/

When you go to this link, you will see a screen like this:

Press “Skip” and you see your dashboard finally.

--

--