Kubernetes Dashboard

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

Image for post
Image for post

# Create service account
kubectl 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

Image for post
Image for post

# 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

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store