How to enable SSH tunnelling to Kubernetes dashboard
search cancel

How to enable SSH tunnelling to Kubernetes dashboard

book

Article ID: 298608

calendar_today

Updated On:

Products

VMware Tanzu Kubernetes Grid Integrated Edition

Issue/Introduction

Customer has triggered a "kubectl proxy" in a remote VM and would like leverage SSH tunnelling to access the Kubernetes dashboard in the local desktop.

Environment

Product Version: 1.6

Resolution

To set up the SSH tunnelling, we can issue the following ssh command in the local desktop:

$ ssh -L 8011:127.0.0.1:8001 xx.xx.xx.xx


Replace "xx.xx.xx.xx" with the IP address of your remote VM where "kubectl proxy" is running.

Note: The default port is changed to 8011 in this example. You can use whatever is available in your local desktop.

After ssh login is successful, you can access the Kubernetes dashboard in the local desktop by opening the following address in dashboard v1:

http://localhost:8011/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/


OR

The following address in v2:

http://localhost:8011/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/