Skip to content

Commit 0126d1e

Browse files
feat: add possibility to create pvc from snapshot (#245)
1 parent c20a205 commit 0126d1e

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

charts/common/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ maintainers:
99
1010
name: common
1111
type: library
12-
version: 1.5.1
12+
version: 1.5.2

charts/common/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# common
22

3-
![Version: 1.5.1](https://img.shields.io/badge/Version-1.5.1-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square)
3+
![Version: 1.5.2](https://img.shields.io/badge/Version-1.5.2-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square)
44

55
Function library for Helm charts
66

@@ -125,6 +125,7 @@ Kubernetes: `>=1.22.0-0`
125125
| persistence | object | See below | Configure persistence for the chart here. Additional items can be added by adding a dictionary key similar to the 'config' key. |
126126
| persistence.config | object | See below | Default persistence for configuration files. |
127127
| persistence.config.accessMode | string | `"ReadWriteOnce"` | AccessMode for the persistent volume. Make sure to select an access mode that is supported by your storage provider! [[ref]](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes) |
128+
| persistence.config.dataSource | string | `nil` | Set dataSource to mount pvc from a snapshot |
128129
| persistence.config.enabled | bool | `false` | Enables or disables the persistence item |
129130
| persistence.config.existingClaim | string | `nil` | If you want to reuse an existing claim, the name of the existing PVC can be passed here. |
130131
| persistence.config.mountPath | string | `nil` | Where to mount the volume in the main container. Defaults to `/<name_of_the_volume>`, setting to '-' creates the volume but disables the volumeMount. |

charts/common/templates/classes/_pvc.tpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,8 @@ spec:
4242
{{- if $values.volumeName }}
4343
volumeName: {{ $values.volumeName | quote }}
4444
{{- end }}
45+
{{- if $values.dataSource }}
46+
dataSource:
47+
{{- $values.dataSource | toYaml | nindent 4 }}
48+
{{- end }}
4549
{{- end -}}

charts/common/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,12 @@ persistence:
535535
# -- Set to true to retain the PVC upon `helm uninstall`
536536
retain: false
537537

538+
# -- Set dataSource to mount pvc from a snapshot
539+
dataSource:
540+
# name: ""
541+
# kind: VolumeSnapshot
542+
# apiGroup: snapshot.storage.k8s.io
543+
538544
# -- Create an emptyDir volume to share between all containers
539545
# [[ref]]https://kubernetes.io/docs/concepts/storage/volumes/#emptydir)
540546
# @default -- See below

0 commit comments

Comments
 (0)