Skip to content

Commit

Permalink
feat: add possibility to create pvc from snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
sbaizet-ledger committed Nov 29, 2024
1 parent c20a205 commit 2b9926a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ maintainers:
email: sebastien@scroll.io
name: common
type: library
version: 1.5.1
version: 1.5.2
3 changes: 2 additions & 1 deletion charts/common/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# common

![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)
![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)

Function library for Helm charts

Expand Down Expand Up @@ -125,6 +125,7 @@ Kubernetes: `>=1.22.0-0`
| 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. |
| persistence.config | object | See below | Default persistence for configuration files. |
| 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) |
| persistence.config.dataSource | string | `nil` | Set dataSource to mount pvc from a snapshot |
| persistence.config.enabled | bool | `false` | Enables or disables the persistence item |
| persistence.config.existingClaim | string | `nil` | If you want to reuse an existing claim, the name of the existing PVC can be passed here. |
| 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. |
Expand Down
4 changes: 4 additions & 0 deletions charts/common/templates/classes/_pvc.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,8 @@ spec:
{{- if $values.volumeName }}
volumeName: {{ $values.volumeName | quote }}
{{- end }}
{{- if $values.dataSource }}
dataSource:
{{- $values.dataSource | toYaml | nindent 4 }}
{{- end }}
{{- end -}}
6 changes: 6 additions & 0 deletions charts/common/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,12 @@ persistence:
# -- Set to true to retain the PVC upon `helm uninstall`
retain: false

# -- Set dataSource to mount pvc from a snapshot
dataSource:
# name: ""
# kind: VolumeSnapshot
# apiGroup: snapshot.storage.k8s.io

# -- Create an emptyDir volume to share between all containers
# [[ref]]https://kubernetes.io/docs/concepts/storage/volumes/#emptydir)
# @default -- See below
Expand Down

0 comments on commit 2b9926a

Please sign in to comment.