Skip to content

Commit

Permalink
Merge pull request #12 from jessebot/patch-1
Browse files Browse the repository at this point in the history
gotosocial: Allow existingClaim for persistent volume
  • Loading branch information
0hlov3 authored Dec 23, 2024
2 parents 0d1bdd0 + 0f32837 commit 125d091
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
4 changes: 2 additions & 2 deletions charts/gotosocial/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -19,4 +19,4 @@ dependencies:
- name: postgresql
version: ~11.9.13
repository: https://charts.bitnami.com/bitnami
condition: postgresql.enabled
condition: postgresql.enabled
11 changes: 11 additions & 0 deletions charts/gotosocial/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
4 changes: 2 additions & 2 deletions charts/gotosocial/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -151,4 +151,4 @@ spec:
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/gotosocial/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.gotosocial.persistence.enabled }}
{{- if and .Values.gotosocial.persistence.enabled (eq .Values.gotosocial.persistence.existingClaim "") -}}
---
apiVersion: v1
kind: PersistentVolumeClaim
Expand Down
4 changes: 3 additions & 1 deletion charts/gotosocial/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ gotosocial:
accessMode: "ReadWriteOnce"
size: "10Gi"
#storageClass: ""
# use an existing persistent volume claim
existingClaim: ""
tmpfs:
enabled: false
size: "1Gi"
Expand Down Expand Up @@ -188,7 +190,7 @@ podSecurityContext:

securityContext:
capabilities:
drop:
drop:
- ALL
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
Expand Down

0 comments on commit 125d091

Please sign in to comment.