I'm using Envoy as my gateway of my backend micro-services, some of which provides some UDP services. So I need to configure my Envoy to route the UDP requests to the services.
Here is my config file of Envoy:
static_resources:
listeners:
- name: listener_udp_test
reuse_port: true
address:
socket_address:
protocol: UDP
address: 0.0.0.0
port_value: 22221
access_log:
- name: envoy.access_loggers.file
typed_config:
"@type": type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog
path: "/home/administrator/envoy/udp_test.log" # always empty!!!
udp_listener_config:
downstream_socket_config:
max_rx_datagram_size: 9000
listener_filters:
- name: envoy.filters.udp_listener.udp_proxy
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.udp.udp_proxy.v3.UdpProxyConfig
stat_prefix: example_ingress_udp
cluster: cluster_udp_test
upstream_socket_config:
max_rx_datagram_size: 9000
clusters:
- name: cluster_udp_test
connect_timeout: 30s
type: LOGICAL_DNS
dns_lookup_family: V4_ONLY
load_assignment:
cluster_name: cluster_udp_test
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 172.1.2.3
port_value: 22222
As you see, the gateway is listening the port 22221 and routing requests to 172.1.2.3:22222.
Let's say the IP of the gateway is 172.1.2.2 and I have a client 172.1.2.1.
I execute nc -l -u 172.1.2.3 22222 on the server 172.1.2.3 and I execute nc -u 172.1.2.2 22221 on the client 172.1.2.1.
Now, I can send messages from 172.1.2.1 to 172.1.2.3 as exptected. Everything works fine.
172.1.2.1 <---> 172.1.2.2(gateway) <---> 172.1.2.3
But, as you see I have configured a log file named udp_test.log. But after I running the gateway, this file does appear but it is always empty no matter how I send messages. As my understanding, needn't it store some log info about sending and receiving messages? If not, which kinds of info would be stored in this log file?