Kubernetes Istio-无法在outboundTrafficPolicy.mode设置为REGISTRY_ONLY的情况下访问https上的外部IP

Kubernetes Istio-无法在outboundTrafficPolicy.mode设置为REGISTRY_ONLY的情况下访问https上的外部IP,kubernetes,istio,Kubernetes,Istio,我们正在将Istio与outboundTrafficPolicy.mode一起使用,设置为REGISTRY\u ONLY。我们使用ServiceEntries和Sidecar配置将许多域列为白名单,这些都可以正常工作 但是,尝试将IP地址列入白名单并使用HTTPS是行不通的。以下是我们正在使用的ServiceEntry: apiVersion: networking.istio.io/v1alpha3 kind: ServiceEntry metadata: labels: app:

我们正在将Istio与
outboundTrafficPolicy.mode
一起使用,设置为
REGISTRY\u ONLY
。我们使用
ServiceEntries
Sidecar
配置将许多域列为白名单,这些都可以正常工作

但是,尝试将IP地址列入白名单并使用HTTPS是行不通的。以下是我们正在使用的
ServiceEntry

apiVersion: networking.istio.io/v1alpha3
kind: ServiceEntry
metadata:
  labels:
    app: test
  name: test-external-deps
  namespace: realistic-doubles
spec:
  addresses:
    - 54.xx.xx.xx
  endpoints:
    - address: 54.xx.xx.xx
  exportTo:
    - .
  hosts:
    - fakehost3.internal
  location: MESH_EXTERNAL
  ports:
    - name: https
      number: 8443
      protocol: TLS
  resolution: STATIC
当我们把这个IP卷到Istio外面时,我们会得到很好的响应。但在网格中,我们得到:

root@trading-api-99f85fdbc-vskdg:/app# curl -v -k https://54.xx.xx.xx:8443
* Expire in 0 ms for 6 (transfer 0x561ea5c1ff50)
*   Trying 54.xx.xx.xx...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x561ea5c1ff50)
* Connected to 54.xx.xx.xx (54.xx.xx.xx) port 8443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to 54.xx.xx.xx:8443
* Closing connection 0
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to 54.xx.xx.xx:8443
特使访问日志显示了这一点,这似乎与其他被阻止的请求一致:

[2020-07-21T17:27:43.240Z] "- - -" 0 UH "-" "-" 0 0 0 - "-" "-" "-" "-" "-" - - 54.xx.xx.xx:8443 10.xx.xx.xx:48738 - -

我们如何将此外部IP列入白名单,使其不会被特使阻止?

我发现我遗漏了什么。仅添加一个
ServiceEntry
是不够的。我还需要更新
Sidecar
config以列出假主机名,如下所示:

apiVersion: networking.istio.io/v1alpha3
kind: Sidecar
metadata:
  name: test
  namespace: realistic-doubles
  labels:
    app: test
spec:
  workloadSelector:
    labels:
      app.kubernetes.io/name: test
  egress:
    - hosts:
        - "./fakehost3.internal"

在添加这些之后,我能够很好地解决pod中的静态IP

你的istio版本是什么?您能检查一下http是否工作吗?@jt97我们正在使用Istio 1.6.4。HTTP适用于其他静态IP,例如AWS元数据端点。但是这个特定的IP需要使用HTTPS。