blob: c3d799ea1d69f118362944ce42cd38ba49c6aba9 [file] [log] [blame]
{{- $replica := int .Values.replicas }}
{{- if and .Values.podDisruptionBudget.enabled (gt $replica 1) }}
apiVersion: {{ include "zookeeper.policy.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ template "zookeeper.fullname" . }}
namespace: {{ template "zookeeper.namespace" . }}
labels: {{- include "zookeeper.labels" . | nindent 4 }}
app.kubernetes.io/component: zookeeper
{{- if .Values.Labels }}
{{- include "zookeeper.tplvalues" ( dict "value" .Values.Labels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.Annotations }}
annotations: {{- include "zookeeper.tplvalues" ( dict "value" .Values.Annotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- if .Values.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
{{- end }}
selector:
matchLabels: {{- include "zookeeper.matchLabels" . | nindent 6 }}
app.kubernetes.io/component: zookeeper
{{- end }}