{{- if and (not .Values.configsvr.external.host) .Values.configsvr.pdb.enabled -}}
kind: PodDisruptionBudget
apiVersion: policy/v1beta1
metadata:
  name: {{ include "mongodb-sharded.fullname" . }}-configsvr
  labels: {{- include "mongodb-sharded.labels" . | nindent 4 }}
    app.kubernetes.io/component: configsvr
spec:
  selector:
    matchLabels: {{- include "mongodb-sharded.matchLabels" . | nindent 6 }}
      app.kubernetes.io/component: configsvr
  {{- if .Values.configsvr.pdb.minAvailable }}
  minAvailable: {{ .Values.configsvr.pdb.minAvailable | int }}
  {{- end }}
  {{- if .Values.configsvr.pdb.maxUnavailable }}
  maxUnavailable: {{ .Values.configsvr.pdb.maxUnavailable | int }}
  {{- end }}
{{- end -}}
