pdb.yaml 1.2 KB

12345678910111213141516171819202122232425262728
  1. {{- /*
  2. Copyright Broadcom, Inc. All Rights Reserved.
  3. SPDX-License-Identifier: APACHE-2.0
  4. */}}
  5. {{- if .Values.pdb.create }}
  6. apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
  7. kind: PodDisruptionBudget
  8. metadata:
  9. name: {{ template "common.names.fullname" . }}
  10. namespace: {{ template "zookeeper.namespace" . }}
  11. labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
  12. app.kubernetes.io/component: zookeeper
  13. {{- if .Values.commonAnnotations }}
  14. annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  15. {{- end }}
  16. spec:
  17. {{- if .Values.pdb.minAvailable }}
  18. minAvailable: {{ .Values.pdb.minAvailable }}
  19. {{- end }}
  20. {{- if or .Values.pdb.maxUnavailable (not .Values.pdb.minAvailable) }}
  21. maxUnavailable: {{ .Values.pdb.maxUnavailable | default 1 }}
  22. {{- end }}
  23. {{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.podLabels .Values.commonLabels ) "context" . ) }}
  24. selector:
  25. matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
  26. app.kubernetes.io/component: zookeeper
  27. {{- end }}