helm: Support VolumeSnapshotClass and VolumeGroupSnapshotClass

This PR add support for creating VolumeSnapshotClass and
VolumeGroupSnapshotClass with helm charts. Both default with
`create: false` as StorageClass support.

Moreover, it handle the chart release with branch `gh-pages`, by
integrate with <https://github.com/helm/chart-releaser-action>.

The sample helm repo could find from
<https://alvistack.github.io/ceph-ceph-csi/index.yaml>, by:

    helm repo add ceph-csi https://alvistack.github.io/ceph-ceph-csi
    helm repo update
    helm search repo ceph-csi

Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
This commit is contained in:
Wong Hoi Sing Edison
2025-04-10 18:19:32 +08:00
parent 73579f94c7
commit dd3139dfb1
9 changed files with 284 additions and 0 deletions

View File

@ -0,0 +1,30 @@
{{- if .Values.volumeGroupSnapshotClass.create -}}
apiVersion: groupsnapshot.storage.k8s.io/v1beta1
kind: VolumeGroupSnapshotClass
metadata:
name: {{ .Values.volumeGroupSnapshotClass.name }}
{{- if .Values.volumeGroupSnapshotClass.annotations }}
annotations:
{{ toYaml .Values.volumeGroupSnapshotClass.annotations | indent 4 }}
{{- end }}
labels:
app: {{ include "ceph-csi-rbd.name" . }}
chart: {{ include "ceph-csi-rbd.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }}
driver: {{ .Values.driverName }}
parameters:
clusterID: {{ .Values.volumeGroupSnapshotClass.clusterID }}
pool: {{ .Values.volumeGroupSnapshotClass.pool }}
{{- if .Values.volumeGroupSnapshotClass.volumeGroupNamePrefix }}
volumeGroupNamePrefix: "{{ .Values.volumeGroupSnapshotClass.volumeGroupNamePrefix }}"
{{- end }}
csi.storage.k8s.io/group-snapshotter-secret-name: {{ .Values.volumeGroupSnapshotClass.groupSnapshotterSecret }}
{{- if .Values.volumeGroupSnapshotClass.groupSnapshotterSecretNamespace }}
csi.storage.k8s.io/group-snapshotter-secret-namespace: {{ .Values.volumeGroupSnapshotClass.groupSnapshotterSecretNamespace }}
{{ else }}
csi.storage.k8s.io/group-snapshotter-secret-namespace: {{ .Release.Namespace }}
{{- end }}
deletionPolicy: {{ .Values.volumeGroupSnapshotClass.deletionPolicy }}
{{- end -}}

View File

@ -0,0 +1,29 @@
{{- if .Values.volumeSnapshotClass.create -}}
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
name: {{ .Values.volumeSnapshotClass.name }}
{{- if .Values.volumeSnapshotClass.annotations }}
annotations:
{{ toYaml .Values.volumeSnapshotClass.annotations | indent 4 }}
{{- end }}
labels:
app: {{ include "ceph-csi-rbd.name" . }}
chart: {{ include "ceph-csi-rbd.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }}
driver: {{ .Values.driverName }}
parameters:
clusterID: {{ .Values.volumeSnapshotClass.clusterID }}
{{- if .Values.volumeSnapshotClass.snapshotNamePrefix }}
snapshotNamePrefix: "{{ .Values.volumeSnapshotClass.snapshotNamePrefix }}"
{{- end }}
csi.storage.k8s.io/snapshotter-secret-name: {{ .Values.volumeSnapshotClass.snapshotterSecret }}
{{- if .Values.volumeSnapshotClass.snapshotterSecretNamespace }}
csi.storage.k8s.io/snapshotter-secret-namespace: {{ .Values.volumeSnapshotClass.snapshotterSecretNamespace }}
{{ else }}
csi.storage.k8s.io/snapshotter-secret-namespace: {{ .Release.Namespace }}
{{- end }}
deletionPolicy: {{ .Values.volumeSnapshotClass.deletionPolicy }}
{{- end -}}