From 1999e5d7108882c828d07d9220526dfc8d4e9c58 Mon Sep 17 00:00:00 2001 From: Anatolii Lapytskyi Date: Mon, 13 Nov 2023 12:51:11 +0100 Subject: [PATCH] Add support for existing persistance claim (#34) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add support for existing persistance claim * Seeder should be able to run in the same zone as the existing volume if needed * Bump chart to 2.5.0 --------- Co-authored-by: Anatolii Lapytskyi Co-authored-by: Oliver Günther --- charts/openproject/Chart.yaml | 2 +- charts/openproject/templates/persistentvolumeclaim.yaml | 2 ++ charts/openproject/templates/seeder-job.yaml | 6 +++++- charts/openproject/templates/web-deployment.yaml | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/charts/openproject/Chart.yaml b/charts/openproject/Chart.yaml index 5084581..3e69645 100644 --- a/charts/openproject/Chart.yaml +++ b/charts/openproject/Chart.yaml @@ -6,7 +6,7 @@ home: "https://www.openproject.org/" icon: "https://www.openproject.org/assets/images/press/openproject-icon-original-color-41055eb6.png" type: "application" appVersion: "13" -version: "2.4.0" +version: "2.5.0" maintainers: - name: OpenProject url: https://github.com/opf/helm-charts diff --git a/charts/openproject/templates/persistentvolumeclaim.yaml b/charts/openproject/templates/persistentvolumeclaim.yaml index 724ede0..640f05d 100644 --- a/charts/openproject/templates/persistentvolumeclaim.yaml +++ b/charts/openproject/templates/persistentvolumeclaim.yaml @@ -1,4 +1,5 @@ {{- if .Values.persistence.enabled }} +{{- if not .Values.persistence.existingClaim }} --- apiVersion: "v1" kind: "PersistentVolumeClaim" @@ -20,3 +21,4 @@ spec: storage: {{ .Values.persistence.size | quote }} ... {{- end }} +{{- end }} diff --git a/charts/openproject/templates/seeder-job.yaml b/charts/openproject/templates/seeder-job.yaml index 11a0a86..0d31dd7 100644 --- a/charts/openproject/templates/seeder-job.yaml +++ b/charts/openproject/templates/seeder-job.yaml @@ -12,11 +12,15 @@ spec: securityContext: {{ omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 | trim }} {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{ toYaml . | nindent 8 | trim }} + {{- end }} {{- if .Values.persistence.enabled }} volumes: - name: "data" persistentVolumeClaim: - claimName: {{ include "common.names.fullname" . }} + claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ include "common.names.fullname" . }}{{- end }} {{- end }} initContainers: - name: check-db-ready diff --git a/charts/openproject/templates/web-deployment.yaml b/charts/openproject/templates/web-deployment.yaml index ddd3188..6f67c2b 100644 --- a/charts/openproject/templates/web-deployment.yaml +++ b/charts/openproject/templates/web-deployment.yaml @@ -60,7 +60,7 @@ spec: {{- if .Values.persistence.enabled }} - name: "data" persistentVolumeClaim: - claimName: {{ include "common.names.fullname" . }} + claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ include "common.names.fullname" . }}{{- end }} {{- end }} initContainers: - name: wait-for-db