PromucFlow_constructor/deploy/helm/templates/persistentVolumeClaim.yaml
Wyatt Walter 4caaa7411a
feat: allow persistent volume name to be overridden in the helm chart (#38752)
## Description

Exposes a value under the `persistence` key to allow the PV name to be
overridden. This was requested by a customer that does multiple deploys
of Appsmith per cluster in different namespaces with the same Helm
release name. Since PV's are not namespaced, the deploy was failing.

Fixes #`Issue Number`  
_or_  
Fixes `Issue URL`
> [!WARNING]  
> _If no issue exists, please create an issue first, and check with the
maintainers if the issue is valid._

## Automation

/ok-to-test tags=""

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!WARNING]
> Tests have not run on the HEAD
8a0e2ba2354c9a6742ca5d1a31d87559408325ec yet
> <hr>Thu, 23 Jan 2025 14:35:55 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
	- Added ability to override Persistent Volume (PV) name in Helm chart.
	- Enhanced configuration options for multi-namespace deployments.

- **Improvements**
- Introduced more flexible naming strategy for Persistent Volume
resources.
- Updated PersistentVolume and PersistentVolumeClaim resources to
utilize the new naming convention.
	- Updated application version from 3.6.0 to 3.6.1.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-01-29 13:49:59 +05:30

35 lines
1.1 KiB
YAML

{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim.enabled) ( .Values.autoscaling.enabled) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ include "appsmith.fullname" . }}
namespace: {{ include "appsmith.namespace" . }}
{{- with .Values.persistence.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
labels:
app: {{ include "appsmith.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
accessModes:
{{- range .Values.persistence.accessModes }}
- {{ . | quote }}
{{- end }}
{{- if .Values.persistence.existingClaim.enabled }}
volumeName: {{ .Values.persistence.existingClaim.name }}
{{- else}}
volumeName: {{ include "appsmith.pvName" . }}
{{- end }}
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
{{- if .Values.persistence.storageClass }}
storageClassName: {{ .Values.persistence.storageClass }}
{{- else }}
storageClassName: ""
{{- end }}
{{- end }}