diff --git a/charts/templates/pvc.yaml b/charts/templates/pvc.yaml index 5dfab8fc..640fb9fe 100644 --- a/charts/templates/pvc.yaml +++ b/charts/templates/pvc.yaml @@ -20,7 +20,7 @@ kind: PersistentVolumeClaim apiVersion: v1 metadata: name: {{ include "answer.fullname" . }}-claim - {{- with .Values.persistence.annotations }} + {{- with .Values.persistence.annotations }} annotations: {{ toYaml . | indent 4 }} {{- end }} @@ -39,4 +39,10 @@ spec: resources: requests: storage: {{ .Values.persistence.size | quote }} + {{- with .Values.persistence.dataSource }} + dataSource: + name: {{ .name }} + kind: {{ .kind | default "VolumeSnapshot" }} + apiGroup: {{ .apiGroup | default "snapshot.storage.k8s.io" }} + {{- end }} {{- end }} \ No newline at end of file diff --git a/charts/values.yaml b/charts/values.yaml index 8bb36c46..d932db84 100644 --- a/charts/values.yaml +++ b/charts/values.yaml @@ -68,7 +68,7 @@ env: # Configure extra containers extraContainers: [] - # - name: cloudsql-proxy + # - name: cloudsql-proxy # image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.1.2 # command: # - /cloud-sql-proxy @@ -91,6 +91,12 @@ persistence: accessMode: ReadWriteOnce size: 5Gi annotations: {} + # To restore a PVC from a VolumeSnapshot, set the dataSource; + # the kind and apiGroup are optional and default to the shown values + dataSource: {} + # name: my-volume-snapshot + # kind: VolumeSnapshot + # apiGroup: snapshot.storage.k8s.io imagePullSecrets: [] nameOverride: ""