@@ -97,12 +97,40 @@ if podman manifest inspect quay.io/crcont/routes-controller:${OPENSHIFT_VERSION}
97
97
image_tag=${OPENSHIFT_VERSION}
98
98
fi
99
99
100
+ # create the tap device interface with specified mac address
101
+ # this mac address is used to allocate a specific IP to the VM
102
+ # when tap device is in use.
103
+ ${SSH} core@${VM_IP} ' sudo bash -x -s' << EOF
104
+ nmcli connection delete tap0
105
+ 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
106
+ EOF
107
+
108
+
100
109
# Add gvisor-tap-vsock service
101
110
${SSH} core@${VM_IP} ' sudo bash -x -s' << EOF
102
- podman create --name=gvisor-tap-vsock --privileged --net=host -v /etc/resolv.conf:/etc/resolv.conf -it quay.io/crcont/gvisor-tap-vsock:latest
103
- podman generate systemd --restart-policy=no gvisor-tap-vsock > /etc/systemd/system/gvisor-tap-vsock.service
111
+ podman create --name=gvisor-tap-vsock quay.io/crcont/gvisor-tap-vsock:latest
112
+ podman cp gvisor-tap-vsock:/vm /usr/local/bin/gvforwarder
113
+ podman rm gvisor-tap-vsock
114
+ tee /etc/systemd/system/gv-user-network@.service <<TEE
115
+ [Unit]
116
+ Description=gvisor-tap-vsock Network Traffic Forwarder
117
+ After=NetworkManager.service
118
+ BindsTo=sys-devices-virtual-net-%i.device
119
+ After=sys-devices-virtual-net-%i.device
120
+
121
+ [Service]
122
+ Environment=GV_VSOCK_PORT="1024"
123
+ EnvironmentFile=-/etc/sysconfig/gv-user-network
124
+ ExecStart=/usr/local/bin/gvforwarder -preexisting -iface %i -url vsock://2:\\\$ {GV_VSOCK_PORT}/connect -debug
125
+
126
+ [Install]
127
+ WantedBy=multi-user.target
128
+
129
+ TEE
104
130
systemctl daemon-reload
105
- systemctl enable gvisor-tap-vsock.service
131
+ systemctl enable gv-user-network@tap0.service
132
+ systemctl start gv-user-network@tap0.service
133
+
106
134
EOF
107
135
108
136
# Add dummy crio-wipe service to instance
0 commit comments