Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow persistent volume name to be overridden in the helm chart #38752

Merged
merged 4 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deploy/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ sources:
- https://github.com/appsmithorg/appsmith
home: https://www.appsmith.com/
icon: https://assets.appsmith.com/appsmith-icon.png
version: 3.6.0
version: 3.6.1
dependencies:
- condition: redis.enabled
name: redis
Expand Down
6 changes: 6 additions & 0 deletions deploy/helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ Return the proper Storage Class
{{- end -}}
{{- end -}}

{{- end -}}
{{/*
Get the PV name, using override if specified
*/}}
{{- define "appsmith.pvName" -}}
{{- .Values.persistence.pvNameOverride | default (include "appsmith.fullname" .) -}}
{{- end -}}

{{/*
Expand Down
3 changes: 1 addition & 2 deletions deploy/helm/templates/persistentVolume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: {{ include "appsmith.fullname" . }}
namespace: {{ include "appsmith.namespace" . }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing this while I'm in here. PVs are not a namespaced object. Helm and some clients will simply ignore this, but not all.

name: {{ include "appsmith.pvName" . }}
spec:
capacity:
storage: {{ .Values.persistence.size | quote }}
Expand Down
2 changes: 1 addition & 1 deletion deploy/helm/templates/persistentVolumeClaim.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
{{- if .Values.persistence.existingClaim.enabled }}
volumeName: {{ .Values.persistence.existingClaim.name }}
{{- else}}
volumeName: {{ include "appsmith.fullname" . }}
volumeName: {{ include "appsmith.pvName" . }}
{{- end }}
resources:
requests:
Expand Down
7 changes: 7 additions & 0 deletions deploy/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,13 @@ persistence:
## Fine tuning for volumeClaimTemplates
##
reclaimPolicy: Retain

## @param persistence.pvNameOverride Override the PV name
## Useful when deploying multiple releases across different namespaces with the same name
## since PersistentVolumes are cluster-scoped resources
##
pvNameOverride: ""

existingClaim:
enabled:
name:
Expand Down
Loading