Prequesites
Already Kubernetes cluster is deployed with worker and pods
#To deploy the Metrics Server
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.3.6/components.yaml
#Verify that the metrics-server deployment is running kubectl get deployment metrics-server -n kube-system
#deploy the Kubernetes Dashboard.kubectl apply -f
https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta8/aio/deploy/recommended.yaml
#Edit the Service by replacing cluster type kubectl edit svc -n kubernetes-dashboard
#Replace ClusterIP with NodePort
# Create service accountkubectl create serviceaccount cluster-admin-dashboard-sa
# Bind ClusterAdmin role to the service account
kubectl create clusterrolebinding cluster-admin-dashboard-sa \
— clusterrole=cluster-admin \
— serviceaccount=default:cluster-admin-dashboard-sa
#Get the Nodeport id
kubectl get svc
# Parse the token
TOKEN=$(kubectl describe secret $(kubectl -n kube-system get secret | awk ‘/^cluster-admin-dashboardsa-token-/{print $1}’) | awk ‘$1==”token:”{print $2}’)
# Display Token
echo $TOKEN
Go the Browser by copying the public IP id of your host machine followed by NodePort id
https://3.237.6.43:31165