Skip to content

Commit 7eb7ed6

Browse files
committed
underlay: fix network manager operation (#2546)
1 parent 8f67a32 commit 7eb7ed6

File tree

5 files changed

+27
-2
lines changed

5 files changed

+27
-2
lines changed

dist/images/install.sh

+8
Original file line numberDiff line numberDiff line change
@@ -3143,6 +3143,8 @@ spec:
31433143
fieldPath: status.podIPs
31443144
- name: ENABLE_BIND_LOCAL_IP
31453145
value: "$ENABLE_BIND_LOCAL_IP"
3146+
- name: DBUS_SYSTEM_BUS_ADDRESS
3147+
value: "unix:path=/host/var/run/dbus/system_bus_socket"
31463148
volumeMounts:
31473149
- name: host-modules
31483150
mountPath: /lib/modules
@@ -3158,6 +3160,9 @@ spec:
31583160
mountPropagation: Bidirectional
31593161
- mountPath: /run/ovn
31603162
name: host-run-ovn
3163+
- mountPath: /host/var/run/dbus
3164+
name: host-dbus
3165+
mountPropagation: HostToContainer
31613166
- mountPath: /var/run/netns
31623167
name: host-ns
31633168
mountPropagation: HostToContainer
@@ -3221,6 +3226,9 @@ spec:
32213226
- name: host-ns
32223227
hostPath:
32233228
path: /var/run/netns
3229+
- name: host-dbus
3230+
hostPath:
3231+
path: /var/run/dbus
32243232
- name: host-log-ovs
32253233
hostPath:
32263234
path: /var/log/openvswitch

kubeovn-helm/templates/ovncni-ds.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ spec:
9696
fieldPath: status.podIPs
9797
- name: ENABLE_BIND_LOCAL_IP
9898
value: "{{- .Values.func.ENABLE_BIND_LOCAL_IP }}"
99+
- name: DBUS_SYSTEM_BUS_ADDRESS
100+
value: "unix:path=/host/var/run/dbus/system_bus_socket"
99101
volumeMounts:
100102
- name: host-modules
101103
mountPath: /lib/modules
@@ -111,6 +113,9 @@ spec:
111113
mountPropagation: Bidirectional
112114
- mountPath: /run/ovn
113115
name: host-run-ovn
116+
- mountPath: /host/var/run/dbus
117+
name: host-dbus
118+
mountPropagation: HostToContainer
114119
- mountPath: /var/run/netns
115120
name: host-ns
116121
mountPropagation: HostToContainer
@@ -174,6 +179,9 @@ spec:
174179
- name: host-ns
175180
hostPath:
176181
path: /var/run/netns
182+
- name: host-dbus
183+
hostPath:
184+
path: /var/run/dbus
177185
- name: kube-ovn-log
178186
hostPath:
179187
path: /var/log/kube-ovn

pkg/daemon/init_linux.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ func nmSetManaged(device string, managed bool) error {
3939
return nil
4040
}
4141

42+
klog.Infof(`setting device %s NetworkManager property "managed" to %v`, device, managed)
4243
if err = d.SetPropertyManaged(managed); err != nil {
4344
klog.Errorf("failed to set device property managed to %v: %v", managed, err)
4445
return err
@@ -97,7 +98,7 @@ func changeProvideNicName(current, target string) (bool, error) {
9798

9899
// set link unmanaged by NetworkManager
99100
if err = nmSetManaged(current, false); err != nil {
100-
klog.Errorf("failed set device %s to unmanaged by NetworkManager: %v", current, err)
101+
klog.Errorf("failed set device %s unmanaged by NetworkManager: %v", current, err)
101102
return false, err
102103
}
103104

pkg/daemon/ovs_linux.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ func configProviderNic(nicName, brName string) (int, error) {
588588

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

yamls/kube-ovn.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ spec:
190190
valueFrom:
191191
fieldRef:
192192
fieldPath: status.podIPs
193+
- name: DBUS_SYSTEM_BUS_ADDRESS
194+
value: "unix:path=/host/var/run/dbus/system_bus_socket"
193195
volumeMounts:
194196
- name: host-modules
195197
mountPath: /lib/modules
@@ -202,6 +204,9 @@ spec:
202204
name: host-run-ovs
203205
- mountPath: /run/ovn
204206
name: host-run-ovn
207+
- mountPath: /host/var/run/dbus
208+
name: host-dbus
209+
mountPropagation: HostToContainer
205210
- mountPath: /var/run/netns
206211
name: host-ns
207212
mountPropagation: HostToContainer
@@ -260,6 +265,9 @@ spec:
260265
- name: host-ns
261266
hostPath:
262267
path: /var/run/netns
268+
- name: host-dbus
269+
hostPath:
270+
path: /var/run/dbus
263271
- name: host-log-ovs
264272
hostPath:
265273
path: /var/log/openvswitch

0 commit comments

Comments
 (0)