Skip to content

Commit

Permalink
Allow keeping the data volume (#155)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
cfiehe and Christoph Fiehe authored Nov 21, 2024
1 parent 4aab013 commit 588ee64
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,14 @@ and their default values.
| `nodeSelector` | Node labels for pod assignment | `{}` |
| `tolerations` | List of node taints to tolerate | `[]` |
| `persistence.accessMode` | PVC Access Mode for Verdaccio volume | `ReadWriteOnce` |
| `persistence.annotations` | Annotations to add to the PVC | `{}` |
| `persistence.enabled` | Enable persistence using PVC | `true` |
| `persistence.existingClaim` | Use existing PVC | `nil` |
| `persistence.mounts` | Additional mounts | `nil` |
| `persistence.resourcePolicy` | Set "keep" to avoid removing PVC during a helm delete operation | `""` |
| `persistence.selector` | Selector to match an existing Persistent Volume | `{}` (evaluated as a template) |
| `persistence.size` | PVC Storage Request for Verdaccio volume | `8Gi` |
| `persistence.storageClass` | PVC Storage Class for Verdaccio volume | `nil` |
| `persistence.selector` | Selector to match an existing Persistent Volume | `{}` (evaluated as a template) |
| `persistence.volumes` | Additional volumes | `nil` |
| `topologySpreadConstraints` | Topology Spread Constraints for pod assignment | `[]` |
| `podLabels` | Additional pod labels | `{}` (evaluated as a template) |
Expand Down
2 changes: 1 addition & 1 deletion charts/verdaccio/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
description: A lightweight private node.js proxy registry
name: verdaccio
version: 4.20.0
version: 4.21.0
appVersion: 6.0.0
home: https://verdaccio.org
icon: https://cdn.verdaccio.dev/logos/default.png
Expand Down
7 changes: 7 additions & 0 deletions charts/verdaccio/templates/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "verdaccio.fullname" . }}
annotations:
{{- range $key, $value := .Values.persistence.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- if eq .Values.persistence.resourcePolicy "keep" }}
helm.sh/resource-policy: keep
{{- end }}
labels:
{{- include "verdaccio.labels" . | nindent 4 }}
spec:
Expand Down
4 changes: 4 additions & 0 deletions charts/verdaccio/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ persistence:

accessMode: ReadWriteOnce
size: 8Gi
annotations: {}
# Set it to "keep" to avoid removing PVC during a helm delete operation.
# Leaving it empty will delete PVC after the chart has been deleted.
resourcePolicy: ""
## selector can be used to match an existing PersistentVolume
## selector:
## matchLabels:
Expand Down

0 comments on commit 588ee64

Please sign in to comment.