我在 EKS 上运行的 K8s 集群上运行来自 Istio 示例项目的 bookinfo 项目。我已经启用了自动边车容器注入并部署了项目。我在这篇文章之后启用了 googleapis 的外部服务。
该服务按预期工作,但是在检查 Kiali 时,我没有看到外部服务,而是看到了 BlackHoleCluster。我读到这是 Istio 的一个虚拟集群,用于对不在网格中的外部服务的请求(ServiceEntry 将它们添加到网格中)。
我也尝试了其他一些示例,并且所有内容都以 BlackHoleCluster(或当为外部流量启用 ALLOW_ALL 时的 PassThroughCluster )结束,所以我怀疑 Istio 的配置有问题。我正在使用Istio 1.5。
我真的找不到任何帮助。每个人都建议一个 ServiceEntry 就足够了。
更新:代码示例
apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
name: httpbin
spec:
hosts:
- httpbin.org
ports:
- number: 80
name: http
protocol: http
- number: 443
name: https
protocol: https
resolution: DNS
location: MESH_EXTERNAL