Files
devops-infra-helm-charts-gcp/helm-templates/victoria-metrics-cluster-latest/templates/pdb.yaml
T
2026-08-26 03:39:42 +05:30

27 lines
798 B
YAML

{{- $ctx := dict "helm" . }}
{{- range $name, $app := .Values }}
{{- if and (kindIs "map" $app) $app.enabled ($app.podDisruptionBudget).enabled }}
{{- $pdb := $app.podDisruptionBudget }}
{{- $_ := set $ctx "extraLabels" $pdb.labels }}
{{- $_ := set $ctx "appKey" $name }}
{{- $fullname := include "vm.plain.fullname" $ctx }}
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ $fullname }}
namespace: {{ include "vm.namespace" $ }}
labels: {{ include "vm.labels" $ctx | nindent 4 }}
{{- $_ := unset $ctx "extraLabels" }}
spec:
{{- with $pdb.minAvailable }}
minAvailable: {{ . }}
{{- end }}
{{- with $pdb.maxUnavailable }}
maxUnavailable: {{ . }}
{{- end }}
selector:
matchLabels: {{ include "vm.selectorLabels" $ctx | nindent 6 }}
{{- end }}
{{- end }}