Revert "Add SnapshotClass Creation for CephFS/RBD via Helm Override"

This reverts commit 8b1f987add.

Reason for revert: This review possibly caused a sanity failure

Change-Id: I6d0958f793cd46abca552fa0f9b3188d87036db8
This commit is contained in:
Erickson Silva de Oliveira 2023-12-22 18:03:41 +00:00 committed by Gerrit Code Review
parent 8b1f987add
commit ae2da62c56
11 changed files with 20 additions and 174 deletions

View File

@ -1,12 +1,11 @@
From 356ddba07d33e333d332415d9858f4c6354a0d85 Mon Sep 17 00:00:00 2001
From: Gabriel de Araújo Cabral <gabriel.cabral@windriver.com>
Date: Wed, 6 Dec 2023 14:16:19 -0300
From 239cfdde94db341aad0ccb15e420c4ecc3157d21 Mon Sep 17 00:00:00 2001
From: Erickson Silva de Oliveira <Erickson.SilvadeOliveira@windriver.com>
Date: Mon, 24 Apr 2023 16:57:46 -0300
Subject: [PATCH] ceph-csi-cephfs: add storage-init.yaml
Signed-off-by: Hediberto Cavalcante da Silva <hediberto.cavalcantedasilva@windriver.com>
Signed-off-by: Felipe Sanches Zanoni <Felipe.SanchesZanoni@windriver.com>
Signed-off-by: Erickson Silva de Oliveira <Erickson.SilvadeOliveira@windriver.com>
Signed-off-by: Gabriel de Araújo Cabral <gabriel.cabral@windriver.com>
---
.../templates/storage-init.yaml | 369 ++++++++++++++++++
1 file changed, 369 insertions(+)
@ -345,7 +344,7 @@ index 000000000..97052d7a9
+ name: cephfs-storage-init
+ defaultMode: 0555
+ containers:
+ {{- range $sc := .Values.storageClasses }}
+ {{- range $sc := .Values.classes }}
+ - name: storage-init-{{- $sc.name }}
+ image: "{{ $.Values.storage_init.image.repository }}:{{ $.Values.storage_init.image.tag }}"
+ command: ["/bin/bash", "/tmp/storage-init.sh"]

View File

@ -1,12 +1,11 @@
From 080cad7da551b36ee22139c558770cf6520a0d55 Mon Sep 17 00:00:00 2001
From: Gabriel de Araújo Cabral <gabriel.cabral@windriver.com>
Date: Wed, 6 Dec 2023 14:17:19 -0300
From 4e3d4d76c16c4d03ba33afd0581ceac5f5ea3147 Mon Sep 17 00:00:00 2001
From: Erickson Silva de Oliveira <Erickson.SilvadeOliveira@windriver.com>
Date: Mon, 24 Apr 2023 17:04:02 -0300
Subject: [PATCH] ceph-csi-rbd: add storage-init.yaml
Signed-off-by: Hediberto Cavalcante da Silva <hediberto.cavalcantedasilva@windriver.com>
Signed-off-by: Felipe Sanches Zanoni <Felipe.SanchesZanoni@windriver.com>
Signed-off-by: Erickson Silva de Oliveira <Erickson.SilvadeOliveira@windriver.com>
Signed-off-by: Gabriel de Araújo Cabral <gabriel.cabral@windriver.com>
---
.../ceph-csi-rbd/templates/storage-init.yaml | 394 ++++++++++++++++++
1 file changed, 394 insertions(+)
@ -373,7 +372,7 @@ index 000000000..6abd8ec3f
+ configMap:
+ name: rbd-storage-init
+ containers:
+ {{- range $sc := .Values.storageClasses }}
+ {{- range $sc := .Values.classes }}
+ - name: storage-init-{{- $sc.name }}
+ image: "{{ $.Values.storage_init.image.repository }}:{{ $.Values.storage_init.image.tag }}"
+ command: [ "/bin/bash", "/tmp/storage-init.sh" ]

View File

