diff --git a/charts/gotosocial/Chart.yaml b/charts/gotosocial/Chart.yaml index 78e2ad3..34f363c 100644 --- a/charts/gotosocial/Chart.yaml +++ b/charts/gotosocial/Chart.yaml @@ -6,7 +6,7 @@ home: https://github.com/superseriousbusiness/gotosocial type: application # Chart Version -version: "0.4.28" +version: "0.5.0" # gotosocial version appVersion: "0.17.3" @@ -19,4 +19,4 @@ dependencies: - name: postgresql version: ~11.9.13 repository: https://charts.bitnami.com/bitnami - condition: postgresql.enabled \ No newline at end of file + condition: postgresql.enabled diff --git a/charts/gotosocial/templates/_helpers.tpl b/charts/gotosocial/templates/_helpers.tpl index bd6d0bf..a3cd2e8 100644 --- a/charts/gotosocial/templates/_helpers.tpl +++ b/charts/gotosocial/templates/_helpers.tpl @@ -75,4 +75,15 @@ Set postgres host {{- if .Values.postgresql.enabled -}} {{- template "gotosocial.postgresql.fullname" . -}} {{- end -}} +{{- end -}} + +{{/* +Create Volumeclaim Name +*/}} +{{- define "gotosocial.volume.claimName" -}} +{{- if and .Values.gotosocial.persistence.enabled (ne .Values.gotosocial.persistence.existingClaim "") -}} +{{ .Values.gotosocial.persistence.existingClaim }} +{{- else -}} +{{ printf "%s-%s" (include "gotosocial.fullname" .) "data" }} +{{- end -}} {{- end -}} \ No newline at end of file diff --git a/charts/gotosocial/templates/deployment.yaml b/charts/gotosocial/templates/deployment.yaml index 3228255..a73e4ce 100644 --- a/charts/gotosocial/templates/deployment.yaml +++ b/charts/gotosocial/templates/deployment.yaml @@ -133,7 +133,7 @@ spec: {{- if .Values.gotosocial.persistence.enabled }} - name: gotosocial-data persistentVolumeClaim: - claimName: {{ $fullName }}-data + claimName: {{ include "gotosocial.volume.claimName" . }} {{- end }} {{- if .Values.gotosocial.tmpfs.enabled }} - name: tmpfs @@ -151,4 +151,4 @@ spec: {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} - {{- end }} \ No newline at end of file + {{- end }} diff --git a/charts/gotosocial/templates/pvc.yaml b/charts/gotosocial/templates/pvc.yaml index 074a087..8f19f5c 100644 --- a/charts/gotosocial/templates/pvc.yaml +++ b/charts/gotosocial/templates/pvc.yaml @@ -1,4 +1,4 @@ -{{- if .Values.gotosocial.persistence.enabled }} +{{- if and .Values.gotosocial.persistence.enabled (eq .Values.gotosocial.persistence.existingClaim "") -}} --- apiVersion: v1 kind: PersistentVolumeClaim diff --git a/charts/gotosocial/values.yaml b/charts/gotosocial/values.yaml index bbf4f3a..ad7aee2 100644 --- a/charts/gotosocial/values.yaml +++ b/charts/gotosocial/values.yaml @@ -47,6 +47,8 @@ gotosocial: accessMode: "ReadWriteOnce" size: "10Gi" #storageClass: "" + # use an existing persistent volume claim + existingClaim: "" tmpfs: enabled: false size: "1Gi" @@ -188,7 +190,7 @@ podSecurityContext: securityContext: capabilities: - drop: + drop: - ALL readOnlyRootFilesystem: true allowPrivilegeEscalation: false