【问题标题】:Does Istio support proxy protocol?Istio 是否支持代理协议?
【发布时间】:2019-03-27 09:16:36
【问题描述】:

Istio 是否支持代理协议?

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

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

如果不支持,有没有其他方法可以找回源IP?

感谢您的帮助。

【问题讨论】:

  • 感谢您的评论。我很惊讶他们没有为这个问题设置更高的优先级。
  • @matth3o 有一个开放的 Pull Request 改进了 Istio Pilot 配置以启用代理协议支持。密切关注:#12748

标签: kubernetes haproxy istio proxy-protocol


【解决方案1】:

你可能必须应用这个:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-03-03
    • 2012-07-09
    • 2014-11-08
    • 1970-01-01
    • 2018-07-01
    • 2013-02-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多