{{- if gt (int .Values.replicaCount) 1 }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: {{ include "veylant-proxy.fullname" . }}
  labels:
    {{- include "veylant-proxy.labels" . | nindent 4 }}
spec:
  # Ensure at least 1 pod remains available during voluntary disruptions
  # (node drains, rolling updates). This guarantees zero-downtime for the
  # active slot during a blue/green switch.
  minAvailable: 1
  selector:
    matchLabels:
      {{- include "veylant-proxy.selectorLabels" . | nindent 6 }}
{{- end }}
