Skip to content

Instantly share code, notes, and snippets.

@jruels
Created February 12, 2019 23:35
Show Gist options
  • Save jruels/fa6739b2971a758b642b7c4f13eec4fa to your computer and use it in GitHub Desktop.
Save jruels/fa6739b2971a758b642b7c4f13eec4fa to your computer and use it in GitHub Desktop.
Install Kubernetes Dashboard

Kubeadm expose Dashboard

Deploy dashboard

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml

List tokens

Confirm a kubernetes-dashboard service account token was created

sudo kubectl -n kube-system get secret

Create ClusterRoleBinding

Now we need to give the kubernetes-dashboard service account access

kubectl create clusterrolebinding kubernetes-dashboard -n kube-system --clusterrole=cluster-admin --serviceaccount=kube-system:kubernetes-dashboard

Retrieve token

kubectl describe secret dashboard-token-bsqvp -n kube-system

Copy the token to use for login later

Change to NodePort

kubectl -n kube-system edit service kubernetes-dashboard

Now change type: ClusterIP to type: NodePort

sessionAffinity: None
  type: NodePort
status:

Get NodePort

kubectl get svc -n kube-system kubernetes-dashboard

Access Dashboard https::

You can now load the Dashboard from outside the cluster, but you will be prompted for a token when trying to login.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment