Skip to content

Commit

Permalink
chore: Bump multus version thin plugin (#976)
Browse files Browse the repository at this point in the history
- deploy multus thin plugin. update manifests accordingly
  • Loading branch information
e0ne authored Sep 17, 2024
2 parents 3323be8 + b76bed7 commit 42eccbc
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 23 deletions.
2 changes: 1 addition & 1 deletion deployment/network-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ secondaryNetwork:
# -- Multus image repository.
repository: ghcr.io/k8snetworkplumbingwg
# -- Multus image version.
version: v3.9.3
version: v4.1.0
# imagePullSecrets: []
# config: ''
# containerResources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ spec:
multus:
image: multus-cni
repository: ghcr.io/k8snetworkplumbingwg
version: v3.9.3
version: v4.1.0
config: ''
ipamPlugin:
image: whereabouts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ spec:
multus:
image: multus-cni
repository: ghcr.io/k8snetworkplumbingwg
version: v3.9.3
version: v4.1.0
config: ''
ipamPlugin:
image: whereabouts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ spec:
multus:
image: multus-cni
repository: ghcr.io/k8snetworkplumbingwg
version: v3.9.3
version: v4.1.0
config: ''
nvIpam:
image: nvidia-k8s-ipam
Expand Down
2 changes: 1 addition & 1 deletion example/crs/mellanox.com_v1alpha1_nicclusterpolicy_cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ spec:
multus:
image: multus-cni
repository: ghcr.io/k8snetworkplumbingwg
version: v3.9.3
version: v4.1.0
config: ''
ipamPlugin:
image: whereabouts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
singular: network-attachment-definition
kind: NetworkAttachmentDefinition
shortNames:
- net-attach-def
- net-attach-def
versions:
- name: v1
served: true
Expand Down
2 changes: 1 addition & 1 deletion hack/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ CniPlugins:
Multus:
image: multus-cni
repository: ghcr.io/k8snetworkplumbingwg
version: v3.9.3
version: v4.1.0
Ipoib:
image: ipoib-cni
repository: ghcr.io/mellanox
Expand Down
4 changes: 2 additions & 2 deletions manifests/state-multus-cni/0040-configmap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{{ if .CrSpec.Config -}}
{{- if .CrSpec.Config }}
kind: ConfigMap
apiVersion: v1
metadata:
Expand All @@ -22,4 +22,4 @@ metadata:
app: multus
data:
cni-conf.json: '{{ .CrSpec.Config }}'
{{ end -}}
{{- end }}
42 changes: 30 additions & 12 deletions manifests/state-multus-cni/0050-multus-ds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ spec:
name: multus
spec:
hostNetwork: true
priorityClassName: "system-node-critical"
terminationGracePeriodSeconds: 10
{{- if .NodeAffinity }}
affinity:
nodeAffinity:
Expand All @@ -40,21 +42,36 @@ spec:
- key: nvidia.com/gpu
operator: Exists
effect: NoSchedule
initContainers:
- name: install-multus-binary
image: {{ .CrSpec.Repository }}/{{ .CrSpec.Image }}:{{ .CrSpec.Version }}
command: ["/install_multus"]
args:
- "--type"
- "thin"
resources:
requests:
cpu: "10m"
memory: "15Mi"
securityContext:
privileged: true
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- name: cnibin
mountPath: /host/opt/cni/bin
mountPropagation: Bidirectional
containers:
- name: kube-multus
image: {{ .CrSpec.Repository }}/{{ .CrSpec.Image }}:{{ .CrSpec.Version }}
command: ["/entrypoint.sh"]
command: ["/thin_entrypoint"]
args:
- "--cni-version=0.3.1"
# /tmp/multus-conf/00-multus.conf is where multus-cfg ConfigMap is mounted then entrypoint.sh copy it to
# /host/etc/cni/net.d/00-multus.conf
- "--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"]
- "--multus-autoconfig-dir=/host/etc/cni/net.d"
- "--cni-conf-dir=/host/etc/cni/net.d"
- "--cleanup-config-on-exit"
- "--skip-config-watch"
{{- with .RuntimeSpec.ContainerResources }}
{{- with index . "kube-multus" }}
resources:
Expand All @@ -78,13 +95,14 @@ spec:
{{- end }}
securityContext:
privileged: true
terminationMessagePolicy: FallbackToLogsOnError
volumeMounts:
- name: cni
mountPath: /host/etc/cni/net.d
- name: cnibin
mountPath: /host/opt/cni/bin
{{- if .CrSpec.Config }}
- name: multus-cfg
- name: multus-cni-config
mountPath: /tmp/multus-conf
{{- end }}
volumes:
Expand All @@ -95,10 +113,10 @@ spec:
hostPath:
path: {{ .RuntimeSpec.CniBinDirectory }}
{{- if .CrSpec.Config }}
- name: multus-cfg
- name: multus-cni-config
configMap:
name: multus-cni-config
items:
- key: cni-conf.json
path: 00-multus.conf
- key: cni-conf.json
path: 00-multus.conf
{{- end }}
4 changes: 2 additions & 2 deletions pkg/state/state_multus_cni_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,14 @@ var _ = Describe("Multus CNI state", func() {

Expect(daemonSet.Spec.Template.Spec.Containers[0].VolumeMounts).To(ContainElement(
corev1.VolumeMount{
Name: "multus-cfg",
Name: "multus-cni-config",
MountPath: "/tmp/multus-conf",
},
))

Expect(daemonSet.Spec.Template.Spec.Volumes).To(ContainElement(
corev1.Volume{
Name: "multus-cfg",
Name: "multus-cni-config",
VolumeSource: corev1.VolumeSource{
ConfigMap: &corev1.ConfigMapVolumeSource{
LocalObjectReference: corev1.LocalObjectReference{
Expand Down

0 comments on commit 42eccbc

Please sign in to comment.