How to expose local machine running Kubernetes and Istio ingress

458 Views Asked by At

I have a machine on a local network, that I have exposed to the Internet via port forwarding in the router.

Now how can I expose the serving machine running Kubernetes on docker for mac?

using minikube you can do:

minikube tunnel

But how to do it on mac for mac/desktop?

Normally the LoadBalancer is created for you if you use a cloud provider.

1

There are 1 best solutions below

3
On

The command suggested by @Marko is almost correct.

The command:

➜  ~ kubectl port-forward pod/pod-name local_port:pod_port
Forwarding from 127.0.0.1:8080 -> 80
Forwarding from [::1]:8080 -> 80

opens a port but only locally (on loopback interface/localhost). To make it accessible from the outside you need to pass `--address=0.0.0.0. So the complete command is:

➜  ~ kubectl port-forward pod/pod-name local_port:pod_port --address=0.0.0.0
Forwarding from 0.0.0.0:local_port -> pod_port