4.5 Envoy配置实战:Listener、Cluster、Route三大核心配置详解
引言
Envoy的配置是理解Istio流量管理的基础。Listener、Cluster、Route是Envoy的三个核心配置概念。本文将详细介绍这三个配置的使用方法和实战案例。
一、Listener配置
1.1 Listener概述
Listener定义Envoy监听的网络地址和端口。
1.2 Listener配置示例
listeners:-name:listener_0address:socket_address:address:0.0.0.0port_value:8080filter_chains:-filters:-name:envoy.filters.network.http_connection_managertyped_config:"@type":type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManagerstat_prefix:ingress_httproute_config:name:local_routevirtual_hosts:-name:local_servicedomains:["*"]routes:-match:prefix:"/"route:cluster:service_cluster1.3 查看Listener
# 查看Listener配置istioctl proxy-config listener<pod-name># 查看特定Listeneristioctl proxy-config listener