Istio 支持代理协议吗?
我在带有TCP转发和代理协议("发送代理"标志(的haproxy后面设置了一个网关,但它不起作用。
我知道 Envoy 支持它,但似乎 Istio 不支持。
如果它不支持它,是否有其他方法可以检索源 IP?
感谢您的帮助。
您可能需要应用以下内容:
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