blob: 869906b4cbd2d6cc1aab8e0e5ce65058eaff7793 [file] [log] [blame]
{{- $replica := int .Values.replicas }}
{{- if and .Values.podDisruptionBudget.enabled (gt $replica 1) }}
apiVersion: {{ include "nacos.policy.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ template "nacos.fullname" . }}
namespace: {{ template "nacos.namespace" . }}
labels: {{- include "nacos.labels" . | nindent 4 }}
spec:
{{- if .Values.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
{{- end }}
selector:
matchLabels: {{- include "nacos.matchLabels" . | nindent 6 }}
{{- end }}