Skip to content

Instantly share code, notes, and snippets.

@vishnuvp
Created April 25, 2019 13:53
Show Gist options
  • Save vishnuvp/51b05764ac6f8cbad32017f9c24f216b to your computer and use it in GitHub Desktop.
Save vishnuvp/51b05764ac6f8cbad32017f9c24f216b to your computer and use it in GitHub Desktop.
Enable Kubernetes Dashboard on Docker for mac

See https://github.com/kubernetes/dashboard

1. kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml
2. kubectl proxy
  1. Go to http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/
  2. For the authentication token
cat <<EOF >dashboard-adminuser.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: admin-user
  namespace: kube-system
---

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: kube-system
  EOF

kubectl apply -f dashboard-adminuser.yaml
  1. Get the token and login
kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk '{print $1}')

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