From e6a5fa95fc96c4a06785c73099ce07c8d11bc6f9 Mon Sep 17 00:00:00 2001 From: Alexander Olofsson Date: Mon, 10 Aug 2020 12:44:37 +0200 Subject: [PATCH] matrix-synapse: Bugfixes galore --- charts/matrix-synapse/Chart.yaml | 2 +- .../matrix-synapse/templates/deployment.yaml | 21 ++++++++++--------- .../templates/worker-configuration.yaml | 9 ++++++++ 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/charts/matrix-synapse/Chart.yaml b/charts/matrix-synapse/Chart.yaml index 09dd234..5c588a9 100644 --- a/charts/matrix-synapse/Chart.yaml +++ b/charts/matrix-synapse/Chart.yaml @@ -5,7 +5,7 @@ description: Matrix reference homeserver appVersion: 1.18.0 type: application -version: 0.1.1 +version: 0.1.2 maintainers: - name: Alexander Olofsson email: ace@haxalot.com diff --git a/charts/matrix-synapse/templates/deployment.yaml b/charts/matrix-synapse/templates/deployment.yaml index e319437..b92dd83 100644 --- a/charts/matrix-synapse/templates/deployment.yaml +++ b/charts/matrix-synapse/templates/deployment.yaml @@ -1,6 +1,6 @@ -# {{- required "A valid .Values.config.serverName is required" .Values.config.serverName -}} {{- $needsVolumePermissions := and .Values.volumePermissions.enabled (or .Values.persistence.enabled .Values.persistence.existingClaim) }} --- +# Server: {{ required "A valid .Values.config.serverName is required" .Values.config.serverName -}} apiVersion: apps/v1 kind: Deployment metadata: @@ -47,27 +47,29 @@ spec: args: - synapse.app.homeserver env: - {{- if .Values.postgresql.enabled }} +{{- $postgresPass := include "matrix-synapse.postgresql.password" . }} + {{- if and .Values.postgresql.enabled (not $postgresPass) }} - name: POSTGRES_PASSWORD valueFrom: secretKeyRef: name: {{ include "matrix-synapse.postgresql.fullname" . }} key: postgresql-password {{- end }} - {{- if and .Values.redis.enabled (default .Values.redis.usePassword true) }} +{{- $redisPass := include "matrix-synapse.redis.password" . }} + {{- if and .Values.redis.enabled (default .Values.redis.usePassword true) (not $redisPass) }} - name: REDIS_PASSWORD valueFrom: secretKeyRef: name: {{ include "matrix-synapse.redis.fullname" . }} key: redis-password {{- end }} - {{- with .Values.extraEnv }} + {{- with .Values.synapse.extraEnv }} {{ . | toYaml }} {{- end }} image: "{{ .Values.image.repository }}:{{ include "matrix-synapse.imageTag" . }}" imagePullPolicy: {{ .Values.image.pullPolicy }} securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} + {{- toYaml .Values.synapse.securityContext | nindent 12 }} ports: - name: http containerPort: 8008 @@ -98,7 +100,7 @@ spec: - name: media mountPath: /synapse/data resources: - {{- toYaml .Values.resources | nindent 12 }} + {{- toYaml .Values.synapse.resources | nindent 12 }} volumes: - name: config configMap: @@ -115,7 +117,6 @@ spec: - name: tmpconf emptyDir: {} - name: media - {{- $mediaworker := false }} {{- range $worker, $config := .Values.workers }} {{- if eq $worker "media-repository" }} @@ -128,15 +129,15 @@ spec: {{- else }} emptyDir: {} {{- end }} - {{- with .Values.nodeSelector }} + {{- with .Values.synapse.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.affinity }} + {{- with .Values.synapse.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.tolerations }} + {{- with .Values.synapse.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} diff --git a/charts/matrix-synapse/templates/worker-configuration.yaml b/charts/matrix-synapse/templates/worker-configuration.yaml index 60cd51f..12e340d 100644 --- a/charts/matrix-synapse/templates/worker-configuration.yaml +++ b/charts/matrix-synapse/templates/worker-configuration.yaml @@ -1,3 +1,11 @@ +{{- $any := false }} +{{- range $worker, $config := .Values.workers }} + {{- if $config.enabled }} + {{- $any = true }} + {{- end }} +{{- end }} + +{{- if $any }} {{- $wkName := include "matrix-synapse.workername" (dict "global" . "worker" "workers") -}} --- apiVersion: v1 @@ -39,3 +47,4 @@ data: worker_log_config: /synapse/config/log.yaml {{- end }} {{- end }} +{{- end }}