Wednesday, May 27, 2020

Install kubernetes Dashboard and access outside from local

Install kubernetes Dashboard:


 step-1 

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta6/aio/deploy/recommended.yaml

step-2

create a SA with name dashboard-adminuser.yaml with 

apiVersion: v1
kind: ServiceAccount
metadata:

  name: admin-user

  namespace: kubernetes-dashboard
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: admin-user
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: admin-user
  namespace: kubernetes-dashboard

step-3

kubectl apply -f dashboard-adminuser.yaml

step-4

Now we need to find the token ,
kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | grep admin-user | awk '{print $1}')
it should be something like ,


step 5

goto master node ,type
 kubectl proxy --address 0.0.0.0 --accept-hosts '.*'

step-6



How to access dashboard outside:-

 To make it acess outside from machine ,you need to do tunneling ,I am using putty for tunneling .