Skip to content

Commit 588ee64

Browse files
cfieheChristoph Fiehe
and
Christoph Fiehe
authored
Allow keeping the data volume (#155)
This commit makes it possible to add custom annotations to the PVC and introduces a new property that allows keeping the data volume on a Helm uninstall operation. Signed-off-by: Christoph Fiehe <[email protected]> Co-authored-by: Christoph Fiehe <[email protected]>
1 parent 4aab013 commit 588ee64

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,14 @@ and their default values.
9393
| `nodeSelector` | Node labels for pod assignment | `{}` |
9494
| `tolerations` | List of node taints to tolerate | `[]` |
9595
| `persistence.accessMode` | PVC Access Mode for Verdaccio volume | `ReadWriteOnce` |
96+
| `persistence.annotations` | Annotations to add to the PVC | `{}` |
9697
| `persistence.enabled` | Enable persistence using PVC | `true` |
9798
| `persistence.existingClaim` | Use existing PVC | `nil` |
9899
| `persistence.mounts` | Additional mounts | `nil` |
100+
| `persistence.resourcePolicy` | Set "keep" to avoid removing PVC during a helm delete operation | `""` |
101+
| `persistence.selector` | Selector to match an existing Persistent Volume | `{}` (evaluated as a template) |
99102
| `persistence.size` | PVC Storage Request for Verdaccio volume | `8Gi` |
100103
| `persistence.storageClass` | PVC Storage Class for Verdaccio volume | `nil` |
101-
| `persistence.selector` | Selector to match an existing Persistent Volume | `{}` (evaluated as a template) |
102104
| `persistence.volumes` | Additional volumes | `nil` |
103105
| `topologySpreadConstraints` | Topology Spread Constraints for pod assignment | `[]` |
104106
| `podLabels` | Additional pod labels | `{}` (evaluated as a template) |

charts/verdaccio/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
description: A lightweight private node.js proxy registry
33
name: verdaccio
4-
version: 4.20.0
4+
version: 4.21.0
55
appVersion: 6.0.0
66
home: https://verdaccio.org
77
icon: https://cdn.verdaccio.dev/logos/default.png

charts/verdaccio/templates/pvc.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ kind: PersistentVolumeClaim
33
apiVersion: v1
44
metadata:
55
name: {{ template "verdaccio.fullname" . }}
6+
annotations:
7+
{{- range $key, $value := .Values.persistence.annotations }}
8+
{{ $key }}: {{ $value | quote }}
9+
{{- end }}
10+
{{- if eq .Values.persistence.resourcePolicy "keep" }}
11+
helm.sh/resource-policy: keep
12+
{{- end }}
613
labels:
714
{{- include "verdaccio.labels" . | nindent 4 }}
815
spec:

charts/verdaccio/values.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,10 @@ persistence:
214214

215215
accessMode: ReadWriteOnce
216216
size: 8Gi
217+
annotations: {}
218+
# Set it to "keep" to avoid removing PVC during a helm delete operation.
219+
# Leaving it empty will delete PVC after the chart has been deleted.
220+
resourcePolicy: ""
217221
## selector can be used to match an existing PersistentVolume
218222
## selector:
219223
## matchLabels:

0 commit comments

Comments
 (0)