Based on https://github.com/kubernetes/dashboard.
-
install the dashboard in your cluster:
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.3/aio/deploy/recommended.yaml
-
run a proxy:
kubectl proxy
-
Go to http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/, where it will ask you for a token. You won't be able to get in yet.
-
Following these instructions, create a service account and a cluster role binding:
cat << EOF > dashboard-service-account.yaml apiVersion: v1 kind: ServiceAccount metadata: name: admin-user namespace: kubernetes-dashboard EOF kubectl apply -f dashboard-service-account.yaml
cat << EOF > dashboard-cluster-role-binding.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: admin-user roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-admin subjects: - kind: ServiceAccount name: admin-user namespace: kubernetes-dashboard EOF kubectl apply -f dashboard-cluster-role-binding.yaml
-
Copy the token from the following command, and paste it into your browser:
kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | grep admin-user | awk '{print $1}')
-
Now you should be up and running, remember to turn on 'all namespaces' if you're not seeing anything!