mirror of
https://github.com/element-hq/ess-helm.git
synced 2026-11-24 02:51:28 -08:00
Merge pull request #433 from element-hq/bbz/explicit-probe-thresholds-and-frequencies
Make probe thresholds and frequencies explicit
This commit is contained in:
7 files changed
+251
-236
No files matched your search
@@ -1,5 +1,5 @@
|
||||
{#
|
||||
Copyright 2024 New Vector Ltd
|
||||
Copyright 2024-2025 New Vector Ltd
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
#}
|
||||
@@ -276,7 +276,8 @@ labels: {}
|
||||
{{ (credential("PostgreSQL password", "password", commented=True) | indent(2)) }}
|
||||
{%- endmacro %}
|
||||
|
||||
{% macro probe(type, failureThreshold=none, initialDelaySeconds=none, periodSeconds=none, successThreshold=none, timeoutSeconds=none) %}
|
||||
{# The default values are the k8s defaults. We could omit but lets make them explicit. #}
|
||||
{% macro probe(type, failureThreshold=3, initialDelaySeconds=0, periodSeconds=10, successThreshold=1, timeoutSeconds=1) %}
|
||||
## Configuration of the thresholds and frequencies of the {{ type }}Probe
|
||||
{%- if failureThreshold is none and initialDelaySeconds is none and periodSeconds is none and successThreshold is none and timeoutSeconds is none %}
|
||||
# {{ type }}Probe:
|
||||
|
||||
@@ -30,6 +30,6 @@ replicas: 1
|
||||
{{- sub_schema_values.serviceAccount() -}}
|
||||
{{- sub_schema_values.tolerations() -}}
|
||||
{{- sub_schema_values.topologySpreadConstraints() }}
|
||||
{{- sub_schema_values.probe("liveness", failureThreshold=3, periodSeconds=10) }}
|
||||
{{- sub_schema_values.probe("readiness", failureThreshold=3, periodSeconds=3) }}
|
||||
{{- sub_schema_values.probe("startup", failureThreshold=3, initialDelaySeconds=2, periodSeconds=3) }}
|
||||
{{- sub_schema_values.probe("liveness") }}
|
||||
{{- sub_schema_values.probe("readiness", periodSeconds=3) }}
|
||||
{{- sub_schema_values.probe("startup", initialDelaySeconds=2, periodSeconds=3) }}
|
||||
@@ -1,5 +1,5 @@
|
||||
{#
|
||||
Copyright 2024 New Vector Ltd
|
||||
Copyright 2024-2025 New Vector Ltd
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
#}
|
||||
@@ -42,6 +42,6 @@ privateKeys:
|
||||
{{ sub_schema_values.workloadAnnotations() }}
|
||||
{{ sub_schema_values.serviceMonitors() }}
|
||||
{{ sub_schema_values.extraEnv() }}
|
||||
{{ sub_schema_values.probe("liveness", failureThreshold=3) }}
|
||||
{{ sub_schema_values.probe("readiness", failureThreshold=3) }}
|
||||
{{ sub_schema_values.probe("liveness") }}
|
||||
{{ sub_schema_values.probe("readiness") }}
|
||||
{{ sub_schema_values.probe("startup", initialDelaySeconds=5) }}
|
||||
@@ -1,5 +1,5 @@
|
||||
{#
|
||||
Copyright 2024 New Vector Ltd
|
||||
Copyright 2024-2025 New Vector Ltd
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
#}
|
||||
@@ -32,7 +32,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
## If omitted the global Synapse resources are used
|
||||
# resources: {}
|
||||
|
||||
{{- sub_schema_values.probe("liveness", failureThreshold=3, periodSeconds=6, timeoutSeconds=2) | indent(2) }}
|
||||
{{- sub_schema_values.probe("readiness", failureThreshold=3, periodSeconds=2, successThreshold=2, timeoutSeconds=2) | indent(2) }}
|
||||
{{- sub_schema_values.probe("liveness", periodSeconds=6, timeoutSeconds=2) | indent(2) }}
|
||||
{{- sub_schema_values.probe("readiness", periodSeconds=2, successThreshold=2, timeoutSeconds=2) | indent(2) }}
|
||||
{{- sub_schema_values.probe("startup", failureThreshold=21, periodSeconds=2) | indent(2) }}
|
||||
{%- endmacro %}
|
||||
+225
-225
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
||||
Make probe defaults explicit.
|
||||
@@ -50,6 +50,19 @@ def assert_sensible_default_probe(template, probe_type):
|
||||
)
|
||||
probe = container[probe_type]
|
||||
|
||||
assert "failureThreshold" in probe, (
|
||||
f"{template_id(template)} has container {container['name']} with a {probe_type} missing a failureThreshold"
|
||||
)
|
||||
assert "periodSeconds" in probe, (
|
||||
f"{template_id(template)} has container {container['name']} with a {probe_type} missing a periodSeconds"
|
||||
)
|
||||
assert "successThreshold" in probe, (
|
||||
f"{template_id(template)} has container {container['name']} with a {probe_type} missing a successThreshold"
|
||||
)
|
||||
assert "timeoutSeconds" in probe, (
|
||||
f"{template_id(template)} has container {container['name']} with a {probe_type} missing a timeoutSeconds"
|
||||
)
|
||||
|
||||
assert "httpGet" in probe or "exec" in probe or "tcpSocket" in probe
|
||||
if "httpGet" in probe:
|
||||
assert "port" in probe["httpGet"], (
|
||||
|
||||
Reference in new issue
Block a user