簡體   English   中英

如何從主機訪問在 VM 中運行的 Istio 負載均衡器

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

在 KVM Vagrant VM (Ubuntu 20.04) 中,我使用 Knative 和 Istio 設置了 Kubernetes 集群。 目的是將功能部署到 VM 內的集群,以便能夠從我的主機(PopOs 22.04)調用它們。 負載均衡器有一個外部 IP: 192.168.1.240

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      10.103.42.182   <none>          15020/TCP,80/TCP,443/TCP                                                     38m
service/istio-ingressgateway    LoadBalancer   10.107.66.244   192.168.1.240   15021:32621/TCP,80:31238/TCP,443:30360/TCP,15012:32532/TCP,15443:32017/TCP   38m
service/istiod                  ClusterIP      10.100.95.76    <none>          15010/TCP,15012/TCP,443/TCP,15014/TCP                                        39m
service/knative-local-gateway   ClusterIP      10.111.64.124   <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

當我從 VM 內部對已部署的 function 執行 function 調用時,調用成功執行,但是當我嘗試從主機執行調用時,調用不執行。

有沒有辦法讓 Istio 負載均衡器對我的主機可見/可訪問?

如果您在 Vagrant 虛擬機中運行 Kubernetes,您需要考慮一下主機 (Linux) 上的網絡路由是什么樣的。 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.

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM