From 94ce694e09e9bcff2889e4ee1b24272739e511ad Mon Sep 17 00:00:00 2001 From: yati1998 Date: Thu, 29 Aug 2024 16:26:34 +0530 Subject: [PATCH 1/4] cephfs: add examples for volumegroupsnapshot this commit add yaml exampl files for creation of volumegroupsnapshotclass and volumegroupsnapshot for cephfs driver Signed-off-by: yati1998 --- examples/cephfs/groupsnapshot.yaml | 13 +++++++++++++ examples/cephfs/groupsnapshotclass.yaml | 17 +++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 examples/cephfs/groupsnapshot.yaml create mode 100644 examples/cephfs/groupsnapshotclass.yaml diff --git a/examples/cephfs/groupsnapshot.yaml b/examples/cephfs/groupsnapshot.yaml new file mode 100644 index 00000000000..5275685176c --- /dev/null +++ b/examples/cephfs/groupsnapshot.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: groupsnapshot.storage.k8s.io/v1alpha1 +kind: VolumeGroupSnapshot +metadata: + name: new-groupsnapshot-demo-1 +spec: + source: + selector: + matchLabels: + # The PVCs will need to have this label for it to be + # included in the VolumeGroupSnapshot + group: test + volumeGroupSnapshotClassName: csi-cephfsplugin-groupsnapclass diff --git a/examples/cephfs/groupsnapshotclass.yaml b/examples/cephfs/groupsnapshotclass.yaml new file mode 100644 index 00000000000..7c30ee08800 --- /dev/null +++ b/examples/cephfs/groupsnapshotclass.yaml @@ -0,0 +1,17 @@ +--- +apiVersion: groupsnapshot.storage.k8s.io/v1alpha1 +kind: VolumeGroupSnapshotClass +metadata: + name: csi-cephfsplugin-groupsnapclass +driver: cephfs.csi.ceph.com +parameters: + # String representing a Ceph cluster to provision storage from. + # Should be unique across all Ceph clusters in use for provisioning, + # cannot be greater than 36 bytes in length, and should remain immutable for + # the lifetime of the StorageClass in use + clusterID: + # eg: fsName: myfs + fsName: + csi.storage.k8s.io/group-snapshotter-secret-name: csi-cephfs-secret + csi.storage.k8s.io/group-snapshotter-secret-namespace: default +deletionPolicy: Delete From 54ae9f953ac6d38d67631a6c810bc925cea71a31 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Mon, 2 Sep 2024 10:21:07 +0200 Subject: [PATCH 2/4] rbd: advertise VOLUME_CONDITION rbd nodeserver is already setting volume condition in NodeGetVolumeStats RPC call but the cap is not updated for it, This PR advertise the VOLUME_CONDITION Signed-off-by: Madhu Rajanna --- internal/rbd/nodeserver.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/rbd/nodeserver.go b/internal/rbd/nodeserver.go index 5f4dd000739..ff699aeadd6 100644 --- a/internal/rbd/nodeserver.go +++ b/internal/rbd/nodeserver.go @@ -1199,6 +1199,13 @@ func (ns *NodeServer) NodeGetCapabilities( }, }, }, + { + Type: &csi.NodeServiceCapability_Rpc{ + Rpc: &csi.NodeServiceCapability_RPC{ + Type: csi.NodeServiceCapability_RPC_VOLUME_CONDITION, + }, + }, + }, { Type: &csi.NodeServiceCapability_Rpc{ Rpc: &csi.NodeServiceCapability_RPC{ From 4d5594acab46eb7906b5226f67328e89fc023dd0 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Mon, 2 Sep 2024 10:24:47 +0200 Subject: [PATCH 3/4] rbd: set volume condition for block set volume condition as healthy if we dont have any errors for the block mode as well. Signed-off-by: Madhu Rajanna --- internal/rbd/nodeserver.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/rbd/nodeserver.go b/internal/rbd/nodeserver.go index ff699aeadd6..5308e91294a 100644 --- a/internal/rbd/nodeserver.go +++ b/internal/rbd/nodeserver.go @@ -1365,6 +1365,10 @@ func blockNodeGetVolumeStats(ctx context.Context, targetPath string) (*csi.NodeG Unit: csi.VolumeUsage_BYTES, }, }, + VolumeCondition: &csi.VolumeCondition{ + Abnormal: false, + Message: "volume is in a healthy condition", + }, }, nil } From 88ce2c625bafaaf73fcbe52db5a73979777cf398 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Mon, 2 Sep 2024 12:09:12 +0200 Subject: [PATCH 4/4] helm: remove kube version check kubernetes 1.25 is EOL and we dont support it in cephcsi anymore, Removing the checks for the same. Signed-off-by: Madhu Rajanna --- charts/ceph-csi-cephfs/templates/csidriver-crd.yaml | 2 -- charts/ceph-csi-rbd/templates/csidriver-crd.yaml | 2 -- 2 files changed, 4 deletions(-) diff --git a/charts/ceph-csi-cephfs/templates/csidriver-crd.yaml b/charts/ceph-csi-cephfs/templates/csidriver-crd.yaml index 821bd19251e..4cb391946c3 100644 --- a/charts/ceph-csi-cephfs/templates/csidriver-crd.yaml +++ b/charts/ceph-csi-cephfs/templates/csidriver-crd.yaml @@ -12,6 +12,4 @@ spec: attachRequired: false podInfoOnMount: false fsGroupPolicy: {{ .Values.CSIDriver.fsGroupPolicy }} -{{- if and (semverCompare ">= 1.25.x" .Capabilities.KubeVersion.Version) .Values.CSIDriver.seLinuxMount }} seLinuxMount: true -{{- end }} diff --git a/charts/ceph-csi-rbd/templates/csidriver-crd.yaml b/charts/ceph-csi-rbd/templates/csidriver-crd.yaml index f3f1b2e0872..dfefaa21996 100644 --- a/charts/ceph-csi-rbd/templates/csidriver-crd.yaml +++ b/charts/ceph-csi-rbd/templates/csidriver-crd.yaml @@ -12,6 +12,4 @@ spec: attachRequired: true podInfoOnMount: false fsGroupPolicy: {{ .Values.CSIDriver.fsGroupPolicy }} -{{- if and (semverCompare ">= 1.25.x" .Capabilities.KubeVersion.Version) .Values.CSIDriver.seLinuxMount }} seLinuxMount: true -{{- end }}