diff --git a/matrix-synapse/Chart.yaml b/matrix-synapse/Chart.yaml index e7cba8c..f34e6ec 100644 --- a/matrix-synapse/Chart.yaml +++ b/matrix-synapse/Chart.yaml @@ -4,7 +4,7 @@ name: matrix-synapse description: Matrix reference homeserver icon: https://matrix.org/images/matrix-logo.svg type: application -version: 0.0.2 +version: 0.0.3 # renovate: image=ghcr.io/element-hq/synapse appVersion: 1.101.0 maintainers: diff --git a/matrix-synapse/README.adoc b/matrix-synapse/README.adoc index 88f5f43..d9010a8 100644 --- a/matrix-synapse/README.adoc +++ b/matrix-synapse/README.adoc @@ -2,7 +2,7 @@ = matrix-synapse -image::https://img.shields.io/badge/Version-0.0.2-informational?style=flat-square[Version: 0.0.2] +image::https://img.shields.io/badge/Version-0.0.3-informational?style=flat-square[Version: 0.0.3] image::https://img.shields.io/badge/Version-application-informational?style=flat-square[Type: application] image::https://img.shields.io/badge/AppVersion-1.101.0-informational?style=flat-square[AppVersion: 1.101.0] == Maintainers @@ -237,16 +237,36 @@ helm uninstall matrix-synapse-release | `"ReadWriteOnce"` | +| persistence.annotations +| object +| `{}` +| + | persistence.enabled | bool | `true` | +| persistence.existingClaim +| string +| `nil` +| A manually managed Persistent Volume and Claim Requires persistence.enabled: true If defined, PVC must be created manually before volume will be bound + +| persistence.hostPath +| string +| `nil` +| Do not create an PVC, direct use hostPath in Pod + | persistence.size | string | `"10Gi"` | +| persistence.storageClass +| string +| `nil` +| Persistent Volume Storage Class If defined, storageClassName: If set to "-", storageClassName: "", which disables dynamic provisioning If undefined (the default) or set to null, no storageClassName spec is set, choosing the default provisioner. (gp2 on AWS, standard on GKE, AWS & OpenStack) + | postgresql.auth.database | string | `"synapse"` diff --git a/matrix-synapse/templates/deployment.yaml b/matrix-synapse/templates/deployment.yaml index f7ab9e1..9f15533 100644 --- a/matrix-synapse/templates/deployment.yaml +++ b/matrix-synapse/templates/deployment.yaml @@ -152,9 +152,9 @@ spec: mountPath: /synapse/data - name: tmpdir mountPath: /tmp - {{- with .Values.synapse.extraVolumeMounts }} + {{- with .Values.synapse.extraVolumeMounts }} {{- . | toYaml | nindent 12 }} - {{- end }} + {{- end }} resources: {{- toYaml .Values.synapse.resources | nindent 12 }} volumes: @@ -175,30 +175,38 @@ spec: - name: tmpdir emptyDir: {} - name: media - {{- $mediaworker := false }} - {{- range $worker, $config := .Values.workers }} + {{- $mediaworker := false }} + {{- range $worker, $config := .Values.workers }} {{- if eq $worker "media_repository" }} - {{- $mediaworker = ($config.enabled | default false) }} + {{- $mediaworker = ($config.enabled | default false) }} {{- end }} - {{- end }} - {{- if and .Values.persistence.enabled (not $mediaworker) }} + {{- end }} + {{- if $mediaworker }} + emptyDir: {} + {{- else }} + {{- if .Values.persistence.hostPath }} + hostPath: + type: Directory + path: {{ .Values.persistence.hostPath | quote }} + {{- else if .Values.persistence.enabled }} persistentVolumeClaim: claimName: {{ .Values.persistence.existingClaim | default (include "matrix-synapse.fullname" .) }} - {{- else }} + {{- else }} emptyDir: {} - {{- end }} + {{- end }}{{/* end-if hostPath+persistent*/}} + {{- end }}{{/* end-if not $mediaworker */}} {{- with .Values.synapse.extraVolumes }} - {{- . | toYaml | nindent 8 }} + {{- . | toYaml | nindent 8 }} {{- end }} {{- with .Values.synapse.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.synapse.affinity }} + {{- with .Values.synapse.affinity }} affinity: {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.synapse.tolerations }} + {{- end }} + {{- with .Values.synapse.tolerations }} tolerations: {{- toYaml . | nindent 8 }} - {{- end }} + {{- end }} diff --git a/matrix-synapse/templates/pvc.yaml b/matrix-synapse/templates/pvc.yaml index f038c43..0a33298 100644 --- a/matrix-synapse/templates/pvc.yaml +++ b/matrix-synapse/templates/pvc.yaml @@ -1,22 +1,29 @@ -{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}} +{{- if and + .Values.persistence.enabled + (not .Values.persistence.existingClaim) + (not .Values.persistence.hostPath) +-}} kind: PersistentVolumeClaim apiVersion: v1 metadata: name: {{ template "matrix-synapse.fullname" . }} labels: {{- include "matrix-synapse.labels" . | nindent 4 }} + {{- with .Values.persistence.annotations }} + annotations: + {{ toYaml . | indent 4 }} + {{- end }} spec: accessModes: - {{ .Values.persistence.accessMode | quote }} resources: requests: storage: {{ .Values.persistence.size | quote }} -{{- if .Values.persistence.storageClass }} -{{- if (eq "-" .Values.persistence.storageClass) }} + {{- with .Values.persistence.storageClass }} + {{- if (eq "-" .) }} storageClassName: "" -{{- else }} - storageClassName: "{{ .Values.persistence.storageClass }}" -{{- end }} -{{- end }} + {{- else }} + storageClassName: {{ . | quote }} + {{- end }} + {{- end }} {{- end -}} - diff --git a/matrix-synapse/templates/worker/deployment.yaml b/matrix-synapse/templates/worker/deployment.yaml index 38a19e4..2f56af4 100644 --- a/matrix-synapse/templates/worker/deployment.yaml +++ b/matrix-synapse/templates/worker/deployment.yaml @@ -201,17 +201,21 @@ spec: path: signing.key - name: tmpconf emptyDir: {} - {{- if eq $name "media-repository" }} + {{- if eq $name "media-repository" }} - name: media - {{- if $.Values.persistence.enabled }} + {{- if $.Values.persistence.hostPath }} + hostPath: + type: Directory + path: {{ .Values.persistence.hostPath | quote }} + {{- else if $.Values.persistence.enabled }} persistentVolumeClaim: claimName: {{ $.Values.persistence.existingClaim | default (include "matrix-synapse.fullname" $) }} - {{- else }} + {{- else }} emptyDir: {} + {{- end }} + {{- end }}{{/* end-if media-repository */}} + {{- with $config.volumes | default $default.volumes }} + {{- toYaml . | nindent 8 }} {{- end }} - {{- end }} - {{- with $config.volumes | default $default.volumes }} - {{ . | toYaml | nindent 8 }} - {{- end }} {{- end }} {{- end }} diff --git a/matrix-synapse/values.yaml b/matrix-synapse/values.yaml index 3256e7b..5bf991f 100644 --- a/matrix-synapse/values.yaml +++ b/matrix-synapse/values.yaml @@ -760,9 +760,22 @@ externalRedis: ## persistence: enabled: true - # existingClaim: synapse-data + annotations: {} + # -- Persistent Volume Storage Class + # If defined, storageClassName: + # If set to "-", storageClassName: "", which disables dynamic provisioning + # If undefined (the default) or set to null, no storageClassName spec is + # set, choosing the default provisioner. (gp2 on AWS, standard on + # GKE, AWS & OpenStack) + storageClass: - # storageClass: "-" + # -- A manually managed Persistent Volume and Claim + # Requires persistence.enabled: true + # If defined, PVC must be created manually before volume will be bound + existingClaim: + + # -- Do not create an PVC, direct use hostPath in Pod + hostPath: accessMode: ReadWriteOnce size: 10Gi