@@ -94,23 +94,38 @@ if podman manifest inspect quay.io/crcont/routes-controller:${OPENSHIFT_VERSION}
94
94
image_tag=${OPENSHIFT_VERSION}
95
95
fi
96
96
97
+ # create the tap device interface with specified mac address
98
+ # this mac address is used to allocate a specific IP to the VM
99
+ # when tap device is in use.
100
+ ${SSH} core@${VM_IP} ' sudo bash -x -s' << EOF
101
+ nmcli connection add type tun ifname tap0 con-name tap0 mode tap autoconnect yes 802-3-ethernet.cloned-mac-address 5A:94:EF:E4:0C:EE
102
+ EOF
103
+
104
+
97
105
# Add gvisor-tap-vsock service
98
106
${SSH} core@${VM_IP} ' sudo bash -x -s' << EOF
99
- podman pull quay.io/crcont/gvisor-tap-vsock:latest
100
- cat > /etc/containers/systemd/gvisor-tap-vsock.container <<EOF1
107
+ podman create --name=gvisor-tap-vsock quay.io/crcont/gvisor-tap-vsock:latest
108
+ podman cp gvisor-tap-vsock:/vm /usr/local/bin/gvforwarder
109
+ podman rm gvisor-tap-vsock
110
+ tee /etc/systemd/system/gv-user-network@.service <<TEE
101
111
[Unit]
102
- Description=gvisor-tap-vsock
103
- Before=nodeip-configuration.service
112
+ Description=gvisor-tap-vsock Network Traffic Forwarder
113
+ After=NetworkManager.service
114
+ BindsTo=sys-devices-virtual-net-%i.device
115
+ After=sys-devices-virtual-net-%i.device
104
116
105
- [Container ]
106
- Image=quay.io/crcont/gvisor-tap-vsock:latest
107
- Network=host
108
- PodmanArgs=--interactive --privileged --tty
109
- Volume=/etc/resolv.conf:/etc/resolv.conf
117
+ [Service ]
118
+ Restart=on-failure
119
+ Environment="GV_VSOCK_PORT=1024"
120
+ EnvironmentFile=-/etc/sysconfig/gv-user-network
121
+ ExecStart=/usr/local/bin/gvforwarder -preexisting -iface %i -url vsock://2:" \\\$ {GV_VSOCK_PORT}"/connect
110
122
111
123
[Install]
112
- WantedBy=default.target
113
- EOF1
124
+ WantedBy=multi-user.target
125
+
126
+ TEE
127
+ systemctl daemon-reload
128
+ systemctl enable gv-user-network@tap0.service
114
129
EOF
115
130
116
131
# Add dummy crio-wipe service to instance
0 commit comments