Skip to content

Instantly share code, notes, and snippets.

@sgdan
Last active August 12, 2018 23:14
Show Gist options
  • Save sgdan/890dc815ec9073e9f36f60e31789d753 to your computer and use it in GitHub Desktop.
Save sgdan/890dc815ec9073e9f36f60e31789d753 to your computer and use it in GitHub Desktop.
Use Kubernetes Dashboard with docker-for-desktop
# I've installed Docker for Windows and enabled the Kubernetes cluster
# My kubectl context is "docker-for-desktop" (right-click on docker tray icon > Kubernetes > docker-for-desktop)
# Docker should have updated my ~/.kube/config file for kubectl access
# Install the dashboard as per https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/ by running:
kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml
# Using git bash shell on windows:
grep 'client-certificate-data' ~/.kube/config | awk '{print $2}' | base64 -d >> kubecfg.crt
grep 'client-key-data' ~/.kube/config | awk '{print $2}' | base64 -d >> kubecfg.key
winpty openssl pkcs12 -out kubecfg.p12 -in kubecfg.crt -inkey kubecfg.key -clcerts -name "kubernetes-client" -export
# need to create and re-enter a password here for the client certificate
# Double-click the kubecfg.p12 file and import it to the default location for current user
# Restart browser, then open dashboard link and select the "kubernetes-client" certificate for "docker-for-desktop"
# https://localhost:6445/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment