Skip to content

Commit 32a7f34

Browse files
committed
Make startupProbes configurable
1 parent 33a4bb1 commit 32a7f34

28 files changed

+1795
-55
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@
5757
},
5858
"readinessProbe": {
5959
"$ref": "file://common/probe.json"
60+
},
61+
"startupProbe": {
62+
"$ref": "file://common/probe.json"
6063
}
6164
}
6265
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ replicas: 1
3232
{{- sub_schema_values.topologySpreadConstraints() }}
3333
{{- sub_schema_values.probe("liveness", failureThreshold=3, periodSeconds=10) }}
3434
{{- sub_schema_values.probe("readiness", failureThreshold=3, periodSeconds=3) }}
35+
{{- sub_schema_values.probe("startup", failureThreshold=3, initialDelaySeconds=2, periodSeconds=3) }}

charts/matrix-stack/source/haproxy.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@
4848
},
4949
"readinessProbe": {
5050
"$ref": "file://common/probe.json"
51+
},
52+
"startupProbe": {
53+
"$ref": "file://common/probe.json"
5154
}
5255
}
5356
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ replicas: 1
2020
{{- sub_schema_values.topologySpreadConstraints() }}
2121
{{- sub_schema_values.probe("liveness", initialDelaySeconds=10, timeoutSeconds=5) }}
2222
{{- sub_schema_values.probe("readiness", initialDelaySeconds=20, timeoutSeconds=5) }}
23+
# The failureThreshold here is tweaked towards Synapse being ready
24+
# If Synapse isn't being deployed, unsetting this or setting it to 3 maybe more appropriate
25+
{{- sub_schema_values.probe("startup", failureThreshold=150, periodSeconds=2) }}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@
9292
"readinessProbe": {
9393
"$ref": "file://common/probe.json"
9494
},
95+
"startupProbe": {
96+
"$ref": "file://common/probe.json"
97+
},
9598
"sfu": {
9699
"type": "object",
97100
"properties": {
@@ -185,6 +188,9 @@
185188
},
186189
"readinessProbe": {
187190
"$ref": "file://common/probe.json"
191+
},
192+
"startupProbe": {
193+
"$ref": "file://common/probe.json"
188194
}
189195
}
190196
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ enabled: true
3232
{{- sub_schema_values.tolerations() }}
3333
{{- sub_schema_values.probe("liveness") }}
3434
{{- sub_schema_values.probe("readiness") }}
35+
{{- sub_schema_values.probe("startup") }}
3536

3637
sfu:
3738
enabled: true
@@ -72,3 +73,4 @@ sfu:
7273
{{- sub_schema_values.tolerations() | indent(2) }}
7374
{{- sub_schema_values.probe("liveness") | indent(2) }}
7475
{{- sub_schema_values.probe("readiness") | indent(2) }}
76+
{{- sub_schema_values.probe("startup") | indent(2) }}

charts/matrix-stack/source/matrixAuthenticationService.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@
9191
},
9292
"readinessProbe": {
9393
"$ref": "file://common/probe.json"
94+
},
95+
"startupProbe": {
96+
"$ref": "file://common/probe.json"
9497
}
9598
}
9699
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@ privateKeys:
4444
{{ sub_schema_values.extraEnv() }}
4545
{{ sub_schema_values.probe("liveness", failureThreshold=3) }}
4646
{{ sub_schema_values.probe("readiness", failureThreshold=3) }}
47+
{{ sub_schema_values.probe("startup", initialDelaySeconds=5) }}

