-
Notifications
You must be signed in to change notification settings - Fork 54
gvforwarder as a systemd service #1052
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -16,7 +16,7 @@ INSTALL_DIR=${1:-crc-tmp-install-data} | |||||||||||||||||||||||||||||||||||
OPENSHIFT_VERSION=$(${JQ} -r .clusterInfo.openshiftVersion $INSTALL_DIR/crc-bundle-info.json) | ||||||||||||||||||||||||||||||||||||
BASE_DOMAIN=$(${JQ} -r .clusterInfo.baseDomain $INSTALL_DIR/crc-bundle-info.json) | ||||||||||||||||||||||||||||||||||||
BUNDLE_TYPE=$(${JQ} -r .type $INSTALL_DIR/crc-bundle-info.json) | ||||||||||||||||||||||||||||||||||||
ADDITIONAL_PACKAGES="cloud-init" | ||||||||||||||||||||||||||||||||||||
ADDITIONAL_PACKAGES="cloud-init gvisor-tap-vsock-gvforwarder" | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
case ${BUNDLE_TYPE} in | ||||||||||||||||||||||||||||||||||||
microshift) | ||||||||||||||||||||||||||||||||||||
|
@@ -94,23 +94,35 @@ 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' <<EOF | ||||||||||||||||||||||||||||||||||||
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 | ||||||||||||||||||||||||||||||||||||
EOF | ||||||||||||||||||||||||||||||||||||
Comment on lines
+97
to
+102
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (bug_risk): Consider handling potential errors when adding the tap device. Capture and check the nmcli command’s exit status (e.g., check $?) so any failures in creating the tap interface are detected and handled.
Suggested change
|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
# Add gvisor-tap-vsock service | ||||||||||||||||||||||||||||||||||||
${SSH} core@${VM_IP} 'sudo bash -x -s' <<EOF | ||||||||||||||||||||||||||||||||||||
podman pull quay.io/crcont/gvisor-tap-vsock:latest | ||||||||||||||||||||||||||||||||||||
cat > /etc/containers/systemd/gvisor-tap-vsock.container <<EOF1 | ||||||||||||||||||||||||||||||||||||
tee /etc/systemd/system/gv-user-network@.service <<TEE | ||||||||||||||||||||||||||||||||||||
[Unit] | ||||||||||||||||||||||||||||||||||||
Description=gvisor-tap-vsock | ||||||||||||||||||||||||||||||||||||
Before=nodeip-configuration.service | ||||||||||||||||||||||||||||||||||||
Description=gvisor-tap-vsock Network Traffic Forwarder | ||||||||||||||||||||||||||||||||||||
After=NetworkManager.service | ||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @anjannath networkManager is responsible to activate tun/tap device so it that is not even active how would this work. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Is it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I spoke with Anjan, and the TAP creation should be independent of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In short, rather use |
||||||||||||||||||||||||||||||||||||
BindsTo=sys-devices-virtual-net-%i.device | ||||||||||||||||||||||||||||||||||||
After=sys-devices-virtual-net-%i.device | ||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know but I can try to do that also. |
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
[Container] | ||||||||||||||||||||||||||||||||||||
Image=quay.io/crcont/gvisor-tap-vsock:latest | ||||||||||||||||||||||||||||||||||||
Network=host | ||||||||||||||||||||||||||||||||||||
PodmanArgs=--interactive --privileged --tty | ||||||||||||||||||||||||||||||||||||
Volume=/etc/resolv.conf:/etc/resolv.conf | ||||||||||||||||||||||||||||||||||||
[Service] | ||||||||||||||||||||||||||||||||||||
Restart=on-failure | ||||||||||||||||||||||||||||||||||||
Environment="GV_VSOCK_PORT=1024" | ||||||||||||||||||||||||||||||||||||
EnvironmentFile=-/etc/sysconfig/gv-user-network | ||||||||||||||||||||||||||||||||||||
ExecStart=/usr/libexec/podman/gvforwarder -preexisting -iface %i -url vsock://2:"\\\${GV_VSOCK_PORT}"/connect | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
[Install] | ||||||||||||||||||||||||||||||||||||
WantedBy=default.target | ||||||||||||||||||||||||||||||||||||
EOF1 | ||||||||||||||||||||||||||||||||||||
WantedBy=multi-user.target | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
TEE | ||||||||||||||||||||||||||||||||||||
systemctl daemon-reload | ||||||||||||||||||||||||||||||||||||
systemctl enable gv-user-network@tap0.service | ||||||||||||||||||||||||||||||||||||
EOF | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
# Add dummy crio-wipe service to instance | ||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does mean we need to keep this package up to date along with Podman's timeline/schedule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gbraad This is subpackage and I think as of now it is not used by podman machine but build everytime there is release of gvisor-tap-vsock so we can just use it without maintaining (like building ourself).