How to access the Istio loadbalancer running in a VM from the host machine


In a KVM Vagrant VM (Ubuntu 20.04), I have setup a Kubernetes Cluster with Knative and Istio. The intent is to deploy functions to the cluster inside the VM be able to call them from my host machine (PopOs 22.04). The loadbalancer has an external IP:

kubectl get all --namespace=istio-system

NAME                                         READY   STATUS    RESTARTS   AGE
pod/cluster-local-gateway-6f45b9848f-pplbm   1/1     Running   0          38m
pod/istio-ingressgateway-865c54f859-8rqht    1/1     Running   0          38m
pod/istiod-597bf9bb5d-7wdxp                  1/1     Running   0          39m

NAME                            TYPE           CLUSTER-IP      EXTERNAL-IP     PORT(S)                                                                      AGE
service/cluster-local-gateway   ClusterIP   <none>          15020/TCP,80/TCP,443/TCP                                                     38m
service/istio-ingressgateway    LoadBalancer   15021:32621/TCP,80:31238/TCP,443:30360/TCP,15012:32532/TCP,15443:32017/TCP   38m
service/istiod                  ClusterIP    <none>          15010/TCP,15012/TCP,443/TCP,15014/TCP                                        39m
service/knative-local-gateway   ClusterIP   <none>          80/TCP                                                                       37m

NAME                                    READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/cluster-local-gateway   1/1     1            1           38m
deployment.apps/istio-ingressgateway    1/1     1            1           38m
deployment.apps/istiod                  1/1     1            1           39m

NAME                                               DESIRED   CURRENT   READY   AGE
replicaset.apps/cluster-local-gateway-6f45b9848f   1         1         1       38m
replicaset.apps/istio-ingressgateway-865c54f859    1         1         1       38m
replicaset.apps/istiod-597bf9bb5d                  1         1         1       39m

NAME                                                        REFERENCE                          TARGETS         MINPODS   MAXPODS   REPLICAS   AGE
horizontalpodautoscaler.autoscaling/cluster-local-gateway   Deployment/cluster-local-gateway   <unknown>/80%   1         5         1          38m
horizontalpodautoscaler.autoscaling/istio-ingressgateway    Deployment/istio-ingressgateway    <unknown>/80%   1         5         1          38m
horizontalpodautoscaler.autoscaling/istiod                  Deployment/istiod                  <unknown>/80%   1         5         1          39m

When I perform a function call to a deployed function from inside the VM the call executes successfully, but when I try to perform the call from my host machine the call does not execute.

Is there a way to make the Istio Loadbalancer visible/accessible to my host machine?


If you’re running Kubernetes inside a Vagrant VM, you need to think a bit about what the network routing on your host machine (Linux) looks like. You’ll probably want to route some set of IPs from your Linux machine to the Vagrant VM, and then install or use something like MetalLB within the VM to allow the VM ("guest") to route those additional IPs to your Kubernetes pods.

Answered By – E. Anderson

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published