Skip to content

Instantly share code, notes, and snippets.

@rcherara
Created January 4, 2019 03:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rcherara/7191211d9692e038e75404a7695dcf03 to your computer and use it in GitHub Desktop.
Save rcherara/7191211d9692e038e75404a7695dcf03 to your computer and use it in GitHub Desktop.
Setup Kubernetes Dashboard on local workstation for Cluster Docker-For-Desktop
#!/bin/bash
# Create a new user using Service Account mechanism of Kubernetes,
kubectl apply -f dashboard-adminuser.yaml
# Bearer Token
# Now we need to find token we can use to log in.
kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk '{print $1}')
echo "Now copy the token and paste it into Enter token field on log in screen."
# After the dashboard deployement done, open this url in your default browser and log in to Dashboard using bearer token tied
echo "http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/overview?namespace=default"
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kube-system
#!/bin/bash
echo "Deploy Dashboard"
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml
echo "To access Dashboard from your local workstation we create a secure channel to your Kubernetes cluster Docker-Desktop"
kubectl proxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment