mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 18:43:34 +00:00
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:
30
charts/ceph-csi-rbd/templates/groupsnapshotclass.yaml
Normal file
30
charts/ceph-csi-rbd/templates/groupsnapshotclass.yaml
Normal 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 -}}
|
29
charts/ceph-csi-rbd/templates/snapshotclass.yaml
Normal file
29
charts/ceph-csi-rbd/templates/snapshotclass.yaml
Normal 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 -}}
|
Reference in New Issue
Block a user