Skip to content

Commit

Permalink
chore: Short term solution for failed multus pod in network-operator …
Browse files Browse the repository at this point in the history
…upgrade to 24.10.x

Signed-off-by: Ido Heyvi <[email protected]>
  • Loading branch information
heyvister1 committed Nov 20, 2024
1 parent 1acf567 commit c9e368e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
19 changes: 17 additions & 2 deletions manifests/state-multus-cni/0050-multus-ds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ spec:
name: multus
spec:
hostNetwork: true
priorityClassName: "system-node-critical"
terminationGracePeriodSeconds: 10
{{- if .NodeAffinity }}
affinity:
nodeAffinity:
Expand All @@ -42,6 +40,9 @@ spec:
- key: nvidia.com/gpu
operator: Exists
effect: NoSchedule
{{- if hasPrefix .CrSpec.Version "v4" }}
priorityClassName: "system-node-critical"
terminationGracePeriodSeconds: 10
initContainers:
- name: install-multus-binary
image: {{ .CrSpec.Repository }}/{{ .CrSpec.Image }}:{{ .CrSpec.Version }}
Expand All @@ -60,9 +61,11 @@ spec:
- name: cnibin
mountPath: /host/opt/cni/bin
mountPropagation: Bidirectional
{{- end }}
containers:
- name: kube-multus
image: {{ .CrSpec.Repository }}/{{ .CrSpec.Image }}:{{ .CrSpec.Version }}
{{- if hasPrefix .CrSpec.Version "v4" }}
command: ["/thin_entrypoint"]
args:
# /tmp/multus-conf/00-multus.conf is where multus-cfg ConfigMap is mounted then entrypoint.sh copy it to
Expand All @@ -72,6 +75,18 @@ spec:
- "--cni-conf-dir=/host/etc/cni/net.d"
- "--cleanup-config-on-exit"
- "--skip-config-watch"
{{- else }}
command: ["/entrypoint.sh"]
args:
- "--cni-version=0.3.1"
- "--multus-conf-file={{- if .CrSpec.Config -}}/tmp/multus-conf/00-multus.conf{{- else -}}auto{{- end -}}"
# Remove multus config file to prevent failing of creating/deleting pods since multus will fail due to
# permission issue, https://github.com/intel/multus-cni/issues/592
lifecycle:
preStop:
exec:
command: ["/bin/sh", "-c", "rm -f /host/etc/cni/net.d/00-multus.conf"]
{{- end }}
{{- with .RuntimeSpec.ContainerResources }}
{{- with index . "kube-multus" }}
resources:
Expand Down
1 change: 1 addition & 0 deletions pkg/render/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ func (r *textTemplateRenderer) renderFile(filePath string, data *TemplatingData)
"indent": indent,
"nindent": nindent,
"nindentPrefix": nindentPrefix,
"hasPrefix": strings.HasPrefix,
})

if data.Funcs != nil {
Expand Down

0 comments on commit c9e368e

Please sign in to comment.