charts/matrix-stack/source/postgres.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
},
3030
"readinessProbe": {
3131
"$ref": "file://common/probe.json"
32+
},
33+
"startupProbe": {
34+
"$ref": "file://common/probe.json"
3235
}
3336
}
3437
},
@@ -85,6 +88,9 @@
8588
"readinessProbe": {
8689
"$ref": "file://common/probe.json"
8790
},
91+
"startupProbe": {
92+
"$ref": "file://common/probe.json"
93+
},
8894
"serviceMonitors": {
8995
"$ref": "file://common/serviceMonitors.json"
9096
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ postgresExporter:
1111
{{- sub_schema_values.containersSecurityContext()| indent(2) }}
1212
{{- sub_schema_values.probe("liveness", periodSeconds=6, timeoutSeconds=2) | indent(2) }}
1313
{{- sub_schema_values.probe("readiness", periodSeconds=2, successThreshold=2, timeoutSeconds=2) | indent(2) }}
14+
{{- sub_schema_values.probe("startup", failureThreshold=20, periodSeconds=2) | indent(2) }}
1415

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

@@ -33,3 +34,4 @@ essPasswords:
3334
{{- sub_schema_values.topologySpreadConstraints() }}
3435
{{- sub_schema_values.probe("liveness", initialDelaySeconds=45, timeoutSeconds=2) }}
3536
{{- sub_schema_values.probe("readiness", initialDelaySeconds=15, timeoutSeconds=2) }}
37+
{{- sub_schema_values.probe("startup") }}

charts/matrix-stack/source/synapse.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@
178178
"readinessProbe": {
179179
"$ref": "file://common/probe.json"
180180
},
181+
"startupProbe": {
182+
"$ref": "file://common/probe.json"
183+
},
181184
"workers": {
182185
"type": "object",
183186
"properties": {
@@ -281,6 +284,9 @@
281284
},
282285
"readinessProbe": {
283286
"$ref": "file://common/probe.json"
287+
},
288+
"startupProbe": {
289+
"$ref": "file://common/probe.json"
284290
}
285291
}
286292
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ logging:
9898
{{- sub_schema_values.topologySpreadConstraints() }}
9999
{{- sub_schema_values.probe("liveness", failureThreshold=8, periodSeconds=6, timeoutSeconds=2) }}
100100
{{- sub_schema_values.probe("readiness", failureThreshold=8, periodSeconds=2, successThreshold=2, timeoutSeconds=2) }}
101+
{{- sub_schema_values.probe("startup", failureThreshold=54, periodSeconds=2) }}
101102

102103
## Extra command line arguments to provide to Synapse
103104
extraArgs: []
@@ -114,3 +115,4 @@ redis:
114115
{{- sub_schema_values.tolerations() | indent(2) }}
115116
{{- sub_schema_values.probe("liveness", initialDelaySeconds=15) | indent(2) }}
116117
{{- sub_schema_values.probe("readiness", initialDelaySeconds=5) | indent(2) }}
118+
{{- sub_schema_values.probe("startup") | indent(2) }}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
},
2222
"readinessProbe": {
2323
"$ref": "file://common/probe.json"
24+
},
25+
"startupProbe": {
26+
"$ref": "file://common/probe.json"
2427
}
2528
},
2629
"type": "object"

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
},
1212
"readinessProbe": {
1313
"$ref": "file://common/probe.json"
14+
},
15+
"startupProbe": {
16+
"$ref": "file://common/probe.json"
1417
}
1518
},
1619
"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
@@ -17,6 +17,7 @@ SPDX-License-Identifier: AGPL-3.0-only
1717

1818
{{- sub_schema_values.probe("liveness", failureThreshold=8, periodSeconds=6, timeoutSeconds=2) | indent(2) }}
1919
{{- sub_schema_values.probe("readiness", failureThreshold=8, periodSeconds=2, successThreshold=2, timeoutSeconds=2) | indent(2) }}
20+
{{- sub_schema_values.probe("startup", failureThreshold=54, periodSeconds=2) | indent(2) }}
2021
{%- endmacro %}
2122

2223
{% macro scalable_worker(workerType) %}
@@ -33,4 +34,5 @@ SPDX-License-Identifier: AGPL-3.0-only
3334

