pdb.yaml 1.1 KB

1234567891011121314151617181920212223242526
  1. {{- $replicaCount := int .Values.replicaCount }}
  2. {{- if and .Values.pdb.create (gt $replicaCount 1) }}
  3. apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
  4. kind: PodDisruptionBudget
  5. metadata:
  6. name: {{ template "common.names.fullname" . }}
  7. namespace: {{ template "zookeeper.namespace" . }}
  8. labels: {{- include "common.labels.standard" . | nindent 4 }}
  9. app.kubernetes.io/component: zookeeper
  10. {{- if .Values.commonLabels }}
  11. {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
  12. {{- end }}
  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 .Values.pdb.maxUnavailable }}
  21. maxUnavailable: {{ .Values.pdb.maxUnavailable }}
  22. {{- end }}
  23. selector:
  24. matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
  25. app.kubernetes.io/component: zookeeper
  26. {{- end }}