From 54e3a205f9033a37d70bde6fb295ce9c7b038f07 Mon Sep 17 00:00:00 2001 From: Nicolas Bonneval Date: Tue, 1 Dec 2020 17:48:50 +0100 Subject: [PATCH 1/6] Fixes for extraEnv - Fixed indentation - Fixed default type (yaml sequences instead of maps) --- charts/matrix-synapse/templates/deployment.yaml | 2 +- charts/matrix-synapse/templates/worker-deployment.yaml | 2 +- charts/matrix-synapse/values.yaml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/matrix-synapse/templates/deployment.yaml b/charts/matrix-synapse/templates/deployment.yaml index c7c444c..0480ea1 100644 --- a/charts/matrix-synapse/templates/deployment.yaml +++ b/charts/matrix-synapse/templates/deployment.yaml @@ -95,7 +95,7 @@ spec: key: redis-password {{- end }} {{- with .Values.synapse.extraEnv }} - {{ . | toYaml }} + {{- . | toYaml | nindent 12 }} {{- end }} image: "{{ .Values.image.repository }}:{{ include "matrix-synapse.imageTag" . }}" imagePullPolicy: {{ .Values.image.pullPolicy }} diff --git a/charts/matrix-synapse/templates/worker-deployment.yaml b/charts/matrix-synapse/templates/worker-deployment.yaml index 9eee724..766cf56 100644 --- a/charts/matrix-synapse/templates/worker-deployment.yaml +++ b/charts/matrix-synapse/templates/worker-deployment.yaml @@ -83,7 +83,7 @@ spec: key: redis-password {{- end }} {{- with $config.extraEnv | default $default.extraEnv }} - {{ . | toYaml }} + {{- . | toYaml | nindent 12 }} {{- end }} securityContext: {{- $config.securityContext | default $default.securityContext | toYaml | nindent 12 }} diff --git a/charts/matrix-synapse/values.yaml b/charts/matrix-synapse/values.yaml index 4c32b2c..f1ea017 100644 --- a/charts/matrix-synapse/values.yaml +++ b/charts/matrix-synapse/values.yaml @@ -158,7 +158,7 @@ synapse: ## Additional environment variables to apply to the main Synapse pod ## - extraEnv: {} + extraEnv: [] # - name: LD_PRELOAD # value: /usr/lib/x86_64-linux-gnu/libjemalloc.so.2 # - name: SYNAPSE_CACHE_FACTOR @@ -262,7 +262,7 @@ workers: ## Additional environment variables to add to the worker. ## - extraEnv: {} + extraEnv: [] # - name: LD_PRELOAD # value: /usr/lib/x86_64-linux-gnu/libjemalloc.so.2 # - name: SYNAPSE_CACHE_FACTOR From cd9900b37b160a1409de48ae7e8f610e76c57bc6 Mon Sep 17 00:00:00 2001 From: Nicolas Bonneval Date: Tue, 1 Dec 2020 17:59:01 +0100 Subject: [PATCH 2/6] Media worker name mismatch The 'eq' statement must test against the exact key name from the values file, so with an undescore (_) instead of dash (-). Causes synapse to (try to and fail) mount the same PVC as the media worker. --- charts/matrix-synapse/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/matrix-synapse/templates/deployment.yaml b/charts/matrix-synapse/templates/deployment.yaml index 0480ea1..8101888 100644 --- a/charts/matrix-synapse/templates/deployment.yaml +++ b/charts/matrix-synapse/templates/deployment.yaml @@ -159,7 +159,7 @@ spec: - name: media {{- $mediaworker := false }} {{- range $worker, $config := .Values.workers }} - {{- if eq $worker "media-repository" }} + {{- if eq $worker "media_repository" }} {{- $mediaworker = true }} {{- end }} {{- end }} From af847c473e6e5a68933fbfd90640c7517914acda Mon Sep 17 00:00:00 2001 From: Nicolas Bonneval Date: Thu, 10 Dec 2020 10:58:37 +0100 Subject: [PATCH 3/6] Fixed missing pull secrets for workers --- charts/matrix-synapse/templates/worker-deployment.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/charts/matrix-synapse/templates/worker-deployment.yaml b/charts/matrix-synapse/templates/worker-deployment.yaml index 766cf56..8dee253 100644 --- a/charts/matrix-synapse/templates/worker-deployment.yaml +++ b/charts/matrix-synapse/templates/worker-deployment.yaml @@ -33,10 +33,7 @@ spec: {{ . | toYaml | nindent 8 }} {{- end }} spec: - {{- with $.Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} + {{- include "matrix-synapse.imagePullSecrets" $ | nindent 6 }} securityContext: {{- $config.podSecurityContext | default $default.podSecurityContext | toYaml | nindent 8 }} {{- if and $needsVolumePermissions (eq $name "media-repository") }} From 6d7acd96772ff0d420aea831f08933517f117f23 Mon Sep 17 00:00:00 2001 From: Nicolas Bonneval Date: Thu, 3 Jun 2021 19:19:28 +0200 Subject: [PATCH 4/6] Added support for the ingressClassName field + Fixed indentation for volumePermissions.resources --- charts/matrix-synapse/templates/ingress.yaml | 3 +++ charts/matrix-synapse/templates/worker-deployment.yaml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/charts/matrix-synapse/templates/ingress.yaml b/charts/matrix-synapse/templates/ingress.yaml index 82bc1ff..83d0fc9 100644 --- a/charts/matrix-synapse/templates/ingress.yaml +++ b/charts/matrix-synapse/templates/ingress.yaml @@ -16,6 +16,9 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: +{{- if .Values.ingress.className }} + ingressClassName: {{ .Values.ingress.className }} +{{- end }} {{- if .Values.ingress.tls }} tls: {{- range .Values.ingress.tls }} diff --git a/charts/matrix-synapse/templates/worker-deployment.yaml b/charts/matrix-synapse/templates/worker-deployment.yaml index 8dee253..9d62111 100644 --- a/charts/matrix-synapse/templates/worker-deployment.yaml +++ b/charts/matrix-synapse/templates/worker-deployment.yaml @@ -44,7 +44,7 @@ spec: imagePullPolicy: {{ $.Values.volumePermissions.pullPolicy }} securityContext: runAsUser: 0 - resources: {{ $.Values.volumePermissions.resources | toYaml | nindent 10 }} + resources: {{ $.Values.volumePermissions.resources | toYaml | nindent 12 }} volumeMounts: - name: media mountPath: /synapse/data From 8e0de0403f393a98c9a200a64808d89ca52818e4 Mon Sep 17 00:00:00 2001 From: Nicolas Bonneval Date: Fri, 4 Jun 2021 11:12:20 +0200 Subject: [PATCH 5/6] Ingress tls secret name may be empty --- charts/matrix-synapse/templates/ingress.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charts/matrix-synapse/templates/ingress.yaml b/charts/matrix-synapse/templates/ingress.yaml index 83d0fc9..6f806f5 100644 --- a/charts/matrix-synapse/templates/ingress.yaml +++ b/charts/matrix-synapse/templates/ingress.yaml @@ -26,7 +26,9 @@ spec: {{- range .hosts }} - {{ . | quote }} {{- end }} + {{- if .secretName }} secretName: {{ .secretName }} + {{- end }} {{- end }} {{- end }} rules: From cd8ff3348e3705259e421ac717d79de1643c24ef Mon Sep 17 00:00:00 2001 From: Nicolas Bonneval Date: Wed, 23 Jun 2021 20:04:26 +0200 Subject: [PATCH 6/6] Make sure the new ingress.className field gets some visibility --- charts/matrix-synapse/values.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/charts/matrix-synapse/values.yaml b/charts/matrix-synapse/values.yaml index f1ea017..95da9e7 100644 --- a/charts/matrix-synapse/values.yaml +++ b/charts/matrix-synapse/values.yaml @@ -713,3 +713,7 @@ ingress: # hosts: # - example.com # - matrix.example.com + + ## Set the name of the IngressClass cluster resource (optional) + ## https://kubernetes.io/docs/reference/kubernetes-api/service-resources/ingress-v1/#IngressSpec + #className: can-be-anything