envoy

Envoy的静态配置使用方法

2022-9-15
technology
envoy

Envoy静态配置 # L4转发 # 下面的例子是配置4层转发, 将443端口的流量都代理到www.example.com对应的后端的443端口上, 如下: static_resources:listeners:- name:listener_0address:socket_address:protocol:TCPaddress:0.0.0.0port_value:443filter_chains:- filters:- name:envoy.filters.network.tcp_proxytyped_config:"@type": type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxystat_prefix:tcp_443cluster:cluster_0clusters:- name:cluster_0type:LOGICAL_DNSdns_lookup_family:V4_ONLYload_assignment:cluster_name:cluster_0endpoints:- lb_endpoints:- endpoint:address:socket_address:address:www.example.comport_value:443启动Envoy # 将创建的静态配置文件envoy-custom.yaml映射到容器内部, 启动: docker run -d --name=envoy --restart=always \ -p 443:443 -v /root/envoy-custom.yaml:/etc/envoy/envoy.yaml \ envoyproxy/envoy:v1.22.2