Skip to content

Commit

Permalink
underlay: fix network manager operation (#2546)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzujian committed Mar 24, 2023
1 parent 0b0091c commit 8473f27
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
8 changes: 8 additions & 0 deletions dist/images/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2094,6 +2094,8 @@ spec:
fieldPath: status.podIPs
- name: ENABLE_BIND_LOCAL_IP
value: "$ENABLE_BIND_LOCAL_IP"
- name: DBUS_SYSTEM_BUS_ADDRESS
value: "unix:path=/host/var/run/dbus/system_bus_socket"
volumeMounts:
- name: host-modules
mountPath: /lib/modules
Expand All @@ -2106,6 +2108,9 @@ spec:
name: host-run-ovs
- mountPath: /run/ovn
name: host-run-ovn
- mountPath: /host/var/run/dbus
name: host-dbus
mountPropagation: HostToContainer
- mountPath: /var/run/netns
name: host-ns
mountPropagation: HostToContainer
Expand Down Expand Up @@ -2160,6 +2165,9 @@ spec:
- name: host-ns
hostPath:
path: /var/run/netns
- name: host-dbus
hostPath:
path: /var/run/dbus
- name: kube-ovn-log
hostPath:
path: /var/log/kube-ovn
Expand Down
3 changes: 2 additions & 1 deletion pkg/daemon/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ func nmSetManaged(device string, managed bool) error {
return nil
}

klog.Infof(`setting device %s NetworkManager property "managed" to %v`, device, managed)
if err = d.SetPropertyManaged(managed); err != nil {
klog.Errorf("failed to set device property managed to %v: %v", managed, err)
return err
Expand Down Expand Up @@ -187,7 +188,7 @@ func changeProvideNicName(current, target string) (bool, error) {

// set link unmanaged by NetworkManager
if err = nmSetManaged(current, false); err != nil {
klog.Errorf("failed set device %s to unmanaged by NetworkManager: %v", current, err)
klog.Errorf("failed set device %s unmanaged by NetworkManager: %v", current, err)
return false, err
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/daemon/ovs.go
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ func configProviderNic(nicName, brName string) (int, error) {

// set link unmanaged by NetworkManager
if err = nmSetManaged(nicName, false); err != nil {
klog.Errorf("failed set device %s to unmanaged by NetworkManager: %v", nicName, err)
klog.Errorf("failed set device %s unmanaged by NetworkManager: %v", nicName, err)
return 0, err
}

Expand Down
8 changes: 8 additions & 0 deletions yamls/kube-ovn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ spec:
valueFrom:
fieldRef:
fieldPath: status.podIPs
- name: DBUS_SYSTEM_BUS_ADDRESS
value: "unix:path=/host/var/run/dbus/system_bus_socket"
volumeMounts:
- name: host-modules
mountPath: /lib/modules
Expand All @@ -201,6 +203,9 @@ spec:
name: host-run-ovs
- mountPath: /run/ovn
name: host-run-ovn
- mountPath: /host/var/run/dbus
name: host-dbus
mountPropagation: HostToContainer
- mountPath: /var/run/netns
name: host-ns
mountPropagation: HostToContainer
Expand Down Expand Up @@ -253,6 +258,9 @@ spec:
- name: host-ns
hostPath:
path: /var/run/netns
- name: host-dbus
hostPath:
path: /var/run/dbus
- name: localtime
hostPath:
path: /etc/localtime
Expand Down

0 comments on commit 8473f27

Please sign in to comment.