Skip to content

Commit 6f35155

Browse files
committed
Make readinessProbes configurable
1 parent 0196d38 commit 6f35155

28 files changed

+1809
-101
lines changed

charts/matrix-stack/source/element-web.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@
5454
},
5555
"livenessProbe": {
5656
"$ref": "file://common/probe.json"
57+
},
58+
"readinessProbe": {
59+
"$ref": "file://common/probe.json"
5760
}
5861
}
5962
}

charts/matrix-stack/source/element-web.yaml.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ replicas: 1
3131
{{- sub_schema_values.tolerations() -}}
3232
{{- sub_schema_values.topologySpreadConstraints() }}
3333
{{- sub_schema_values.probe("liveness") }}
34+
{{- sub_schema_values.probe("readiness", periodSeconds=3) }}

charts/matrix-stack/source/haproxy.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
},
4646
"livenessProbe": {
4747
"$ref": "file://common/probe.json"
48+
},
49+
"readinessProbe": {
50+
"$ref": "file://common/probe.json"
4851
}
4952
}
5053
}

charts/matrix-stack/source/haproxy.yaml.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ replicas: 1
1919
{{- sub_schema_values.tolerations() }}
2020
{{- sub_schema_values.topologySpreadConstraints() }}
2121
{{- sub_schema_values.probe("liveness", initialDelaySeconds=10, timeoutSeconds=5) }}
22+
{{- sub_schema_values.probe("readiness", initialDelaySeconds=20, timeoutSeconds=5) }}

charts/matrix-stack/source/matrix-rtc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@
8989
"livenessProbe": {
9090
"$ref": "file://common/probe.json"
9191
},
92+
"readinessProbe": {
93+
"$ref": "file://common/probe.json"
94+
},
9295
"sfu": {
9396
"type": "object",
9497
"properties": {
@@ -179,6 +182,9 @@
179182
},
180183
"livenessProbe": {
181184
"$ref": "file://common/probe.json"
185+
},
186+
"readinessProbe": {
187+
"$ref": "file://common/probe.json"
182188
}
183189
}
184190
}

charts/matrix-stack/source/matrix-rtc.yaml.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ enabled: true
3131
{{- sub_schema_values.serviceAccount() }}
3232
{{- sub_schema_values.tolerations() }}
3333
{{- sub_schema_values.probe("liveness") }}
34+
{{- sub_schema_values.probe("readiness") }}
3435

3536
sfu:
3637
enabled: true
@@ -70,3 +71,4 @@ sfu:
7071
{{- sub_schema_values.serviceMonitors() | indent(2) }}
7172
{{- sub_schema_values.tolerations() | indent(2) }}
7273
{{- sub_schema_values.probe("liveness") | indent(2) }}
74+
{{- sub_schema_values.probe("readiness") | indent(2) }}

charts/matrix-stack/source/matrixAuthenticationService.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@
8888
},
8989
"livenessProbe": {
9090
"$ref": "file://common/probe.json"
91+
},
92+
"readinessProbe": {
93+
"$ref": "file://common/probe.json"
9194
}
9295
}
9396
}

charts/matrix-stack/source/matrixAuthenticationService.yaml.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@ privateKeys:
4343
{{ sub_schema_values.serviceMonitors() }}
4444
{{ sub_schema_values.extraEnv() }}
4545
{{ sub_schema_values.probe("liveness") }}
46+
{{ sub_schema_values.probe("readiness") }}

charts/matrix-stack/source/postgres.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
},
2727
"livenessProbe": {
2828
"$ref": "file://common/probe.json"
29+
},
30+
"readinessProbe": {
31+
"$ref": "file://common/probe.json"
2932
}
3033
}
3134
},
@@ -79,6 +82,9 @@
7982
"livenessProbe": {
8083
"$ref": "file://common/probe.json"
8184
},
85+
"readinessProbe": {
86+
"$ref": "file://common/probe.json"
87+
},
8288
"serviceMonitors": {
8389
"$ref": "file://common/serviceMonitors.json"
8490
}

charts/matrix-stack/source/postgres.yaml.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ postgresExporter:
1010
{{- sub_schema_values.resources(requests_memory='10Mi', requests_cpu='10m', limits_memory='500Mi')| indent(2) }}
1111
{{- sub_schema_values.containersSecurityContext()| indent(2) }}
1212
{{- sub_schema_values.probe("liveness", periodSeconds=6, timeoutSeconds=2) | indent(2) }}
13+
{{- sub_schema_values.probe("readiness", periodSeconds=2, successThreshold=2, timeoutSeconds=2) | indent(2) }}
1314

1415
{{- sub_schema_values.credential("Postgres Admin Password", "adminPassword", initIfAbsent=true) }}
1516

