Skip to content

Commit

Permalink
Deploy RDMA CNI as a part of SR-IOV Operator
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Kolodiazhnyi <ikolodiazhny@nvidia.com>
  • Loading branch information
e0ne committed Apr 25, 2024
1 parent 6d367c6 commit e4b3a56
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions bindata/manifests/daemon/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@ spec:
mountPath: /host/etc/os-release
readOnly: true
{{- end }}
{{- if .RDMACNIImage }}
- name: rdma-cni
image: {{.RDMACNIImage}}
args: ["--no-sleep"]
securityContext:
privileged: true
resources:
requests:
cpu: 10m
memory: 10Mi
volumeMounts:
- name: cnibin
mountPath: /host/opt/cni/bin
{{- end }}
{{- if .UsedSystemdMode}}
- name: sriov-service-copy
image: {{.Image}}
Expand Down
1 change: 1 addition & 0 deletions controllers/sriovoperatorconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ func (r *SriovOperatorConfigReconciler) syncConfigDaemonSet(ctx context.Context,
data.Data["SRIOVCNIImage"] = os.Getenv("SRIOV_CNI_IMAGE")
data.Data["SRIOVInfiniBandCNIImage"] = os.Getenv("SRIOV_INFINIBAND_CNI_IMAGE")
data.Data["OVSCNIImage"] = os.Getenv("OVS_CNI_IMAGE")
data.Data["RDMACNIImage"] = os.Getenv("RDMA_CNI_IMAGE")
data.Data["ReleaseVersion"] = os.Getenv("RELEASEVERSION")
data.Data["ClusterType"] = vars.ClusterType
data.Data["DevMode"] = os.Getenv("DEV_MODE")
Expand Down
2 changes: 2 additions & 0 deletions controllers/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ var _ = BeforeSuite(func() {
Expect(err).NotTo(HaveOccurred())
err = os.Setenv("OVS_CNI_IMAGE", "mock-image")
Expect(err).NotTo(HaveOccurred())
err = os.Setenv("RDMA_CNI_IMAGE", "mock-image")
Expect(err).NotTo(HaveOccurred())
err = os.Setenv("SRIOV_DEVICE_PLUGIN_IMAGE", "mock-image")
Expect(err).NotTo(HaveOccurred())
err = os.Setenv("NETWORK_RESOURCES_INJECTOR_IMAGE", "mock-image")
Expand Down
2 changes: 2 additions & 0 deletions deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ spec:
value: $SRIOV_INFINIBAND_CNI_IMAGE
- name: OVS_CNI_IMAGE
value: $OVS_CNI_IMAGE
- name: RDMA_CNI_IMAGE
value: $RDMA_CNI_IMAGE
- name: SRIOV_DEVICE_PLUGIN_IMAGE
value: $SRIOV_DEVICE_PLUGIN_IMAGE
- name: NETWORK_RESOURCES_INJECTOR_IMAGE
Expand Down
1 change: 1 addition & 0 deletions deployment/sriov-network-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ This section contains general parameters that apply to both the operator and dae
| `images.sriovCni` | SR-IOV CNI image |
| `images.ibSriovCni` | InfiniBand SR-IOV CNI image |
| `images.ovsCni` | OVS CNI image |
| `images.rdmaCni` | RDMA CNI image |
| `images.sriovDevicePlugin` | SR-IOV device plugin image |
| `images.resourcesInjector` | Resources Injector image |
| `images.webhook` | Operator Webhook image |
2 changes: 2 additions & 0 deletions deployment/sriov-network-operator/templates/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ spec:
value: {{ .Values.images.ibSriovCni }}
- name: OVS_CNI_IMAGE
value: {{ .Values.images.ovsCni }}
- name: RDMA_CNI_IMAGE
value: { { .Values.images.rdmaCni } }
- name: SRIOV_DEVICE_PLUGIN_IMAGE
value: {{ .Values.images.sriovDevicePlugin }}
- name: NETWORK_RESOURCES_INJECTOR_IMAGE
Expand Down
1 change: 1 addition & 0 deletions deployment/sriov-network-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ images:
sriovCni: ghcr.io/k8snetworkplumbingwg/sriov-cni
ibSriovCni: ghcr.io/k8snetworkplumbingwg/ib-sriov-cni
ovsCni: quay.io/kubevirt/ovs-cni-plugin
rdmaCni: ghcr.io/k8snetworkplumbingwg/rdma-cni
sriovDevicePlugin: ghcr.io/k8snetworkplumbingwg/sriov-network-device-plugin
resourcesInjector: ghcr.io/k8snetworkplumbingwg/network-resources-injector
webhook: ghcr.io/k8snetworkplumbingwg/sriov-network-operator-webhook
Expand Down
4 changes: 4 additions & 0 deletions hack/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ if [ -z $SKIP_VAR_SET ]; then
export SRIOV_INFINIBAND_CNI_IMAGE=${SRIOV_INFINIBAND_CNI_IMAGE:-ghcr.io/k8snetworkplumbingwg/ib-sriov-cni}
# OVS_CNI_IMAGE can be explicitly set to empty value, use default only if the var is not set
export OVS_CNI_IMAGE=${OVS_CNI_IMAGE-quay.io/kubevirt/ovs-cni-plugin}
# RDMA_CNI_IMAGE can be explicitly set to empty value, use default only if the var is not set
export RDMA_CNI_IMAGE=${RDMA_CNI_IMAGE-ghcr.io/k8snetworkplumbingwg/rdma-cni}
export SRIOV_DEVICE_PLUGIN_IMAGE=${SRIOV_DEVICE_PLUGIN_IMAGE:-ghcr.io/k8snetworkplumbingwg/sriov-network-device-plugin}
export NETWORK_RESOURCES_INJECTOR_IMAGE=${NETWORK_RESOURCES_INJECTOR_IMAGE:-ghcr.io/k8snetworkplumbingwg/network-resources-injector}
export SRIOV_NETWORK_CONFIG_DAEMON_IMAGE=${SRIOV_NETWORK_CONFIG_DAEMON_IMAGE:-ghcr.io/k8snetworkplumbingwg/sriov-network-operator-config-daemon}
Expand All @@ -11,6 +13,8 @@ if [ -z $SKIP_VAR_SET ]; then
else
# ensure that OVS_CNI_IMAGE is set, empty string is a valid value
OVS_CNI_IMAGE=${OVS_CNI_IMAGE:-}
# ensure that RDMA_CNI_IMAGE is set, empty string is a valid value
$RDMA_CNI_IMAGE=${$RDMA_CNI_IMAGE:-}
[ -z $SRIOV_CNI_IMAGE ] && echo "SRIOV_CNI_IMAGE is empty but SKIP_VAR_SET is set" && exit 1
[ -z $SRIOV_INFINIBAND_CNI_IMAGE ] && echo "SRIOV_INFINIBAND_CNI_IMAGE is empty but SKIP_VAR_SET is set" && exit 1
[ -z $SRIOV_DEVICE_PLUGIN_IMAGE ] && echo "SRIOV_DEVICE_PLUGIN_IMAGE is empty but SKIP_VAR_SET is set" && exit 1
Expand Down
1 change: 1 addition & 0 deletions hack/run-e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ KUBECONFIG=${KUBECONFIG:-/root/env/ign/auth/kubeconfig}
echo ${SRIOV_CNI_IMAGE}
echo ${SRIOV_INFINIBAND_CNI_IMAGE}
echo ${OVS_CNI_IMAGE}
echo ${RDMA_CNI_IMAGE}
echo ${SRIOV_DEVICE_PLUGIN_IMAGE}
echo ${NETWORK_RESOURCES_INJECTOR_IMAGE}
echo ${SRIOV_NETWORK_CONFIG_DAEMON_IMAGE}
Expand Down

0 comments on commit e4b3a56

Please sign in to comment.