Skip to content

Commit 7c8b27f

Browse files
authored
V1.151.0 fixes (#29)
* helmignore, keda schedule 8.30, fix room_worker regex * synapse-caches * target_cache_memory_usage 80% of max_cache_memory_usage * bump chart to 2.3.0
1 parent d610d99 commit 7c8b27f

12 files changed

Lines changed: 244 additions & 228 deletions

charts/synapse/.helmignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
24+
# additional files
25+
README.md
26+
# fix and remove
27+
NOTES.txt
28+
tests/
29+
docker/

charts/synapse/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
apiVersion: v2
33
name: synapse
44
description: matrix synapse kubernetes deployment
5-
version: 2.2.1
5+
version: 2.3.0
66
appVersion: 1.151.0

charts/synapse/templates/_helpers.tpl

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,50 @@ app: synapse
6464
component: synapse-{{ . }}
6565
{{- end }}
6666

67+
{{/*
68+
Base helper for Synapse cache size limits.
69+
Falls back to .fallback when no limit is configured or suffix is unrecognised.
70+
Supported Kubernetes suffixes: Gi, Mi, G, M.
71+
*/}}
72+
{{- define "synapse.workerCacheMemory" -}}
73+
{{- $resources := .options.resources | default .defaults -}}
74+
{{- $memLimit := "" -}}
75+
{{- if and $resources $resources.limits $resources.limits.memory -}}
76+
{{- $memLimit = $resources.limits.memory | toString -}}
77+
{{- end -}}
78+
{{- $num := .num -}}
79+
{{- $denom := .denom -}}
80+
{{- if $memLimit -}}
81+
{{- if hasSuffix "Gi" $memLimit -}}
82+
{{- $val := trimSuffix "Gi" $memLimit | int64 -}}
83+
{{- printf "%dM" (div (mul (mul $val 1024) $num) $denom) -}}
84+
{{- else if hasSuffix "Mi" $memLimit -}}
85+
{{- $val := trimSuffix "Mi" $memLimit | int64 -}}
86+
{{- printf "%dM" (div (mul $val $num) $denom) -}}
87+
{{- else if hasSuffix "G" $memLimit -}}
88+
{{- $val := trimSuffix "G" $memLimit | int64 -}}
89+
{{- printf "%dM" (div (mul (mul $val 1024) $num) $denom) -}}
90+
{{- else if hasSuffix "M" $memLimit -}}
91+
{{- $val := trimSuffix "M" $memLimit | int64 -}}
92+
{{- printf "%dM" (div (mul $val $num) $denom) -}}
93+
{{- else -}}
94+
{{- .fallback -}}
95+
{{- end -}}
96+
{{- else -}}
97+
{{- .fallback -}}
98+
{{- end -}}
99+
{{- end -}}
100+
101+
{{/* max_cache_memory_usage = 90% of memory limit */}}
102+
{{- define "synapse.workerMaxCacheMemory" -}}
103+
{{- include "synapse.workerCacheMemory" (merge (dict "num" 9 "denom" 10) .) -}}
104+
{{- end -}}
105+
106+
{{/* target_cache_memory_usage = 80% of max = 72% of memory limit */}}
107+
{{- define "synapse.workerTargetCacheMemory" -}}
108+
{{- include "synapse.workerCacheMemory" (merge (dict "num" 72 "denom" 100) .) -}}
109+
{{- end -}}
110+
67111
{{/*
68112
Workers containers
69113
*/}}

charts/synapse/templates/synapse-secret.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,8 @@ stringData:
351351
cache_entry_ttl: {{ $.Values.synapse.caches.cacheEntryTtl }}
352352
sync_response_cache_duration: {{ $.Values.synapse.caches.syncResponseCacheDuration }}
353353
cache_autotuning:
354-
max_cache_memory_usage: {{ $.Values.synapse.cacheAutotuning.maxCacheMemoryUsage }}
355-
target_cache_memory_usage: {{ $.Values.synapse.cacheAutotuning.targetCacheMemoryUsage }}
354+
max_cache_memory_usage: {{ include "synapse.workerMaxCacheMemory" (dict "options" $options "defaults" $.Values.synapse.resourcesDefaults "fallback" $.Values.synapse.cacheAutotuning.maxCacheMemoryUsage) }}
355+
target_cache_memory_usage: {{ include "synapse.workerTargetCacheMemory" (dict "options" $options "defaults" $.Values.synapse.resourcesDefaults "fallback" $.Values.synapse.cacheAutotuning.targetCacheMemoryUsage) }}
356356
min_cache_ttl: {{ $.Values.synapse.cacheAutotuning.minCacheTtl }}
357357
{{- if $.Values.synapse.opentracing.enabled }}
358358
opentracing:

charts/synapse/tests/golden/fixtures/test-ingress-default.golden.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ spec:
9595
port:
9696
number: 80
9797
name: synapse-presence
98-
- path: /_matrix/client/(api/v1|r0|v3|unstable)/pushrules/
98+
- path: /_matrix/client/(api/v1|r0|v3|unstable)/pushrules/(global|device)/(override|underride|sender|room|content|default)/
9999
pathType: ImplementationSpecific
100100
backend:
101101
service:

charts/synapse/tests/golden/fixtures/test-ingress-msc4306.golden.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ spec:
9595
port:
9696
number: 80
9797
name: synapse-presence
98-
- path: /_matrix/client/(api/v1|r0|v3|unstable)/pushrules/
98+
- path: /_matrix/client/(api/v1|r0|v3|unstable)/pushrules/(global|device)/(override|underride|sender|room|content|default)/
9999
pathType: ImplementationSpecific
100100
backend:
101101
service:

charts/synapse/tests/golden/fixtures/test-ingress-no-mas.golden.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ spec:
9595
port:
9696
number: 80
9797
name: synapse-presence
98-
- path: /_matrix/client/(api/v1|r0|v3|unstable)/pushrules/
98+
- path: /_matrix/client/(api/v1|r0|v3|unstable)/pushrules/(global|device)/(override|underride|sender|room|content|default)/
9999
pathType: ImplementationSpecific
100100
backend:
101101
service:

0 commit comments

Comments
 (0)