@@ -31,3 +32,4 @@ essPasswords:
3132
{{- sub_schema_values.tolerations() }}
3233
{{- sub_schema_values.topologySpreadConstraints() }}
3334
{{- sub_schema_values.probe("liveness", initialDelaySeconds=45, timeoutSeconds=2) }}
35+
{{- sub_schema_values.probe("readiness", initialDelaySeconds=15, timeoutSeconds=2) }}

charts/matrix-stack/source/synapse.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@
175175
"livenessProbe": {
176176
"$ref": "file://common/probe.json"
177177
},
178+
"readinessProbe": {
179+
"$ref": "file://common/probe.json"
180+
},
178181
"workers": {
179182
"type": "object",
180183
"properties": {
@@ -275,6 +278,9 @@
275278
},
276279
"livenessProbe": {
277280
"$ref": "file://common/probe.json"
281+
},
282+
"readinessProbe": {
283+
"$ref": "file://common/probe.json"
278284
}
279285
}
280286
}

charts/matrix-stack/source/synapse.yaml.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ logging:
9797
{{- sub_schema_values.tolerations() }}
9898
{{- sub_schema_values.topologySpreadConstraints() }}
9999
{{- sub_schema_values.probe("liveness", failureThreshold=8, periodSeconds=6, timeoutSeconds=2) }}
100+
{{- sub_schema_values.probe("readiness", failureThreshold=8, periodSeconds=2, successThreshold=2, timeoutSeconds=2) }}
100101

101102
## Extra command line arguments to provide to Synapse
102103
extraArgs: []
@@ -112,3 +113,4 @@ redis:
112113
{{- sub_schema_values.serviceAccount() | indent(2) }}
113114
{{- sub_schema_values.tolerations() | indent(2) }}
114115
{{- sub_schema_values.probe("liveness", initialDelaySeconds=15) | indent(2) }}
116+
{{- sub_schema_values.probe("readiness", initialDelaySeconds=5) | indent(2) }}

charts/matrix-stack/source/synapse/scalable_worker.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
},
1919
"livenessProbe": {
2020
"$ref": "file://common/probe.json"
21+
},
22+
"readinessProbe": {
23+
"$ref": "file://common/probe.json"
2124
}
2225
},
2326
"type": "object"

charts/matrix-stack/source/synapse/single_worker.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
},
99
"livenessProbe": {
1010
"$ref": "file://common/probe.json"
11+
},
12+
"readinessProbe": {
13+
"$ref": "file://common/probe.json"
1114
}
1215
},
1316
"type": "object"

charts/matrix-stack/source/synapse/synapse_sub_schema_values.yaml.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ SPDX-License-Identifier: AGPL-3.0-only
1616
# resources: {}
1717

1818
{{- sub_schema_values.probe("liveness", failureThreshold=8, periodSeconds=6, timeoutSeconds=2) | indent(2) }}
19+
{{- sub_schema_values.probe("readiness", failureThreshold=8, periodSeconds=2, successThreshold=2, timeoutSeconds=2) | indent(2) }}
1920
{%- endmacro %}
2021

2122
{% macro scalable_worker(workerType) %}
@@ -31,4 +32,5 @@ SPDX-License-Identifier: AGPL-3.0-only
3132
# resources: {}
3233

3334
{{- sub_schema_values.probe("liveness", failureThreshold=3, periodSeconds=6, timeoutSeconds=2) | indent(2) }}
35+
{{- sub_schema_values.probe("readiness", failureThreshold=3, periodSeconds=2, successThreshold=2, timeoutSeconds=2) | indent(2) }}
3436
{%- endmacro %}

charts/matrix-stack/templates/element-web/deployment.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,11 @@ spec:
8080
path: /health
8181
port: element
8282
scheme: HTTP
83-
readinessProbe:
84-
failureThreshold: 3
83+
readinessProbe: {{- include "element-io.ess-library.pods.probe" .readinessProbe | nindent 10 }}
8584
httpGet:
8685
path: /health
8786
port: element
8887
scheme: HTTP
89-
periodSeconds: 3
9088
startupProbe:
9189
failureThreshold: 3
9290
httpGet:

charts/matrix-stack/templates/haproxy/deployment.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,10 @@ spec:
123123
httpGet:
124124
path: /haproxy_test
125125
port: haproxy-metrics
126-
readinessProbe:
126+
readinessProbe: {{- include "element-io.ess-library.pods.probe" .readinessProbe | nindent 10 }}
127127
httpGet:
128128
path: /haproxy_test
129-
port: 8405
130-
initialDelaySeconds: 20
131-
timeoutSeconds: 5
129+
port: haproxy-metrics
132130
{{- with .resources }}
133131
resources:
134132
{{- toYaml . | nindent 10 }}

