0

我有一个部署 istio 被注入,可以访问谷歌地图距离矩阵 api。如果我运行 istioctl kube-inject--includeIPRanges 10.0.0.0/8似乎可以工作。如果我删除此标志并应用出口规则,它将不起作用:

apiVersion: config.istio.io/v1alpha2 kind: EgressRule metadata: name: google-egress-rule namespace: microservices spec: destination: service: "maps.googleapis.com" ports: - port: 443 protocol: https - port: 80 protocol: http

部署和出口规则都在同一个命名空间(微服务)中。

知道我的错在哪里吗?

4

1 回答 1

2

从我看到的运行来看curl maps.googleapis.com,它重定向到https://developers.google.com/maps/

这里有两个问题:

  1. 您已为developers.google.com
  2. 目前,您必须通过向端口 443 发出 http 请求来访问 https 外部站点,例如curl http://developers.google.com/maps:443. Istio 代理将为developers.google.com您打开一个 https 连接。不幸的是,目前没有其他方法可以做到这一点,除了使用--includeIPRanges.
于 2017-11-11T07:20:00.700 回答