Istio IngressへのProxy Protocolの設定
FPT Cloud Managed Kubernetesを使用しており、IstioゲートウェイからKubernetes内のアプリケーションにアクセスするエンドユーザーのパブリックIPを取得する必要がある場合は、以下の設定を行います。
アノテーションloadbalancer.fptcloud.com/proxy-protocol: "true"をサービス設定に追加して、istio-ingressgatewayサービスのProxy Protocolを有効にします。
istio-system namespaceにEnvoyFilterを設定します:
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: proxy-protocol
namespace: istio-system
spec:
configPatches:
- applyTo: LISTENER
patch:
operation: MERGE
value:
listener_filters:
- name: envoy.filters.listener.proxy_protocol
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.listener.proxy_protocol.v3.ProxyProtocol
workloadSelector:
labels:
istio: [lable-istio-gateway]
この設定により、エンドユーザーがIstioゲートウェイを経由してアプリケーションにアクセスした際、istio-ingressgateway PodのログにそのエンドユーザーのパブリックIPが記録されます。
注意: このガイドはIstioオープンソースバージョン1.22以前に適用されます。