charts/matrix-stack/templates/matrix-authentication-service/deployment.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ spec:
206206
path: /health
207207
port: internal
208208
scheme: HTTP
209-
readinessProbe:
210-
failureThreshold: 3
209+
readinessProbe: {{- include "element-io.ess-library.pods.probe" .readinessProbe | nindent 10 }}
211210
httpGet:
212211
path: /health
213212
port: internal

charts/matrix-stack/templates/matrix-rtc/sfu_deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ spec:
175175
httpGet:
176176
path: /
177177
port: http
178-
readinessProbe:
178+
readinessProbe: {{- include "element-io.ess-library.pods.probe" .readinessProbe | nindent 10 }}
179179
httpGet:
180180
path: /
181181
port: http

charts/matrix-stack/templates/matrix-rtc/sfu_jwt_deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ spec:
6868
httpGet:
6969
path: /healthz
7070
port: http
71-
readinessProbe:
71+
readinessProbe: {{- include "element-io.ess-library.pods.probe" .readinessProbe | nindent 10 }}
7272
httpGet:
7373
path: /healthz
7474
port: http

charts/matrix-stack/templates/postgres/statefulset.yaml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,9 @@ spec:
6565
preStop:
6666
exec:
6767
command: ["pg_ctl", "stop", "-D", "/var/lib/postgres/data", "-w", "-t", "55", "-m", "fast"]
68-
readinessProbe:
68+
readinessProbe: {{- include "element-io.ess-library.pods.probe" .readinessProbe | nindent 10 }}
6969
exec:
7070
command: ["psql", "-w", "-U", "postgres", "-d", "postgres", "-c", "SELECT 1"]
71-
initialDelaySeconds: 15
72-
timeoutSeconds: 2
7371
livenessProbe: {{- include "element-io.ess-library.pods.probe" .livenessProbe | nindent 10 }}
7472
exec:
7573
command: ["psql", "-w", "-U", "postgres", "-d", "postgres", "-c", "SELECT 1"]
@@ -135,11 +133,9 @@ spec:
135133
preStop:
136134
exec:
137135
command: ["pg_ctl", "stop", "-D", "/var/lib/postgres/data", "-w", "-t", "55", "-m", "fast"]
138-
readinessProbe:
136+
readinessProbe: {{- include "element-io.ess-library.pods.probe" .readinessProbe | nindent 10 }}
139137
exec:
140138
command: ["psql", "-w", "-U", "postgres", "-d", "postgres", "-c", "SELECT 1"]
141-
initialDelaySeconds: 15
142-
timeoutSeconds: 2
143139
livenessProbe: {{- include "element-io.ess-library.pods.probe" .livenessProbe | nindent 10 }}
144140
exec:
145141
command: ["psql", "-w", "-U", "postgres", "-d", "postgres", "-c", "SELECT 1"]
@@ -198,13 +194,10 @@ spec:
198194
httpGet:
199195
path: /metrics
200196
port: metrics
201-
readinessProbe:
197+
readinessProbe: {{- include "element-io.ess-library.pods.probe" .readinessProbe | nindent 10 }}
202198
httpGet:
203199
path: /metrics
204200
port: metrics
205-
periodSeconds: 2
206-
timeoutSeconds: 2
207-
successThreshold: 2
208201
{{- with .resources }}
209202
resources:
210203
{{- toYaml . | nindent 10 }}

charts/matrix-stack/templates/synapse/_synapse_pod.tpl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,10 @@ We have an init container to render & merge the config for several reasons:
196196
httpGet:
197197
path: /health
198198
port: synapse-health
199-
readinessProbe:
199+
readinessProbe: {{- include "element-io.ess-library.pods.probe" .readinessProbe | nindent 8 }}
200200
httpGet:
201201
path: /health
202202
port: synapse-health
203-
periodSeconds: 2
204-
timeoutSeconds: 2
205-
successThreshold: 2
206-
failureThreshold: {{ ternary 8 3 (eq "isSingle" (include "element-io.synapse.process.isSingle" (dict "root" $root "context" $processType))) }}
207203
{{- end }}
208204
{{- with .resources }}
209205
resources:

charts/matrix-stack/templates/synapse/redis_deployment.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,11 @@ spec:
6969
livenessProbe: {{- include "element-io.ess-library.pods.probe" .livenessProbe | nindent 10 }}
7070
tcpSocket:
7171
port: redis
72-
readinessProbe:
72+
readinessProbe: {{- include "element-io.ess-library.pods.probe" .readinessProbe | nindent 10 }}
7373
exec:
7474
command:
7575
- redis-cli
7676
- ping
77-
initialDelaySeconds: 5
7877
{{- with .resources }}
7978
resources:
8079
{{- toYaml . | nindent 10 }}

0 commit comments

Comments
 (0)