Skip to content

Commit

Permalink
Change system dependencies for "post" systemd service
Browse files Browse the repository at this point in the history
This is required to be compatible with OVS installations, which use SysV init scripts (wrapped with systemd-sysv-generator).
On such systems, OVS may depend on the network-online.target, so the start order of services changes (OVS will start after the "post" service).
The proposed solution is to add the following explicit dependencies
After: openvswitch-switch.service
Before: kubelet.service.

Note:  the dependency is ignored if the openvswitch-switch.service is not found.
Signed-off-by: Yury Kulazhenkov <[email protected]>
  • Loading branch information
ykulazhenkov committed Apr 12, 2024
1 parent 2d2e5a4 commit 1841fbe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
contents: |
[Unit]
Description=Configures SRIOV NIC - post network configuration
After=systemd-networkd-wait-online.service NetworkManager-wait-online.service
Before=network-online.target
After=systemd-networkd-wait-online.service NetworkManager-wait-online.service openvswitch-switch.service
Before=kubelet.service
[Service]
Type=oneshot
ExecStart=/var/lib/sriov/sriov-network-config-daemon -v 2 --zap-log-level 2 service --phase post
StandardOutput=journal+console
[Install]
WantedBy=network-online.target
WantedBy=multi-user.target
enabled: true
name: sriov-config-post-network.service
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ spec:
# Removal of this file signals firstboot completion
ConditionPathExists=!/etc/ignition-machine-config-encapsulated.json
Description=Configures SRIOV NIC - post network configuration
After=systemd-networkd-wait-online.service NetworkManager-wait-online.service
Before=network-online.target
After=systemd-networkd-wait-online.service NetworkManager-wait-online.service openvswitch-switch.service
Before=kubelet.service
[Service]
Type=oneshot
ExecStart=/var/lib/sriov/sriov-network-config-daemon service -v {{ .LogLevel }} --zap-log-level {{ .LogLevel }} --phase post
StandardOutput=journal+console
[Install]
WantedBy=network-online.target
WantedBy=multi-user.target
enabled: true
name: "sriov-config-post-network.service"

0 comments on commit 1841fbe

Please sign in to comment.