Issue
I have an EC2 instance say its IP is 44.XX.XX.XX (Say IP1), I have an minikube which is running inside this EC2 instance say its IP is 10.XX.XX.XX (Say IP2) , which I came to know by doing minikube ip inside EC2 instance . I have an Frontend application running inside minikube at NodePort say 30010 . I am able to curl to application by doing curl http://IP2:30010
But I want to access this application out side ec2 through any other PC . How to do this , I tried doing http://IP1:30010 but it didnit work
Solution
I'm assuming this is only for development purpose? You need to port forward the traffic from your EC2 node to minikube as minikube runs as separate VM.
Once you have kubectl setup on the IP2 host machine talking to the minikube cluster, you can use kubectl port-forward to forward traffic to any service/pod running inside minikube.
kubectl port-forward --address 0.0.0.0 svc/<svc-name> <host-port>:<service-port>
You should be able to access your app at IP2:<host-port>
as long as the port-forwarding is set up.
(Replace stuff within < >
brackets with appropriate values)
Answered By - Shashank V Answer Checked By - Pedro (WPSolving Volunteer)