peridot/infrastructure/dev-helm/temporal/templates/server-pdb.yaml

28 lines
1.1 KiB
YAML
Raw Normal View History

2024-03-11 19:20:43 +00:00
{{- if $.Values.server.enabled }}
{{- range $service := (list "frontend" "history" "matching" "worker") }}
{{- $serviceValues := index $.Values.server $service -}}
{{- if and (gt ($serviceValues.replicaCount | int) 1) ($serviceValues.podDisruptionBudget) }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "temporal.componentname" (list $ $service) }}-pdb
labels:
app.kubernetes.io/name: {{ include "temporal.name" $ }}
helm.sh/chart: {{ include "temporal.chart" $ }}
app.kubernetes.io/managed-by: {{ $.Release.Service }}
app.kubernetes.io/instance: {{ $.Release.Name }}
app.kubernetes.io/version: {{ $.Chart.AppVersion | replace "+" "_" }}
app.kubernetes.io/component: {{ $service }}
app.kubernetes.io/part-of: {{ $.Chart.Name }}
spec:
{{ toYaml $serviceValues.podDisruptionBudget }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "temporal.name" $ }}
app.kubernetes.io/instance: {{ $.Release.Name }}
app.kubernetes.io/component: {{ $service }}
{{- end }}
---
{{- end }}
{{- end }}