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 b8fc9d9 commit 955cf0f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
8 changes: 8 additions & 0 deletions dist/images/install.sh
Expand Up @@ -3223,6 +3223,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 @@ -3238,6 +3240,9 @@ spec:
mountPropagation: Bidirectional
- 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: Bidirectional
Expand Down Expand Up @@ -3300,6 +3305,9 @@ spec:
- name: host-ns
hostPath:
path: /var/run/netns
- name: host-dbus
hostPath:
path: /var/run/dbus
- name: host-log-ovs
hostPath:
path: /var/log/openvswitch
Expand Down
8 changes: 8 additions & 0 deletions kubeovn-helm/templates/ovncni-ds.yaml
Expand Up @@ -102,6 +102,8 @@ spec:
fieldPath: status.podIPs
- name: ENABLE_BIND_LOCAL_IP
value: "{{- .Values.func.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 @@ -117,6 +119,9 @@ spec:
mountPropagation: Bidirectional
- 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 @@ -179,6 +184,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_linux.go
Expand Up @@ -39,6 +39,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 @@ -97,7 +98,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_linux.go
Expand Up @@ -906,7 +906,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
Expand Up @@ -190,6 +190,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 @@ -202,6 +204,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 @@ -259,6 +264,9 @@ spec:
- name: host-ns
hostPath:
path: /var/run/netns
- name: host-dbus
hostPath:
path: /var/run/dbus
- name: host-log-ovs
hostPath:
path: /var/log/openvswitch
Expand Down

0 comments on commit 955cf0f

Please sign in to comment.