{{- if .Values.podDisruptionBudget.enabled }} apiVersion: policy/v1 kind: PodDisruptionBudget metadata: name: {{ include "headlamp.fullname" . }} namespace: {{ include "headlamp.namespace" . }} labels: {{- include "headlamp.labels" . | nindent 4 }} spec: {{- with .Values.podDisruptionBudget.maxUnavailable }} maxUnavailable: {{ . }} {{- end }} {{- with .Values.podDisruptionBudget.minAvailable }} minAvailable: {{ . }} {{- end }} {{- if (semverCompare ">= 1.27-0" .Capabilities.KubeVersion.Version) }} {{- if hasKey .Values.podDisruptionBudget "unhealthyPodEvictionPolicy" }} {{- with .Values.podDisruptionBudget.unhealthyPodEvictionPolicy }} unhealthyPodEvictionPolicy: {{ . }} {{- end }} {{- end }} {{- end }} selector: matchLabels: {{- include "headlamp.selectorLabels" . | nindent 6 }} {{- end }}