3435
{{- sub_schema_values.probe("liveness", failureThreshold=3, periodSeconds=6, timeoutSeconds=2) | indent(2) }}
3536
{{- sub_schema_values.probe("readiness", failureThreshold=3, periodSeconds=2, successThreshold=2, timeoutSeconds=2) | indent(2) }}
37+
{{- sub_schema_values.probe("startup", failureThreshold=21, periodSeconds=2) | indent(2) }}
3638
{%- endmacro %}

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,11 @@ spec:
8585
path: /health
8686
port: element
8787
scheme: HTTP
88-
startupProbe:
89-
failureThreshold: 3
88+
startupProbe: {{- include "element-io.ess-library.pods.probe" .startupProbe | nindent 10 }}
9089
httpGet:
9190
path: /health
9291
port: element
9392
scheme: HTTP
94-
initialDelaySeconds: 2
95-
periodSeconds: 3
9693
{{- with .resources }}
9794
resources:
9895
{{- toYaml . | nindent 10 }}

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ spec:
111111
name: synapse-ready
112112
protocol: TCP
113113
{{- end }}
114-
startupProbe:
114+
startupProbe: {{- include "element-io.ess-library.pods.probe" .startupProbe | nindent 10 }}
115115
httpGet:
116116
{{- if $.Values.synapse.enabled }}
117117
path: /synapse_ready
@@ -120,8 +120,6 @@ spec:
120120
path: /haproxy_test
121121
port: haproxy-metrics
122122
{{- end }}
123-
periodSeconds: 2
124-
failureThreshold: 150
125123
livenessProbe: {{- include "element-io.ess-library.pods.probe" .livenessProbe | nindent 10 }}
126124
httpGet:
127125
path: /haproxy_test

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,11 @@ spec:
195195
resources:
196196
{{- toYaml . | nindent 10 }}
197197
{{- end }}
198-
startupProbe:
198+
startupProbe: {{- include "element-io.ess-library.pods.probe" .startupProbe | nindent 10 }}
199199
httpGet:
200200
path: /health
201201
port: internal
202202
scheme: HTTP
203-
initialDelaySeconds: 5
204203
livenessProbe: {{- include "element-io.ess-library.pods.probe" .livenessProbe | nindent 10 }}
205204
httpGet:
206205
path: /health

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ spec:
179179
httpGet:
180180
path: /
181181
port: http
182-
startupProbe:
182+
startupProbe: {{- include "element-io.ess-library.pods.probe" .startupProbe | nindent 10 }}
183183
httpGet:
184184
path: /
185185
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
@@ -72,7 +72,7 @@ spec:
7272
httpGet:
7373
path: /healthz
7474
port: http
75-
startupProbe:
75+
startupProbe: {{- include "element-io.ess-library.pods.probe" .startupProbe | nindent 10 }}
7676
httpGet:
7777
path: /healthz
7878
port: http

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ spec:
6565
preStop:
6666
exec:
6767
command: ["pg_ctl", "stop", "-D", "/var/lib/postgres/data", "-w", "-t", "55", "-m", "fast"]
68-
startupProbe:
68+
startupProbe: {{- include "element-io.ess-library.pods.probe" .startupProbe | nindent 10 }}
6969
exec:
7070
command: ["psql", "-w", "-U", "postgres", "-d", "postgres", "-c", "SELECT 1"]
7171
readinessProbe: {{- include "element-io.ess-library.pods.probe" .readinessProbe | nindent 10 }}
@@ -136,7 +136,7 @@ spec:
136136
preStop:
137137
exec:
138138
command: ["pg_ctl", "stop", "-D", "/var/lib/postgres/data", "-w", "-t", "55", "-m", "fast"]
139-
startupProbe:
139+
startupProbe: {{- include "element-io.ess-library.pods.probe" .startupProbe | nindent 10 }}
140140
exec:
141141
command: ["psql", "-w", "-U", "postgres", "-d", "postgres", "-c", "SELECT 1"]
142142
readinessProbe: {{- include "element-io.ess-library.pods.probe" .readinessProbe | nindent 10 }}
@@ -190,12 +190,10 @@ spec:
190190
containerPort: 9187
191191
env:
192192
{{- include "element-io.postgres.exporter-env" (dict "root" $ "context" .) | nindent 8 }}
193-
startupProbe:
193+
startupProbe: {{- include "element-io.ess-library.pods.probe" .startupProbe | nindent 10 }}
194194
httpGet:
195195
path: /metrics
196196
port: metrics
197-
periodSeconds: 2
198-
failureThreshold: 20
199197
livenessProbe: {{- include "element-io.ess-library.pods.probe" .livenessProbe | nindent 10 }}
200198
httpGet:
201199
path: /metrics

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,10 @@ We have an init container to render & merge the config for several reasons:
184184
- containerPort: 9001
185185
name: synapse-metrics
186186
protocol: TCP
187-
startupProbe:
187+
startupProbe: {{- include "element-io.ess-library.pods.probe" .startupProbe | nindent 8 }}
188188
httpGet:
189189
path: /health
190190
port: synapse-health
191-
periodSeconds: 2
192-
{{- /* For Synapse processes where there can only be 1 instance we're more generous with the threshold.
193-
This is because people can't scale the process up and so the impact of a restart is greater. */}}
194-
failureThreshold: {{ ternary 54 21 (eq "isSingle" (include "element-io.synapse.process.isSingle" (dict "root" $root "context" $processType))) }}
195191
livenessProbe: {{- include "element-io.ess-library.pods.probe" .livenessProbe | nindent 8 }}
196192
httpGet:
197193
path: /health

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ spec:
6666
- containerPort: 6379
6767
name: redis
6868
protocol: TCP
69-
startupProbe:
69+
startupProbe: {{- include "element-io.ess-library.pods.probe" .startupProbe | nindent 10 }}
7070
tcpSocket:
7171
port: redis
7272
livenessProbe: {{- include "element-io.ess-library.pods.probe" .livenessProbe | nindent 10 }}

0 commit comments

Comments
 (0)