Skip to content

Instantly share code, notes, and snippets.

@sdorsett
Last active October 12, 2018 17:37
Show Gist options
  • Save sdorsett/8b98ea0a51e7eed69eea857fd953224c to your computer and use it in GitHub Desktop.
Save sdorsett/8b98ea0a51e7eed69eea857fd953224c to your computer and use it in GitHub Desktop.
bash script for determining the kubernetes dashboard URL
#! /bin/bash
PORTAL_PORT=$(kubectl describe service kubernetes-dashboard --namespace=kube-system| grep -i 'NodePort:' | awk {' print $3 '} | awk -F \/ {' print $1 '})
PORTAL_NODE=$(kubectl get pods --namespace=kube-system| grep -i dashboard | awk {' print $1 '})
PORTAL_IP_ADDRESS=$(kubectl describe pod $PORTAL_NODE --namespace=kube-system| grep Node | grep '/' | awk -F \/ {' print $2 '})
echo "kubernetes dashboard URL is the following: http://$PORTAL_IP_ADDRESS:$PORTAL_PORT/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment