
This commit introduces the capability to create a snapshot class using helm overrides within "cephfs-provisioner" and "rbd-provisioner" charts. By default, upon applying platform-integ-apps the 'snapshotClass.create' field is set to 'false' in both charts, creating the snapshot class(es) after being changed to 'true' via helm overrides and the app reapplied. This enhancement depends on the changes from the review below, where in each installation the CRDs and the snapshot-controller will be created by default when running bootstrap playbook. This way, each CSI app will be able to implement this functionality as support for PVC snapshots will be default during installations. * This is a new review after the revert of: https://review.opendev.org/c/starlingx/platform-armada-app/+/902722 Test Plan: PASS: Build a new app package with the code changes PASS: Successfully execute upload, apply, remove, and delete operations for 'platform-integ-apps' on both AIO-SX and AIO-DX environments. PASS: Upon initial application apply and update, check with 'helm get values' that the 'snapshotClass.create' field is set to 'false' in both the cephFS and RBD charts. Additionally, confirm on K8s that the snapshotClasses are not created, as expected PASS: Use 'system helm-override-update' to change the 'snapshotClass.create' field to 'true' in both charts. Reapply the app and validate on K8s that the snapshotClasses are indeed created. PASS: After creating the SnapshotClass, take a VolumeSnapshot from an existing PVC, proceed with K8s upgrade (K8s 1.25, 1.26, and 1.27) with CRDs and snapshot controller update, take a VolumeSnapshot from another PVC and verify that all VolumeSnapshots are correct PASS: With an old version of the application, create user overrides for 'classes', then update to the application with the current changes and verify that the user overrides for 'classes' have been transferred to 'storageClasses' Partial-Bug: 2045897 Depends-on: https://review.opendev.org/c/starlingx/ansible-playbooks/+/904360 Change-Id: I6e2fe2009d4cce3e351142359c1f36465cf03ee3 Signed-off-by: Gabriel de Araújo Cabral <gabriel.cabral@windriver.com> Signed-off-by: Erickson Silva de Oliveira <Erickson.SilvadeOliveira@windriver.com>
63 lines
2.3 KiB
Diff
63 lines
2.3 KiB
Diff
From cc40abf2495bdaa0ace32441cfc6d5a78a397d3b Mon Sep 17 00:00:00 2001
|
|
From: Gabriel de Araújo Cabral <gabriel.cabral@windriver.com>
|
|
Date: Thu, 30 Nov 2023 12:51:37 -0300
|
|
Subject: ceph-csi-cephfs: add snapshotclass
|
|
|
|
Signed-off-by: Gabriel de Araújo Cabral <gabriel.cabral@windriver.com>
|
|
---
|
|
.../templates/snapshotclass.yaml | 13 +++++++++++++
|
|
charts/ceph-csi-cephfs/values.yaml | 18 ++++++++++++++++++
|
|
2 files changed, 31 insertions(+)
|
|
create mode 100644 charts/ceph-csi-cephfs/templates/snapshotclass.yaml
|
|
|
|
diff --git a/charts/ceph-csi-cephfs/templates/snapshotclass.yaml b/charts/ceph-csi-cephfs/templates/snapshotclass.yaml
|
|
new file mode 100644
|
|
index 000000000..3bad19026
|
|
--- /dev/null
|
|
+++ b/charts/ceph-csi-cephfs/templates/snapshotclass.yaml
|
|
@@ -0,0 +1,13 @@
|
|
+{{- if .Values.snapshotClass.create -}}
|
|
+apiVersion: snapshot.storage.k8s.io/v1
|
|
+kind: VolumeSnapshotClass
|
|
+metadata:
|
|
+ name: {{ .Values.snapshotClass.name }}
|
|
+driver: {{ .Values.driverName }}
|
|
+parameters:
|
|
+ clusterID: {{ .Values.snapshotClass.clusterID }}
|
|
+ snapshotNamePrefix: {{ .Values.snapshotClass.snapshotNamePrefix }}
|
|
+ csi.storage.k8s.io/snapshotter-secret-name: {{ .Values.snapshotClass.provisionerSecret }}
|
|
+ csi.storage.k8s.io/snapshotter-secret-namespace: {{ .Values.snapshotClass.provisionerSecretNamespace }}
|
|
+deletionPolicy: {{ .Values.snapshotClass.deletionPolicy }}
|
|
+{{- end -}}
|
|
diff --git a/charts/ceph-csi-cephfs/values.yaml b/charts/ceph-csi-cephfs/values.yaml
|
|
index 7c85abd7d..912165f1d 100644
|
|
--- a/charts/ceph-csi-cephfs/values.yaml
|
|
+++ b/charts/ceph-csi-cephfs/values.yaml
|
|
@@ -302,6 +302,24 @@ storageClass:
|
|
# Ceph pools name
|
|
metadata_pool: kube-cephfs-metadata
|
|
|
|
+snapshotClass:
|
|
+ # Specifies whether the snapshotclass should be created
|
|
+ create: false
|
|
+ # Specifies the snapshotclass name
|
|
+ name: csi-cephfsplugin-snapclass
|
|
+ # (required) Unique string representing a Ceph cluster to provision
|
|
+ #storage from.
|
|
+ clusterID: <cluster-ID>
|
|
+ # Prefix to use for naming CephFS snapshots.
|
|
+ # If omitted, defaults to "csi-snap-".
|
|
+ # snapshotNamePrefix: "foo-bar-"
|
|
+ snapshotNamePrefix: ""
|
|
+ # K8s secret name
|
|
+ provisionerSecret: csi-cephfs-secret
|
|
+ # K8s secret namespace
|
|
+ provisionerSecretNamespace: ""
|
|
+ deletionPolicy: Delete
|
|
+
|
|
secret:
|
|
# Specifies whether the secret should be created
|
|
create: false
|
|
--
|
|
2.25.1
|