@ -1,11 +1,10 @@
From d4ecc92cf187225ab4cdb882370647cb5b5d0d3b Mon Sep 17 00:00:00 2001
From: Gabriel de Araújo Cabral <gabriel.cabral@windriver.com>
Date: Wed, 6 Dec 2023 14:22:19 -0300
From e02f28d37a57550e4e4127c5b3758e865cfc4d7e Mon Sep 17 00:00:00 2001
From: Erickson Silva de Oliveira <Erickson.SilvadeOliveira@windriver.com>
Date: Mon, 20 Mar 2023 17:56:25 -0300
Subject: [PATCH] ceph-csi-rbd: update storageclass
Signed-off-by: Hediberto Cavalcante da Silva <hediberto.cavalcantedasilva@windriver.com>
Signed-off-by: Erickson Silva de Oliveira <Erickson.SilvadeOliveira@windriver.com>
Signed-off-by: Gabriel de Araújo Cabral <gabriel.cabral@windriver.com>
---
.../ceph-csi-rbd/templates/storageclass.yaml | 162 ++++++++++--------
1 file changed, 93 insertions(+), 69 deletions(-)
@ -18,7 +17,7 @@ index a559456aa..b53c3dc6c 100644
{{- if .Values.storageClass.create -}}
+{{- $cephCsiDefault := .Values.storageClass }}
+{{- $defaults := .Values.classdefaults }}
+{{- range $sc := .Values.storageClasses }}
+{{- range $sc := .Values.classes }}
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:

View File

@ -1,11 +1,10 @@
From 93ae57852cf8583228e99465c3d35e5304b88e65 Mon Sep 17 00:00:00 2001
From: Gabriel de Araújo Cabral <gabriel.cabral@windriver.com>
Date: Wed, 6 Dec 2023 14:24:22 -0300
From 8ef1e051d4166dd0f9f8c931465b27cadfde7ca0 Mon Sep 17 00:00:00 2001
From: Erickson Silva de Oliveira <Erickson.SilvadeOliveira@windriver.com>
Date: Tue, 21 Mar 2023 21:09:29 -0300
Subject: [PATCH] ceph-csi-cephfs: update storageclass
Signed-off-by: Hediberto Cavalcante da Silva <hediberto.cavalcantedasilva@windriver.com>
Signed-off-by: Erickson Silva de Oliveira <Erickson.SilvadeOliveira@windriver.com>
Signed-off-by: Gabriel de Araújo Cabral <gabriel.cabral@windriver.com>
---
.../templates/storageclass.yaml | 104 ++++++++++--------
1 file changed, 56 insertions(+), 48 deletions(-)
@ -18,7 +17,7 @@ index a21c99824..e3a27b455 100644
{{- if .Values.storageClass.create -}}
+{{- $cephCsiDefault := .Values.storageClass }}
+{{- $defaults := .Values.classdefaults }}
+{{- range $sc := .Values.storageClasses }}
+{{- range $sc := .Values.classes }}
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:

View File

@ -1,62 +0,0 @@
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: ""
+ # K8 secret name
+ provisionerSecret: csi-cephfs-secret
+ # K8 secret namespace
+ provisionerSecretNamespace: ""
+ deletionPolicy: Delete
+
secret:
# Specifies whether the secret should be created
create: false
--
2.25.1

View File

