Skip to content

Commit 92eb281

Browse files
committed
feat(helm): cni config refactor
Signed-off-by: SkalaNetworks <[email protected]>
1 parent a49a695 commit 92eb281

File tree

6 files changed

+25
-16
lines changed

6 files changed

+25
-16
lines changed

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

+8-8
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ spec:
7676
imagePullPolicy: {{ .Values.image.pullPolicy }}
7777
command:
7878
- /kube-ovn/install-cni.sh
79-
- --cni-conf-dir={{ .Values.cni_conf.CNI_CONF_DIR }}
80-
- --cni-conf-file={{ .Values.cni_conf.CNI_CONF_FILE }}
81-
- --cni-conf-name={{- .Values.cni_conf.CNI_CONFIG_PRIORITY -}}-kube-ovn.conflist
79+
- --cni-conf-dir={{ .Values.cni.configDirectory }}
80+
- --cni-conf-file={{ .Values.cni.localConfigFile }}
81+
- --cni-conf-name={{- .Values.cni.configPriority -}}-kube-ovn.conflist
8282
securityContext:
8383
runAsUser: 0
8484
privileged: true
@@ -87,7 +87,7 @@ spec:
8787
name: cni-bin
8888
- mountPath: /etc/cni/net.d
8989
name: cni-conf
90-
{{- if .Values.cni_conf.MOUNT_LOCAL_BIN_DIR }}
90+
{{- if .Values.cni.mountToolingDirectory }}
9191
- mountPath: /usr/local/bin
9292
name: local-bin
9393
{{- end }}
@@ -251,10 +251,10 @@ spec:
251251
path: /run/ovn
252252
- name: cni-conf
253253
hostPath:
254-
path: {{ .Values.cni_conf.CNI_CONF_DIR }}
254+
path: {{ .Values.cni.configDirectory }}
255255
- name: cni-bin
256256
hostPath:
257-
path: {{ .Values.cni_conf.CNI_BIN_DIR }}
257+
path: {{ .Values.cni.binaryDirectory }}
258258
- name: host-ns
259259
hostPath:
260260
path: /var/run/netns
@@ -273,8 +273,8 @@ spec:
273273
- name: host-log-ovn
274274
hostPath:
275275
path: {{ .Values.log_conf.LOG_DIR }}/ovn
276-
{{- if .Values.cni_conf.MOUNT_LOCAL_BIN_DIR }}
276+
{{- if .Values.cni.mountToolingDirectory }}
277277
- name: local-bin
278278
hostPath:
279-
path: {{ .Values.cni_conf.LOCAL_BIN_DIR }}
279+
path: {{ .Values.cni.toolingDirectory }}
280280
{{- end }}

charts/kube-ovn/values.yaml

+17-8
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,21 @@ debug:
113113
ENABLE_MIRROR: false
114114
MIRROR_IFACE: "mirror0"
115115

116-
cni_conf:
117-
CNI_CONFIG_PRIORITY: "01"
118-
CNI_CONF_DIR: "/etc/cni/net.d"
119-
CNI_BIN_DIR: "/opt/cni/bin"
120-
CNI_CONF_FILE: "/kube-ovn/01-kube-ovn.conflist"
121-
LOCAL_BIN_DIR: "/usr/local/bin"
122-
MOUNT_LOCAL_BIN_DIR: false
116+
# CNI binary/configuration injected on the nodes
117+
cni:
118+
# -- Location of the CNI configuration on the node
119+
configDirectory: "/etc/cni/net.d"
120+
# -- Location on the node where the agent will inject the Kube-OVN binary
121+
binaryDirectory: "/opt/cni/bin"
122+
# -- Location of the CNI configuration inside the agent's pod
123+
localConfigFile: "/kube-ovn/01-kube-ovn.conflist"
124+
# -- Location on the node where the CNI will install Kube-OVN's tooling
125+
toolingDirectory: "/usr/local/bin"
126+
# -- Whether to mount the node's tooling directory into the pod
127+
mountToolingDirectory: false
128+
# -- Priority of Kube-OVN within the CNI configuration directory on the node
129+
# Should be a string representing a double-digit integer
130+
configPriority: "01"
123131

124132
kubelet_conf:
125133
KUBELET_DIR: "/var/lib/kubelet"
@@ -163,6 +171,7 @@ natGw:
163171
tag: v1.14.0
164172
pullPolicy: IfNotPresent
165173
# -- Network attachment definition used to reach the API server when running on BGP mode
174+
# By default, equals the value set at .apiNad.provider
166175
# See https://kubeovn.github.io/docs/stable/en/advance/with-bgp/
167176
apiNadProvider: "{{ .Values.apiNad.name }}.{{ .Values.namespace }}.ovn"
168177

@@ -403,7 +412,7 @@ extraObjects: []
403412
# - apiVersion: v1
404413
# kind: ConfigMap
405414
# metadata:
406-
# name: cni-config
415+
# name: cilium-chaining
407416
# data:
408417
# cni-config: |-
409418
# {

0 commit comments

Comments
 (0)