Skip to content

Commit 016abd1

Browse files
builtrollerkumfo
authored andcommitted
add pvc dataSource
- allow for restoring a volumeSnapshot
1 parent 1b043d3 commit 016abd1

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

charts/templates/pvc.yaml

+7-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ kind: PersistentVolumeClaim
2020
apiVersion: v1
2121
metadata:
2222
name: {{ include "answer.fullname" . }}-claim
23-
{{- with .Values.persistence.annotations }}
23+
{{- with .Values.persistence.annotations }}
2424
annotations:
2525
{{ toYaml . | indent 4 }}
2626
{{- end }}
@@ -39,4 +39,10 @@ spec:
3939
resources:
4040
requests:
4141
storage: {{ .Values.persistence.size | quote }}
42+
{{- with .Values.persistence.dataSource }}
43+
dataSource:
44+
name: {{ .name }}
45+
kind: {{ .kind | default "VolumeSnapshot" }}
46+
apiGroup: {{ .apiGroup | default "snapshot.storage.k8s.io" }}
47+
{{- end }}
4248
{{- end }}

charts/values.yaml

+7-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ env:
6868

6969
# Configure extra containers
7070
extraContainers: []
71-
# - name: cloudsql-proxy
71+
# - name: cloudsql-proxy
7272
# image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.1.2
7373
# command:
7474
# - /cloud-sql-proxy
@@ -91,6 +91,12 @@ persistence:
9191
accessMode: ReadWriteOnce
9292
size: 5Gi
9393
annotations: {}
94+
# To restore a PVC from a VolumeSnapshot, set the dataSource;
95+
# the kind and apiGroup are optional and default to the shown values
96+
dataSource: {}
97+
# name: my-volume-snapshot
98+
# kind: VolumeSnapshot
99+
# apiGroup: snapshot.storage.k8s.io
94100

95101
imagePullSecrets: []
96102
nameOverride: ""

0 commit comments

Comments
 (0)