From 53cf03be6d95ee1ea22982bc9ed56be957be484e Mon Sep 17 00:00:00 2001 From: Gunjan Vyas Date: Tue, 21 Jan 2025 12:31:44 +0530 Subject: [PATCH] gvforwarder as a systemd service - Create a tap device using nmcli with a hardcoded mac address - Start gvforwarder systemd service which will use this device Signed-off-by: vyasgun --- ci_microshift.sh | 1 + createdisk.sh | 34 +++++++++++++++++++++++++++++++--- gv-user-network@.service | 11 +++++++++++ 3 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 gv-user-network@.service diff --git a/ci_microshift.sh b/ci_microshift.sh index c486f189..2ac726b5 100755 --- a/ci_microshift.sh +++ b/ci_microshift.sh @@ -10,6 +10,7 @@ sudo yum install -y make golang # Set the zstd compression level to 10 to have faster # compression while keeping a reasonable bundle size. export CRC_ZSTD_EXTRA_FLAGS="-10" + ./createdisk.sh crc-tmp-install-data # Delete the crc domain which created by snc so it can created diff --git a/createdisk.sh b/createdisk.sh index 054e516f..f9040319 100755 --- a/createdisk.sh +++ b/createdisk.sh @@ -97,12 +97,40 @@ if podman manifest inspect quay.io/crcont/routes-controller:${OPENSHIFT_VERSION} image_tag=${OPENSHIFT_VERSION} fi +# create the tap device interface with specified mac address +# this mac address is used to allocate a specific IP to the VM +# when tap device is in use. +${SSH} core@${VM_IP} 'sudo bash -x -s' < /etc/systemd/system/gvisor-tap-vsock.service + podman create --name=gvisor-tap-vsock quay.io/crcont/gvisor-tap-vsock:latest + podman cp gvisor-tap-vsock:/vm /usr/local/bin/gvforwarder + podman rm gvisor-tap-vsock + tee /etc/systemd/system/gv-user-network@.service <