Skip to content

Commit

Permalink
bump multus version
Browse files Browse the repository at this point in the history
- deploy multus thin plugin. update manifests accordingly
- use sha256 digest as there is no recent release version
  of multus for now.

Signed-off-by: adrianc <[email protected]>
  • Loading branch information
adrianchiris committed Jun 24, 2024
1 parent cd0c869 commit 18296b0
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 22 deletions.
4 changes: 2 additions & 2 deletions deployment/network-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,9 @@ secondaryNetwork:
# memory: "50Mi"
multus:
deploy: true
image: multus-cni
image: multus-cni@sha256
repository: ghcr.io/k8snetworkplumbingwg
version: v3.9.3
version: ce1f91d6b49cb27bd0b92ac1c092727f0e5eca515728d994bfeda11e8b814cb8
# imagePullSecrets: []
# config: ''
# containerResources:
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
4 changes: 2 additions & 2 deletions hack/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ CniPlugins:
repository: ghcr.io/k8snetworkplumbingwg
version: v1.5.0
Multus:
image: multus-cni
image: multus-cni@sha256
repository: ghcr.io/k8snetworkplumbingwg
version: v3.9.3
version: cc3303520e83f8c158511d64176c136aeab3b22e190029611d005e90a5e57775
Ipoib:
image: ipoib-cni
repository: ghcr.io/mellanox
Expand Down
2 changes: 2 additions & 0 deletions manifests/state-multus-cni/0010-cluter_role.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rules:
- pods/status
verbs:
- get
- list
- watch
- update
- apiGroups:
- ""
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 }}
44 changes: 31 additions & 13 deletions manifests/state-multus-cni/0050-multus-ds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ spec:
tier: node
app: multus
name: multus
annotations:
cluster-autoscaler.kubernetes.io/enable-ds-eviction: "false"
spec:
hostNetwork: true
priorityClassName: "system-node-critical"
terminationGracePeriodSeconds: 10
{{- if .NodeAffinity }}
affinity:
nodeAffinity:
Expand All @@ -40,21 +44,34 @@ 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"
{{- 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
{{- end }}
- 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 @@ -281,14 +281,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 18296b0

Please sign in to comment.