diff --git a/charts/prometheus/templates/pdb.yaml b/charts/prometheus/templates/pdb.yaml index eacd51dcb326..dff9284f0c34 100644 --- a/charts/prometheus/templates/pdb.yaml +++ b/charts/prometheus/templates/pdb.yaml @@ -11,10 +11,16 @@ spec: selector: matchLabels: {{- include "prometheus.server.matchLabels" . | nindent 6 }} - {{- if $pdbSpec.minAvailable }} + {{- if not (or (hasKey $pdbSpec "minAvailable") (hasKey $pdbSpec "maxUnavailable")) }} + maxUnavailable: 1 + {{- end }} + {{- if hasKey $pdbSpec "minAvailable" }} minAvailable: {{ $pdbSpec.minAvailable }} {{- end }} - {{- if $pdbSpec.maxUnavailable }} + {{- if hasKey $pdbSpec "maxUnavailable" }} maxUnavailable: {{ $pdbSpec.maxUnavailable }} {{- end }} + {{- if hasKey $pdbSpec "unhealthyPodEvictionPolicy" }} + unhealthyPodEvictionPolicy: {{ $pdbSpec.unhealthyPodEvictionPolicy }} + {{- end }}}} {{- end }}