Skip to content

Commit 9fcab65

Browse files
authored
fix: use the same cni dir as the mount (#5928)
* fix: use the same cni dir as the mount Signed-off-by: Bryan Lee <me@bryanl.ee> * feat: add value for cni-conf-dir Signed-off-by: Bryan Lee <me@bryanl.ee> --------- Signed-off-by: Bryan Lee <me@bryanl.ee>
1 parent dc0e270 commit 9fcab65

File tree

5 files changed

+17
-4
lines changed

5 files changed

+17
-4
lines changed

charts/kube-ovn-v2/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,15 @@ false
649649
</td>
650650
<td>Location of the CNI configuration inside the agent's pod.</td>
651651
</tr>
652+
<tr>
653+
<td>cni.mountConfigDirectory</td>
654+
<td>string</td>
655+
<td><pre lang="json">
656+
"/etc/cni/net.d"
657+
</pre>
658+
</td>
659+
<td>Location of the CNI configuration to be mounted inside the pod.</td>
660+
</tr>
652661
<tr>
653662
<td>cni.mountToolingDirectory</td>
654663
<td>bool</td>

charts/kube-ovn-v2/templates/agent/agent-daemonset.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ spec:
7777
imagePullPolicy: {{ .Values.image.pullPolicy }}
7878
command:
7979
- /kube-ovn/install-cni.sh
80-
- --cni-conf-dir={{ .Values.cni.configDirectory }}
80+
- --cni-conf-dir={{ .Values.cni.mountConfigDirectory }}
8181
- --cni-conf-file={{ .Values.cni.localConfigFile }}
8282
- --cni-conf-name={{- .Values.cni.configPriority -}}-kube-ovn.conflist
8383
securityContext:
@@ -86,7 +86,7 @@ spec:
8686
volumeMounts:
8787
- mountPath: /opt/cni/bin
8888
name: cni-bin
89-
- mountPath: /etc/cni/net.d
89+
- mountPath: {{ .Values.cni.mountConfigDirectory }}
9090
name: cni-conf
9191
{{- if .Values.cni.mountToolingDirectory }}
9292
- mountPath: /usr/local/bin

charts/kube-ovn-v2/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ cni:
240240
# -- Location of the CNI configuration on the node.
241241
# @section -- CNI configuration
242242
configDirectory: "/etc/cni/net.d"
243+
# -- Location of the CNI configuration to be mounted inside the pod.
244+
# @section -- CNI configuration
245+
mountConfigDirectory: "/etc/cni/net.d"
243246
# -- Location on the node where the agent will inject the Kube-OVN binary.
244247
# @section -- CNI configuration
245248
binaryDirectory: "/opt/cni/bin"

charts/kube-ovn/templates/ovncni-ds.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ spec:
6161
imagePullPolicy: {{ .Values.image.pullPolicy }}
6262
command:
6363
- /kube-ovn/install-cni.sh
64-
- --cni-conf-dir={{ .Values.cni_conf.CNI_CONF_DIR }}
64+
- --cni-conf-dir={{ .Values.cni_conf.MOUNT_CNI_CONF_DIR }}
6565
- --cni-conf-file={{ .Values.cni_conf.CNI_CONF_FILE }}
6666
- --cni-conf-name={{- .Values.cni_conf.CNI_CONFIG_PRIORITY -}}-kube-ovn.conflist
6767
securityContext:
@@ -70,7 +70,7 @@ spec:
7070
volumeMounts:
7171
- mountPath: /opt/cni/bin
7272
name: cni-bin
73-
- mountPath: /etc/cni/net.d
73+
- mountPath: {{ .Values.cni_conf.MOUNT_CNI_CONF_DIR }}
7474
name: cni-conf
7575
{{- if .Values.cni_conf.MOUNT_LOCAL_BIN_DIR }}
7676
- mountPath: /usr/local/bin

charts/kube-ovn/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ debug:
120120
cni_conf:
121121
CNI_CONFIG_PRIORITY: "01"
122122
CNI_CONF_DIR: "/etc/cni/net.d"
123+
MOUNT_CNI_CONF_DIR: "/etc/cni/net.d"
123124
CNI_BIN_DIR: "/opt/cni/bin"
124125
CNI_CONF_FILE: "/kube-ovn/01-kube-ovn.conflist"
125126
LOCAL_BIN_DIR: "/usr/local/bin"

0 commit comments

Comments
 (0)