Commit d1723fd
authored
listener: Support for Linux network namespaces (#39517)
This changes the listener to make use of the
`network_namespace_filepath` field of the
`SocketAddress` that specifies the address/port to listen on. When the
field is specified, the
underlying sockets used to listen are created in the network namespace
referenced by the filepath.
This allows the Envoy process to listen for connections from _other_
network namespaces, but to
proxy those connections through the Envoy's network namespace.
### What is a network namespace?
Each Linux network namespace has its own independent network devices, IP
addresses, routing tables,
and firewall rules. This isolation allows multiple processes or
containers to run on the same host
machine with their own distinct network configurations, preventing
conflicts.
### Motivation
Currently, Envoy listeners bind to network interfaces on the host's
default network namespace. In
environments where Envoy needs to operate within a specific, isolated
network namespace (like a
container with a custom network configuration or a mesh sidecar within a
k8s pod), this change
allows a single Envoy process to act like a sidecar for multiple pods.
Since network namespaces are a Linux feature, there is no change for
other OSes.
Risk Level:
Low. Only matters if the field is configured and only on Linux.
Testing:
Unit testing w/ mocks. Direct verification or integration testing
requires privileges.
Docs Changes:
Proto docs updated.
Release Notes:
Done
Platform Specific Features:
Linux, only.
Progress toward issue #38947
---------
Signed-off-by: Tony Allen <txallen@google.com>
Signed-off-by: Tony Allen <tony@allen.gg>1 parent 5a80c0e commit d1723fd
File tree
24 files changed
+318
-62
lines changed- api/envoy/config/core/v3
- changelogs
- envoy
- api
- network
- mobile/library/common/network
- source/common
- api/posix
- listener_manager
- network
- test
- common/network
- extensions/network/dns_resolver/cares
- mocks
- api
- network
- tools/spelling
24 files changed
+318
-62
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
104 | 113 | | |
105 | 114 | | |
106 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
163 | 166 | | |
164 | 167 | | |
165 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | 15 | | |
18 | 16 | | |
19 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
242 | 247 | | |
243 | 248 | | |
244 | 249 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1155 | 1155 | | |
1156 | 1156 | | |
1157 | 1157 | | |
1158 | | - | |
1159 | | - | |
1160 | | - | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
1161 | 1161 | | |
1162 | 1162 | | |
1163 | 1163 | | |
1164 | 1164 | | |
1165 | 1165 | | |
1166 | | - | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
1167 | 1169 | | |
1168 | 1170 | | |
1169 | 1171 | | |
| |||
0 commit comments