Add Linux CP: create 'dataplane' network namespace, move to init-container.sh to do the plumbing

This commit is contained in:
Pim van Pelt
2025-05-03 13:45:51 +02:00
parent 234ff1d1d3
commit e71451f1c5
3 changed files with 36 additions and 10 deletions

12
files/init-container.sh Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
CONFIG=${CONFIG:="/etc/vpp/startup.conf"}
NETNS=${NETNS:="dataplane"}
echo "Creating dataplane namespace"
/usr/bin/mkdir -p /etc/netns/$NETNS
/usr/bin/touch /etc/netns/$NETNS/resolv.conf
/usr/sbin/ip netns add $NETNS
echo "Starting VPP"
exec /usr/bin/vpp -c $CONFIG