Istio Ingress 向けに Proxy Protocol を設定する
Managed - FPT Kubernetes Engine 上の Istio gateway 経由でアプリケーションにアクセスし、エンドユーザーの実際の public IP が必要な場合は、次のように Proxy Protocol を設定します。
Proxy Protocol を有効にする
-
istio-ingressgateway の service 設定にアノテーション
loadbalancer.fptcloud.com/proxy-protocol: "true"を追加します。 -
istio-systemnamespace に EnvoyFilter を apply します。apiVersion: networking.istio.io/v1alpha3kind: EnvoyFiltermetadata:name: proxy-protocolnamespace: istio-systemspec:configPatches:- applyTo: LISTENERpatch:operation: MERGEvalue:listener_filters:- name: envoy.filters.listener.proxy_protocoltyped_config:'@type': type.googleapis.com/envoy.extensions.filters.listener.proxy_protocol.v3.ProxyProtocolworkloadSelector:labels:istio: [lable-istio-gateway]
この設定により、istio-ingressgateway の pod ログに、gateway 経由でアプリケーションにアクセスしたエンドユーザーの実際の送信元 public IP が表示されます。
注記
このガイドは Istio オープンソース版 1.22 以前を対象としています。