From 092e7614781abffa4ba3387a0f7a5837933bf84a Mon Sep 17 00:00:00 2001 From: Rakshith R Date: Thu, 25 Aug 2022 12:26:50 +0530 Subject: [PATCH 1/4] csi: use cephcsi image for nfs nodeserver Cephcsi v3.7 now supports nfs nodeserver. This commit changes nfs nodeserver image to cephcsi image and makes other necessary modifications to template. Signed-off-by: Rakshith R (cherry picked from commit 9405b59ff4f32af1fff0a80ebdc1013140ac5b26) --- .../ceph/csi/template/nfs/csi-nfsplugin.yaml | 78 +++++++++++++++++-- 1 file changed, 73 insertions(+), 5 deletions(-) diff --git a/pkg/operator/ceph/csi/template/nfs/csi-nfsplugin.yaml b/pkg/operator/ceph/csi/template/nfs/csi-nfsplugin.yaml index f501a6864..deede1b8c 100644 --- a/pkg/operator/ceph/csi/template/nfs/csi-nfsplugin.yaml +++ b/pkg/operator/ceph/csi/template/nfs/csi-nfsplugin.yaml @@ -55,10 +55,13 @@ spec: - SYS_ADMIN privileged: true args: - - "--v={{ .LogLevel }}" - - "--drivername={{ .DriverNamePrefix }}nfs.csi.ceph.com" - - --nodeid=$(NODE_ID) - - --endpoint=$(CSI_ENDPOINT) + - "--nodeid=$(NODE_ID)" + - "--type=nfs" + - "--endpoint=$(CSI_ENDPOINT)" + - "--v={{ .LogLevel }}" + - "--nodeserver=true" + - "--drivername={{ .DriverNamePrefix }}nfs.csi.ceph.com" + - "--pidlimit=-1" env: - name: NODE_ID valueFrom: @@ -67,19 +70,49 @@ spec: fieldPath: spec.nodeName - name: CSI_ENDPOINT value: unix:///csi/csi.sock - image: {{ .NFSPluginImage }} + image: {{ .CSIPluginImage }} imagePullPolicy: IfNotPresent volumeMounts: - name: plugin-dir mountPath: /csi + - name: csi-plugins-dir + mountPath: "{{ .KubeletDirPath }}/plugins" + mountPropagation: "Bidirectional" - name: pods-mount-dir mountPath: "{{ .KubeletDirPath }}/pods" mountPropagation: "Bidirectional" + - name: host-sys + mountPath: /sys + - name: lib-modules + mountPath: /lib/modules + readOnly: true + - name: host-dev + mountPath: /dev + - name: ceph-csi-config + mountPath: /etc/ceph-csi-config/ + - name: keys-tmp-dir + mountPath: /tmp/csi/keys + - name: host-run-mount + mountPath: /run/mount + {{ if .EnablePluginSelinuxHostMount }} + - name: etc-selinux + mountPath: /etc/selinux + readOnly: true + {{ end }} + {{ if .MountCustomCephConf }} + - name: ceph-config + mountPath: /etc/ceph/ceph.conf + subPath: ceph.conf + {{ end }} volumes: - name: plugin-dir hostPath: path: "{{ .KubeletDirPath }}/plugins/{{ .DriverNamePrefix }}nfs.csi.ceph.com/" type: DirectoryOrCreate + - name: csi-plugins-dir + hostPath: + path: "{{ .KubeletDirPath }}/plugins" + type: Directory - name: registration-dir hostPath: path: "{{ .KubeletDirPath }}/plugins_registry/" @@ -88,3 +121,38 @@ spec: hostPath: path: "{{ .KubeletDirPath }}/pods" type: Directory + - name: host-sys + hostPath: + path: /sys + - name: lib-modules + hostPath: + path: /lib/modules + - name: host-dev + hostPath: + path: /dev + - name: ceph-csi-config + configMap: + name: rook-ceph-csi-config + items: + - key: csi-cluster-config-json + path: config.json + - name: keys-tmp-dir + emptyDir: { + medium: "Memory" + } + - name: host-run-mount + hostPath: + path: /run/mount + {{ if .EnablePluginSelinuxHostMount }} + - name: etc-selinux + hostPath: + path: /etc/selinux + {{ end }} + {{ if .MountCustomCephConf }} + - name: ceph-config + configMap: + name: csi-ceph-conf-override + items: + - key: ceph.conf + path: ceph.conf + {{ end }} From b10f56ddaaa8c713eca9782fb0c8a103bb5dfe7a Mon Sep 17 00:00:00 2001 From: Rakshith R Date: Thu, 25 Aug 2022 12:29:10 +0530 Subject: [PATCH 2/4] csi: add holder pod support for nfs This commit adds holder pod support for nfs to be able to work in non-host networking scenario, without being affected by restarts of csi-nfsplugin. Signed-off-by: Rakshith R (cherry picked from commit 7c6e4d71bcdf36e4e6e7b69f47af724cddf4ba00) --- pkg/operator/ceph/csi/cluster_config.go | 11 ++++ pkg/operator/ceph/csi/spec.go | 18 ++++++ .../template/nfs/csi-nfsplugin-holder.yaml | 64 +++++++++++++++++++ 3 files changed, 93 insertions(+) create mode 100644 pkg/operator/ceph/csi/template/nfs/csi-nfsplugin-holder.yaml diff --git a/pkg/operator/ceph/csi/cluster_config.go b/pkg/operator/ceph/csi/cluster_config.go index 2f7c47015..71e2ad85b 100644 --- a/pkg/operator/ceph/csi/cluster_config.go +++ b/pkg/operator/ceph/csi/cluster_config.go @@ -42,6 +42,7 @@ type CsiClusterConfigEntry struct { Monitors []string `json:"monitors"` Namespace string `json:"namespace"` CephFS *CsiCephFSSpec `json:"cephFS,omitempty"` + NFS *CsiNFSSpec `json:"nfs,omitempty"` RBD *CsiRBDSpec `json:"rbd,omitempty"` RadosNamespace string `json:"radosNamespace,omitempty"` } @@ -51,6 +52,10 @@ type CsiCephFSSpec struct { SubvolumeGroup string `json:"subvolumeGroup,omitempty"` } +type CsiNFSSpec struct { + NetNamespaceFilePath string `json:"netNamespaceFilePath,omitempty"` +} + type CsiRBDSpec struct { NetNamespaceFilePath string `json:"netNamespaceFilePath,omitempty"` RadosNamespace string `json:"radosNamespace,omitempty"` @@ -142,6 +147,9 @@ func updateCsiClusterConfig(curr, clusterKey string, newCsiClusterConfigEntry *C if newCsiClusterConfigEntry.CephFS != nil && (newCsiClusterConfigEntry.CephFS.SubvolumeGroup != "" || newCsiClusterConfigEntry.CephFS.NetNamespaceFilePath != "") { centry.CephFS = newCsiClusterConfigEntry.CephFS } + if newCsiClusterConfigEntry.NFS != nil && newCsiClusterConfigEntry.NFS.NetNamespaceFilePath != "" { + centry.NFS = newCsiClusterConfigEntry.NFS + } if newCsiClusterConfigEntry.RBD != nil && (newCsiClusterConfigEntry.RBD.RadosNamespace != "" || newCsiClusterConfigEntry.RBD.NetNamespaceFilePath != "") { centry.RBD = newCsiClusterConfigEntry.RBD } @@ -169,6 +177,9 @@ func updateCsiClusterConfig(curr, clusterKey string, newCsiClusterConfigEntry *C if newCsiClusterConfigEntry.CephFS != nil && (newCsiClusterConfigEntry.CephFS.SubvolumeGroup != "" || newCsiClusterConfigEntry.CephFS.NetNamespaceFilePath != "") { centry.CephFS = newCsiClusterConfigEntry.CephFS } + if newCsiClusterConfigEntry.NFS != nil && newCsiClusterConfigEntry.NFS.NetNamespaceFilePath != "" { + centry.NFS = newCsiClusterConfigEntry.NFS + } cc = append(cc, centry) } } diff --git a/pkg/operator/ceph/csi/spec.go b/pkg/operator/ceph/csi/spec.go index 34b474f1a..5a4e02ddc 100644 --- a/pkg/operator/ceph/csi/spec.go +++ b/pkg/operator/ceph/csi/spec.go @@ -162,6 +162,8 @@ var ( NFSPluginTemplatePath string //go:embed template/nfs/csi-nfsplugin-provisioner-dep.yaml NFSProvisionerDepTemplatePath string + //go:embed template/nfs/csi-nfsplugin-holder.yaml + NFSPluginHolderTemplatePath string ) const ( @@ -240,6 +242,7 @@ const ( RBDDriverShortName = "rbd" CephFSDriverShortName = "cephfs" + NFSDriverShortName = "nfs" rbdDriverSuffix = "rbd.csi.ceph.com" cephFSDriverSuffix = "cephfs.csi.ceph.com" ) @@ -375,6 +378,14 @@ func (r *ReconcileCSI) startDrivers(ver *version.Info, ownerInfo *k8sutil.OwnerI if err != nil { return errors.Wrap(err, "failed to load nfs provisioner deployment template") } + enabledDrivers = append(enabledDrivers, driverDetails{ + name: NFSDriverShortName, + fullName: NFSDriverName, + holderTemplate: NFSPluginHolderTemplatePath, + nodeAffinity: nfsPluginNodeAffinityEnv, + toleration: nfsPluginTolerationsEnv, + resource: nfsPluginResource, + }) } holderEnabled := !CSIParam.EnableCSIHostNetwork @@ -561,7 +572,10 @@ func (r *ReconcileCSI) startDrivers(ver *version.Info, ownerInfo *k8sutil.OwnerI } if holderEnabled { nfsPlugin.Spec.Template.Spec.HostNetwork = false + // HostPID is used to communicate with the network namespace + nfsPlugin.Spec.Template.Spec.HostPID = true } + err = k8sutil.CreateDaemonSet(r.opManagerContext, r.opConfig.OperatorNamespace, r.context.Clientset, nfsPlugin) if err != nil { return errors.Wrapf(err, "failed to start nfs plugin daemonset %q", nfsPlugin.Name) @@ -832,6 +846,7 @@ func (r *ReconcileCSI) configureHolder(driver driverDetails, c ClusterDetail, tp Monitors: MonEndpoints(c.clusterInfo.Monitors), RBD: &CsiRBDSpec{}, CephFS: &CsiCephFSSpec{}, + NFS: &CsiNFSSpec{}, } netNamespaceFilePath := generateNetNamespaceFilePath(CSIParam.KubeletDirPath, driver.fullName, c.cluster.Namespace) if driver.name == RBDDriverShortName { @@ -840,6 +855,9 @@ func (r *ReconcileCSI) configureHolder(driver driverDetails, c ClusterDetail, tp if driver.name == CephFSDriverShortName { clusterConfigEntry.CephFS.NetNamespaceFilePath = netNamespaceFilePath } + if driver.name == NFSDriverShortName { + clusterConfigEntry.NFS.NetNamespaceFilePath = netNamespaceFilePath + } // Save the path of the network namespace file for ceph-csi to use err = SaveClusterConfig(r.context.Clientset, c.cluster.Namespace, c.clusterInfo, clusterConfigEntry) if err != nil { diff --git a/pkg/operator/ceph/csi/template/nfs/csi-nfsplugin-holder.yaml b/pkg/operator/ceph/csi/template/nfs/csi-nfsplugin-holder.yaml new file mode 100644 index 000000000..5ee0e6f06 --- /dev/null +++ b/pkg/operator/ceph/csi/template/nfs/csi-nfsplugin-holder.yaml @@ -0,0 +1,64 @@ +# This DaemonSet is only active when the cluster is deployed with Multus enabled or EnableCSIHostNetwork +# is set to false. Hopefully in the future it will be part of every Ceph-CSI deployment. Its role is to +# "hold" the Ceph Filesystem mounts that are created by the CSI driver. Essentially, it exposes its +# network namespace into the Kubelet plugin directly and Ceph-CSI picks it up. When mounting, the Ceph-CSI +# driver will use the network namespace of the DaemonSet instead of its own (the plugin pod). This pod +# is not expected to be updated nor restarted unless the node reboots. +kind: DaemonSet +apiVersion: apps/v1 +metadata: + name: csi-nfsplugin-holder + namespace: {{ .Namespace }} +spec: + selector: + matchLabels: + app: csi-nfsplugin-holder + updateStrategy: + # DO NOT CHANGE THE STRATEGY + # The pod is not supposed to be restarted on updates, it should never receive updates too. + # If it does then the connectivity to the Ceph cluster will be lost and the client I/O will + # fail. + type: OnDelete + template: + metadata: + labels: + app: csi-nfsplugin-holder + {{ range $key, $value := .CSINFSPodLabels }} + {{ $key }}: "{{ $value }}" + {{ end }} + spec: + # HostPID is needed to expose the correct process ID network namespace and not the process namespace + hostPID: true + serviceAccountName: rook-csi-nfs-plugin-sa + {{ if .PluginPriorityClassName }} + priorityClassName: {{ .PluginPriorityClassName }} + {{ end }} + containers: + - name: csi-nfsplugin-holder + # This is necessary for the Bidirectional mount propagation + securityContext: + privileged: true + image: {{ .CSIPluginImage }} + command: + - "/bin/sh" + - "-c" + # the third $ allows the "$$" to be interpreted so it can return the current bash process ID + args: + - "ln + --force + --symbolic + --verbose + /proc/$$$/ns/net + {{ .KubeletDirPath }}/plugins/$ROOK_CEPH_CSI_DRIVER_NAME/$CEPH_CLUSTER_NAMESPACE.net.ns + && + sleep + infinity" + volumeMounts: + - name: plugin-mount-dir + mountPath: "{{ .KubeletDirPath }}/plugins" + mountPropagation: "Bidirectional" + volumes: + - name: plugin-mount-dir + hostPath: + path: "{{ .KubeletDirPath }}/plugins" + type: Directory From cc19356068f93fc77cfeee9b10913006bd676eb0 Mon Sep 17 00:00:00 2001 From: Rakshith R Date: Mon, 29 Aug 2022 16:50:46 +0530 Subject: [PATCH 3/4] csi: remove nfs image This commit remove nfs image since it is no longer needed. Cephcsi itself will act as nfs nodeserver. Signed-off-by: Rakshith R (cherry picked from commit 7722226521cb9528c0fc5eed2aa2fe9278d5e6c8) # Conflicts: # deploy/examples/images.txt --- Documentation/Helm-Charts/operator-chart.md | 1 - deploy/charts/rook-ceph/templates/configmap.yaml | 3 --- deploy/charts/rook-ceph/values.yaml | 1 - deploy/examples/images.txt | 4 ++++ deploy/examples/operator-openshift.yaml | 1 - deploy/examples/operator.yaml | 1 - pkg/operator/ceph/csi/csi.go | 1 - pkg/operator/ceph/csi/spec.go | 2 -- 8 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Documentation/Helm-Charts/operator-chart.md b/Documentation/Helm-Charts/operator-chart.md index 03414ec22..7db6fadea 100644 --- a/Documentation/Helm-Charts/operator-chart.md +++ b/Documentation/Helm-Charts/operator-chart.md @@ -129,7 +129,6 @@ The following tables lists the configurable parameters of the rook-operator char | `csi.csiAddons.enabled` | Enable CSIAddons | `false` | | `csi.csiAddons.image` | CSIAddons Sidecar image. | `quay.io/csiaddons/k8s-sidecar:v0.4.0` | | `csi.nfs.enabled` | Enable nfs driver. | `false` | -| `csi.nfs.image` | NFS nodeplugin image. | `registry.k8s.io/sig-storage/nfsplugin:v4.0.0` | | `admissionController.tolerations` | Array of tolerations in YAML format which will be added to admission controller deployment. | `` | | `admissionController.nodeAffinity` | The node labels for affinity of the admission controller deployment [^1] | `` | | `monitoring.enabled` | Create necessary RBAC rules for Rook to integrate with Prometheus monitoring in the operator namespace. Requires Prometheus to be pre-installed. | `false` | diff --git a/deploy/charts/rook-ceph/templates/configmap.yaml b/deploy/charts/rook-ceph/templates/configmap.yaml index 2289b7062..56f093aa7 100644 --- a/deploy/charts/rook-ceph/templates/configmap.yaml +++ b/deploy/charts/rook-ceph/templates/configmap.yaml @@ -90,9 +90,6 @@ data: {{- end }} {{- if .Values.csi.nfs }} ROOK_CSI_ENABLE_NFS: {{ .Values.csi.nfs.enabled | quote }} -{{- if .Values.csi.nfs.image }} - ROOK_CSI_NFS_IMAGE: {{ .Values.csi.nfs.image | quote }} -{{- end }} {{- end }} {{- if .Values.csi.cephfsPodLabels }} ROOK_CSI_CEPHFS_POD_LABELS: {{ .Values.csi.cephfsPodLabels | quote }} diff --git a/deploy/charts/rook-ceph/values.yaml b/deploy/charts/rook-ceph/values.yaml index 39adf2926..74d343f8a 100644 --- a/deploy/charts/rook-ceph/values.yaml +++ b/deploy/charts/rook-ceph/values.yaml @@ -390,7 +390,6 @@ csi: # Enable the nfs csi driver. nfs: enabled: false - #image: "registry.k8s.io/sig-storage/nfsplugin:v4.0.0" enableDiscoveryDaemon: false cephCommandsTimeoutSeconds: "15" diff --git a/deploy/examples/images.txt b/deploy/examples/images.txt index ed72825aa..26f79559f 100644 --- a/deploy/examples/images.txt +++ b/deploy/examples/images.txt @@ -7,5 +7,9 @@ registry.k8s.io/sig-storage/csi-provisioner:v3.2.1 registry.k8s.io/sig-storage/csi-resizer:v1.5.0 registry.k8s.io/sig-storage/csi-snapshotter:v6.0.1 +<<<<<<< HEAD registry.k8s.io/sig-storage/nfsplugin:v4.0.0 rook/ceph:v1.10.0 +======= + rook/ceph:master +>>>>>>> 772222652 (csi: remove nfs image) diff --git a/deploy/examples/operator-openshift.yaml b/deploy/examples/operator-openshift.yaml index 362f517a8..1be3933c7 100644 --- a/deploy/examples/operator-openshift.yaml +++ b/deploy/examples/operator-openshift.yaml @@ -190,7 +190,6 @@ data: # ROOK_CSI_PROVISIONER_IMAGE: "registry.k8s.io/sig-storage/csi-provisioner:v3.2.1" # ROOK_CSI_SNAPSHOTTER_IMAGE: "registry.k8s.io/sig-storage/csi-snapshotter:v6.0.1" # ROOK_CSI_ATTACHER_IMAGE: "registry.k8s.io/sig-storage/csi-attacher:v3.5.0" - # ROOK_CSI_NFS_IMAGE: "registry.k8s.io/sig-storage/nfsplugin:v4.0.0" # (Optional) set user created priorityclassName for csi plugin pods. CSI_PLUGIN_PRIORITY_CLASSNAME: "system-node-critical" diff --git a/deploy/examples/operator.yaml b/deploy/examples/operator.yaml index 17af52295..f1bf59300 100644 --- a/deploy/examples/operator.yaml +++ b/deploy/examples/operator.yaml @@ -107,7 +107,6 @@ data: # ROOK_CSI_PROVISIONER_IMAGE: "registry.k8s.io/sig-storage/csi-provisioner:v3.1.0" # ROOK_CSI_SNAPSHOTTER_IMAGE: "registry.k8s.io/sig-storage/csi-snapshotter:v6.0.1" # ROOK_CSI_ATTACHER_IMAGE: "registry.k8s.io/sig-storage/csi-attacher:v3.4.0" - # ROOK_CSI_NFS_IMAGE: "registry.k8s.io/sig-storage/nfsplugin:v4.0.0" # (Optional) set user created priorityclassName for csi plugin pods. CSI_PLUGIN_PRIORITY_CLASSNAME: "system-node-critical" diff --git a/pkg/operator/ceph/csi/csi.go b/pkg/operator/ceph/csi/csi.go index 4e1323699..bb12c4592 100644 --- a/pkg/operator/ceph/csi/csi.go +++ b/pkg/operator/ceph/csi/csi.go @@ -249,7 +249,6 @@ func (r *ReconcileCSI) setParams(ver *version.Info) error { } CSIParam.CSIPluginImage = k8sutil.GetValue(r.opConfig.Parameters, "ROOK_CSI_CEPH_IMAGE", DefaultCSIPluginImage) - CSIParam.NFSPluginImage = k8sutil.GetValue(r.opConfig.Parameters, "ROOK_CSI_NFS_IMAGE", DefaultNFSPluginImage) CSIParam.RegistrarImage = k8sutil.GetValue(r.opConfig.Parameters, "ROOK_CSI_REGISTRAR_IMAGE", DefaultRegistrarImage) CSIParam.ProvisionerImage = k8sutil.GetValue(r.opConfig.Parameters, "ROOK_CSI_PROVISIONER_IMAGE", DefaultProvisionerImage) CSIParam.AttacherImage = k8sutil.GetValue(r.opConfig.Parameters, "ROOK_CSI_ATTACHER_IMAGE", DefaultAttacherImage) diff --git a/pkg/operator/ceph/csi/spec.go b/pkg/operator/ceph/csi/spec.go index 5a4e02ddc..8cf16f9d7 100644 --- a/pkg/operator/ceph/csi/spec.go +++ b/pkg/operator/ceph/csi/spec.go @@ -40,7 +40,6 @@ import ( type Param struct { CSIPluginImage string - NFSPluginImage string RegistrarImage string ProvisionerImage string AttacherImage string @@ -128,7 +127,6 @@ var ( var ( // image names DefaultCSIPluginImage = "quay.io/cephcsi/cephcsi:v3.7.0" - DefaultNFSPluginImage = "registry.k8s.io/sig-storage/nfsplugin:v4.0.0" DefaultRegistrarImage = "registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.5.1" DefaultProvisionerImage = "registry.k8s.io/sig-storage/csi-provisioner:v3.2.1" DefaultAttacherImage = "registry.k8s.io/sig-storage/csi-attacher:v3.5.0" From dd9d5076e06ca01190fa6285bf585aead5ac6672 Mon Sep 17 00:00:00 2001 From: Rakshith R Date: Thu, 25 Aug 2022 12:20:19 +0530 Subject: [PATCH 4/4] ci: add e2e for csi-nfsplugin restart This commit adds e2e for csi-nfsplugin restart when it is not on host-networking. Signed-off-by: Rakshith R (cherry picked from commit 07aac106df8c198ab823302bd2806e24c08ea28f) --- .github/workflows/canary-integration-test.yml | 7 ++++ deploy/examples/images.txt | 5 --- tests/scripts/github-action-helper.sh | 32 ++++++++++++++++--- tests/scripts/validate_cluster.sh | 5 +-- 4 files changed, 38 insertions(+), 11 deletions(-) diff --git a/.github/workflows/canary-integration-test.yml b/.github/workflows/canary-integration-test.yml index 45868ba52..2059d4ab9 100644 --- a/.github/workflows/canary-integration-test.yml +++ b/.github/workflows/canary-integration-test.yml @@ -1400,6 +1400,10 @@ jobs: - name: test ceph-csi-cephfs plugin restart run: tests/scripts/github-action-helper.sh test_csi_cephfs_workload + # uncomment once https://github.com/rook/rook/issues/10812 is resolved. + # - name: test ceph-csi-nfs plugin restart + # run: tests/scripts/github-action-helper.sh test_csi_nfs_workload + - name: collect common logs if: always() uses: ./.github/workflows/collect-logs @@ -1456,6 +1460,9 @@ jobs: - name: test ceph-csi-cephfs plugin restart run: tests/scripts/github-action-helper.sh test_csi_cephfs_workload + - name: test ceph-csi-nfs plugin restart + run: tests/scripts/github-action-helper.sh test_csi_nfs_workload + - name: collect common logs if: always() uses: ./.github/workflows/collect-logs diff --git a/deploy/examples/images.txt b/deploy/examples/images.txt index 26f79559f..984aa8f05 100644 --- a/deploy/examples/images.txt +++ b/deploy/examples/images.txt @@ -7,9 +7,4 @@ registry.k8s.io/sig-storage/csi-provisioner:v3.2.1 registry.k8s.io/sig-storage/csi-resizer:v1.5.0 registry.k8s.io/sig-storage/csi-snapshotter:v6.0.1 -<<<<<<< HEAD - registry.k8s.io/sig-storage/nfsplugin:v4.0.0 rook/ceph:v1.10.0 -======= - rook/ceph:master ->>>>>>> 772222652 (csi: remove nfs image) diff --git a/tests/scripts/github-action-helper.sh b/tests/scripts/github-action-helper.sh index 0c000094b..f9bddacf0 100755 --- a/tests/scripts/github-action-helper.sh +++ b/tests/scripts/github-action-helper.sh @@ -164,7 +164,7 @@ function build_rook_all() { function validate_yaml() { cd deploy/examples - kubectl create -f crds.yaml -f common.yaml + kubectl create -f crds.yaml -f common.yaml -f csi/nfs/rbac.yaml # create and use PSPs on k8s versions older than 1.21 kube_minor_ver="$(kubectl version -o json | jq -r '.serverVersion.minor')" @@ -192,10 +192,11 @@ function validate_yaml() { function create_cluster_prerequisites() { # this might be called from another function that has already done a cd - (cd deploy/examples && kubectl create -f crds.yaml -f common.yaml) + ( cd deploy/examples && kubectl create -f crds.yaml -f common.yaml -f csi/nfs/rbac.yaml ) } function deploy_manifest_with_local_build() { + sed -i 's/.*ROOK_CSI_ENABLE_NFS:.*/ ROOK_CSI_ENABLE_NFS: \"true\"/g' $1 if [[ "$USE_LOCAL_BUILD" != "false" ]]; then sed -i "s|image: rook/ceph:.*|image: rook/ceph:local-build|g" $1 fi @@ -254,6 +255,7 @@ function deploy_csi_hostnetwork_disabled_cluster() { elif [ "$1" = "osd_with_metadata_device" ]; then sed -i "s|#deviceFilter:|deviceFilter: ${BLOCK/\/dev\//}\n config:\n metadataDevice: /dev/test-rook-vg/test-rook-lv|g" cluster-test.yaml fi + kubectl create -f nfs-test.yaml kubectl create -f cluster-test.yaml kubectl create -f filesystem-test.yaml deploy_manifest_with_local_build toolbox.yaml @@ -467,11 +469,14 @@ EOF function deploy_multus_cluster() { cd deploy/examples + sed -i 's/.*ROOK_CSI_ENABLE_NFS:.*/ ROOK_CSI_ENABLE_NFS: \"true\"/g' operator.yaml deploy_manifest_with_local_build operator.yaml deploy_manifest_with_local_build toolbox.yaml sed -i "s|#deviceFilter:|deviceFilter: ${BLOCK/\/dev\//}|g" cluster-multus-test.yaml kubectl create -f cluster-multus-test.yaml kubectl create -f filesystem-test.yaml + # uncomment once https://github.com/rook/rook/issues/10812 is resolved. + # kubectl create -f nfs-test.yaml } function wait_for_ceph_csi_configmap_to_be_updated { @@ -487,6 +492,12 @@ until [[ $(kubectl -n rook-ceph get configmap rook-ceph-csi-config -o jsonpath=" sleep 5 done EOF +timeout 60 bash <