Istio是否支持代理协议?

问题描述 投票:2回答:1

Istio是否支持代理协议?

我在具有TCP转发和代理协议(“ send-proxy”标志)的haproxy后面设置了网关,但是它不起作用。

我知道Envoy支持,但是Istio似乎不支持。

如果不支持,是否还有另一种方法来检索源IP?

感谢您的帮助。

kubernetes haproxy istio proxy-protocol
1个回答
0
投票

您可能必须应用此:

apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
  name: proxy-protocol
  namespace: istio-system
spec:
  workloadSelector:
    labels:
      istio: ingressgateway
  configPatches:
  - applyTo: LISTENER
    patch:
      operation: MERGE
      value:
        listener_filters:
        - name: envoy.listener.proxy_protocol
        - name: envoy.listener.tls_inspector

由于我的istio入口网关位于AWS ELB的后面,所以我还必须在ELB上启用代理协议:

apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
  namespace: istio-system
spec:
  profile: default
  components:
    ingressGateways:
      - name: istio-ingressgateway
        namespace: istio-system
        enabled: true
        # Copy settings from istio-ingressgateway as needed.
  values:
    gateways:
      istio-ingressgateway:
        serviceAnnotations:
          # Note that Helm values (spec.values.gateways.istio-ingressgateway/egressgateway)
          # are shared by all ingress/egress gateways.
          # If these must be customized per gateway,
          # it is recommended to use a separate IstioOperator CR

          # Enable Prox protocol
          service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: "*"

如果您错过envoy.listener.tls_inspector,您将获得:

curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to xxx
openssl: no peer certificate available
© www.soinside.com 2019 - 2024. All rights reserved.