Minikube Dashboard in AWS EC2

While I was working with Minikube, I tried to run minikube dashboard on my Ec2 Server instance and I faced a problem while accessing it. Either you have to run a secure https connection or you need to run a Remote Desktop to access the localhost on which your dashboard is running.

In this post I’ll be discussing an alternate way to access the Minikube Dashboard. I’ll create a SSH Tunnel to access the dashboard.

Here is the architecture diagram:

ssh tunnel

I am assuming that you have installed minikube in your EC2 instance. If not then please refer to my this blog. Also I am assuming that you can access your Ec2 instance using ssh Terminal.

STEP 1: Run minikube dashboard on EC2 instance and note down the url

$ minikube dashboard --url

STEP 2: Open another terminal and create an SSH Tunnel

ssh -i <LOCATION TO SSH PRIVATE KEY> -L <LOCAL PORT>:localhost:<REMOTE PORT ON WHICH MINIKUBE DASHBOARD IS RUNNING> user-name@IP$ sudo ssh -i ~/.ssh/id_rsa -L 8081:localhost:36525 shubham@40.77.75.58

Now open your browser and open this url

http://127.0.0.1:8081/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/#/error?namespace=_all

If you liked this post and if it helped you then please give it a clap.
Happy Learning

I’m an undergrad student at IIIT Ranchi, pursuing my B-Tech in computer science and Engineering. I love to learn and share new technologies.