Files

45 lines
2.0 KiB
Django/Jinja

{#
Copyright 2024-2025 New Vector Ltd
Copyright 2025-2026 Element Creations Ltd
SPDX-License-Identifier: AGPL-3.0-only
#}
{% import 'sub_schema_values.yaml.j2' as sub_schema_values -%}
replicas: 1
## How long HAProxy keeps its listeners open after the pod starts stopping, e.g. 5s
## This gives the Service time to update its iptables rules before the pod is killed
grace: 5s
## How long at most HAProxy takes to fully stop after the pod starts stopping, e.g. 10s
## HAProxy closes every remaining connection when this time is up
## Keep this + `grace` below the pod's terminationGracePeriodSeconds, which defaults to 30s
hardStopAfter: 10s
{{- sub_schema_values.image(registry='docker.io', repository='library/haproxy', tag='3.4.8-alpine') }}
{{- sub_schema_values.labels() }}
{{- sub_schema_values.workloadAnnotations() }}
{{- sub_schema_values.containersSecurityContext() }}
{{- sub_schema_values.extraEnv() }}
{{- sub_schema_values.extraVolumes("HAProxy") }}
{{- sub_schema_values.extraVolumeMounts("HAProxy") }}
{{- sub_schema_values.extraInitContainers("HAProxy") }}
{{- sub_schema_values.nodeSelector() }}
{{- sub_schema_values.priorityClassName() }}
{{- sub_schema_values.schedulerName() }}
{{- sub_schema_values.runtimeClassName() }}
{{- sub_schema_values.affinity() }}
{{- sub_schema_values.podSecurityContext(user_id='10001', group_id='10001') }}
{{- sub_schema_values.resources(requests_memory='100Mi', requests_cpu='100m', limits_memory='200Mi') }}
{{- sub_schema_values.serviceAccount() }}
{{- sub_schema_values.serviceMonitors() }}
{{- sub_schema_values.tolerations() }}
{{- sub_schema_values.topologySpreadConstraints() }}
{{- sub_schema_values.probe("liveness", timeoutSeconds=5) }}
{{- sub_schema_values.probe("readiness", timeoutSeconds=5) }}
# The failureThreshold here is tweaked towards Synapse being ready
# If Synapse isn't being deployed, unsetting this or setting it to 3 maybe more appropriate
{{- sub_schema_values.probe("startup", failureThreshold=150, periodSeconds=2) }}