How to access Kubernetes UI via browser? How to access Kubernetes UI via browser? kubernetes kubernetes

How to access Kubernetes UI via browser?


You can use kubectl proxy.

Depending if you are using a config file, via command-line run

kubectl proxy

or

kubectl --kubeconfig=kubeconfig proxy

You should get a similar response

Starting to serve on 127.0.0.1:8001

Now open your browser and navigate to

http://127.0.0.1:8001/ui/ (deprecated, see kubernetes/dashboard)
http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/

You need to make sure the ports match up.


This works for me that you can access from network

kubectl proxy --address 0.0.0.0 --accept-hosts '.*'


Quick-n-dirty (and unsecure) way to access the Dashboard:

$ kubectl edit svc/kubernetes-dashboard --namespace=kube-system

This will load the Dashboard config (yaml) into an editor where you can edit it.

Change line type: ClusterIP to type: NodePort.

Get the tcp port:

$ kubectl get svc kubernetes-dashboard -o json --namespace=kube-system

The line with the tcp port will look like:

            "nodePort": 31567

In newer releases of kubernetes you can get the nodeport from get svc:

# This is kubernetes 1.7:donn@host37:~$ sudo kubectl get svc --namespace=kube-systemNAME                   CLUSTER-IP   EXTERNAL-IP   PORT(S)        AGEkubernetes-dashboard   10.3.0.234   <nodes>       80:31567/TCP   2h

Do kubectl describe nodes to get a node IP address.

Browse to:http://NODE_IP:31567

Good for testing. Not good for production due to lack of security.