Skip to content

Commit f85190d

Browse files
committed
fix: edit Envoy config on startup to support case where IPv6 is disabled
1 parent 4ea372c commit f85190d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ansible/files/start-envoy.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#!/usr/bin/env bash
22
set -eou pipefail
3+
4+
if [[ $(cat /sys/module/ipv6/parameters/disable) = 1 ]]; then
5+
sed -i -e "s/address: '::'/address: '0.0.0.0'/" -e 's/ipv4_compat: true/ipv4_compat: false/' /etc/envoy/lds.yaml
6+
else
7+
sed -i -e "s/address: '0.0.0.0'/address: '::'/" -e 's/ipv4_compat: false/ipv4_compat: true/' /etc/envoy/lds.yaml
8+
fi
9+
310
# Workaround using `tee` to get `/dev/stdout` access logging to work, see:
411
# https://github.com/envoyproxy/envoy/issues/8297#issuecomment-620659781
5-
exec /opt/envoy --config-path /etc/envoy/envoy.yaml --restart-epoch "$RESTART_EPOCH" 2>&1 | tee
12+
exec /opt/envoy --config-path /etc/envoy/envoy.yaml --restart-epoch "${RESTART_EPOCH}" 2>&1 | tee

0 commit comments

Comments
 (0)