1 {{- if .Values.podDisruptionBudget.enabled }}
2 {{- if and (not .Values.autoscaling.enabled) (le (int .Values.replicaCount) 1) }}
3 {{- fail "Enabling PodDisruptionBudget with replicaCount: 1 and no autoscaling prevents pod restarts during upgrades" }}
5 {{- if and .Values.autoscaling.enabled (le (int .Values.autoscaling.minReplicas) 1) }}
6 {{- fail "Enabling PodDisruptionBudget with autoscaling.minReplicas: 1 prevents pod restarts during upgrades" }}
9 kind: PodDisruptionBudget
11 name: {{ template "kong.fullname" . }}
12 namespace: {{ template "kong.namespace" . }}
14 {{- include "kong.metaLabels" . | nindent 4 }}
16 {{- if .Values.podDisruptionBudget.minAvailable }}
17 minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
19 {{- if .Values.podDisruptionBudget.maxUnavailable }}
20 maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
24 {{- include "kong.metaLabels" . | nindent 6 }}
25 app.kubernetes.io/component: app