When I am trying to access the Kubernetes dashboard service from my local laptop, I am getting the message that site can not be reached.
Procedure followed:
I followed the documentation from the following link,
https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/
I created my cluster with one master and one worker node on my premise machine. Each machine is ubuntu 16.04. And I installed kubectl and accessing this cluster from my control vm where I am running Jenkins for ci/cd pipeline. From this control vm I followed to bind the clusterrole and deployed the Kubernetes dashboard as explained in the documentation.
I run the following command for deploying the default dashboard service from my control vm by using kuectl command (outside the cluster):
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta8/aio/deploy/recommended.yaml
I created the role binding yaml dashboard-adminuser.yaml
with following content ,
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
And created this by using the following command:
kubectl apply -f dashboard-adminuser.yaml
Accessed the token by using following command:
kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | grep admin-user | awk '{print $1}')
And run the following command for serving the dashboard service:
kubectl proxy
When I run the command showing "Starting serving on 127.0.0.1:8001".
And I tried to access the dashboard by putting the following URL on browser,
http://192.168.16.170:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/
But I am only getting the message that site can not be reached.
Updates
Now I am trying to access using NodePort mechanism by editing the dashboard service type to NodePort
type. When I am trying to access the URL , I am getting the error like "your connection is not private". I am adding the screenshot below,
Where have I gone wrong?