@ -1,62 +0,0 @@
From d6dbc163f3be00789a74f85556de4486792f9d72 Mon Sep 17 00:00:00 2001
From: Gabriel de Araújo Cabral <gabriel.cabral@windriver.com>
Date: Thu, 30 Nov 2023 13:38:09 -0300
Subject: ceph-csi-rbd: add snapshotclass
Signed-off-by: Gabriel de Araújo Cabral <gabriel.cabral@windriver.com>
---
.../ceph-csi-rbd/templates/snapshotclass.yaml | 13 +++++++++++++
charts/ceph-csi-rbd/values.yaml | 18 ++++++++++++++++++
2 files changed, 31 insertions(+)
create mode 100644 charts/ceph-csi-rbd/templates/snapshotclass.yaml
diff --git a/charts/ceph-csi-rbd/templates/snapshotclass.yaml b/charts/ceph-csi-rbd/templates/snapshotclass.yaml
new file mode 100644
index 000000000..3bad19026
--- /dev/null
+++ b/charts/ceph-csi-rbd/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-rbd/values.yaml b/charts/ceph-csi-rbd/values.yaml
index c33d5f2a6..8dd9ea3d5 100644
--- a/charts/ceph-csi-rbd/values.yaml
+++ b/charts/ceph-csi-rbd/values.yaml
@@ -449,6 +449,24 @@ storageClass:
# selinux-enabled filesystems
selinuxMount: true
+snapshotClass:
+ # Specifies whether the snapshotclass should be created
+ create: false
+ # Specifies the snapshotclass name
+ name: csi-rbdplugin-snapclass
+ # (required) Unique string representing a Ceph cluster to provision
+ #storage from.
+ clusterID: <cluster-ID>
+ # Prefix to use for naming RBD snapshots.
+ # If omitted, defaults to "csi-snap-".
+ # snapshotNamePrefix: "foo-bar-"
+ snapshotNamePrefix: ""
+ # K8 secret name
+ provisionerSecret: csi-rbd-secret
+ # K8 secret namespace
+ provisionerSecretNamespace: ""
+ deletionPolicy: Delete
+
secret:
# Specifies whether the secret should be created
create: false
--
2.25.1

View File

@ -10,5 +10,3 @@
0010-ceph-csi-rbd-add-annotations-to-provisioner-deployment.patch
0011-ceph-csi-rbd-update-storageclass.patch
0012-ceph-csi-cephfs-update-storageclass.patch
0013-ceph-csi-cephfs-add-snapshotclass.patch
0014-ceph-csi-rbd-add-snapshotclass.patch

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2020-2023 Wind River Systems, Inc.
# Copyright (c) 2020-2022 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@ -192,11 +192,6 @@ class CephFSProvisionerHelm(base.FluxCDBaseHelm):
storage_classes.append(storage_class)
snapshot_class = {
"clusterID": cluster_id,
"provisionerSecret": user_secret_name or class_defaults["adminSecretName"]
}
provisioner = {
"replicaCount": self._num_replicas_for_platform_app()
}
@ -211,8 +206,7 @@ class CephFSProvisionerHelm(base.FluxCDBaseHelm):
overrides = {
app_constants.HELM_NS_CEPH_FS_PROVISIONER: {
"storageClasses": storage_classes,
"snapshotClass": snapshot_class,
"classes": storage_classes,
"provisioner": provisioner,
"csiConfig": csi_config,
"classdefaults": class_defaults

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2020-2023 Wind River Systems, Inc.
# Copyright (c) 2020-2022 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@ -107,11 +107,6 @@ class RbdProvisionerHelm(base.FluxCDBaseHelm):
storage_classes.append(storage_class)
snapshot_class = {
"clusterID": cluster_id,
"provisionerSecret": user_secret_name or class_defaults["adminSecretName"]
}
provisioner = {
"replicaCount": self._num_replicas_for_platform_app()
}
@ -123,8 +118,7 @@ class RbdProvisionerHelm(base.FluxCDBaseHelm):
overrides = {
common.HELM_NS_RBD_PROVISIONER: {
"storageClasses": storage_classes,
"snapshotClass": snapshot_class,
"classes": storage_classes,
"provisioner": provisioner,
"csiConfig": csi_config,
"classdefaults": class_defaults

View File

@ -83,12 +83,6 @@ storageClass:
"helm.sh/hook-delete-policy": "before-hook-creation"
}
snapshotClass:
create: false
name: cephfs-snapshot
snapshotNamePrefix: cephfs-snap-
provisionerSecretNamespace: kube-system
topology:
enabled: false

View File

@ -84,12 +84,6 @@ storageClass:
mountOptions:
- discard
snapshotClass:
create: false
name: rbd-snapshot
snapshotNamePrefix: rbd-snap-
provisionerSecretNamespace: kube-system
topology:
enabled: false