Skip to content

Commit

Permalink
add pvc dataSource
Browse files Browse the repository at this point in the history
- allow for restoring a volumeSnapshot
  • Loading branch information
builtroller authored and kumfo committed Aug 19, 2024
1 parent 1b043d3 commit 016abd1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion charts/templates/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
8 changes: 7 additions & 1 deletion charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: ""
Expand Down

0 comments on commit 016abd1

Please sign in to comment.