Skip to content

Commit 1ba8b81

Browse files
committed
Disable TCP early demux when pod-eni is enabled
1 parent 91ce9f5 commit 1ba8b81

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

scripts/init.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ HOST_IP=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/late
2828
PRIMARY_IF=$(ip -4 -o a | grep "$HOST_IP" | awk '{print $2}')
2929
sysctl -w "net.ipv4.conf.$PRIMARY_IF.rp_filter=2"
3030

31+
# Configure tcp_early_demux to enable kubelet to pod-eni communication
32+
# https://lwn.net/Articles/503420/ for background
33+
if [ "${ENABLE_TCP_EARLY_DEMUX:-false}" == "true" ]; then
34+
sysctl -w "net.ipv4.tcp_early_demux=1"
35+
else
36+
sysctl -w "net.ipv4.tcp_early_demux=0"
37+
fi
38+
3139
cat "/proc/sys/net/ipv4/conf/$PRIMARY_IF/rp_filter"
3240

3341
echo "CNI init container done"

0 commit comments

Comments
 (0)