File tree Expand file tree Collapse file tree 3 files changed +48
-0
lines changed Expand file tree Collapse file tree 3 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ {{- if .Values.podDisruptionBudget.enabled -}}
2+ apiVersion : policy/v1
3+ kind : PodDisruptionBudget
4+ metadata :
5+ name : {{ include "cloudnative-pg.fullname" . }}
6+ spec :
7+ selector :
8+ matchLabels :
9+ {{- include "cloudnative-pg.selectorLabels" . | nindent 6 }}
10+ {{- if .Values.podDisruptionBudget.minAvailable }}
11+ minAvailable : {{ .Values.podDisruptionBudget.minAvailable }}
12+ {{- end }}
13+ {{- if .Values.podDisruptionBudget.maxUnavailable }}
14+ maxUnavailable : {{ .Values.podDisruptionBudget.maxUnavailable }}
15+ {{- end }}
16+ {{- if (semverCompare ">= 1.27-0" .Capabilities.KubeVersion.Version) }}
17+ unhealthyPodEvictionPolicy : {{ .Values.podDisruptionBudget.unhealthyPodEvictionPolicy }}
18+ {{- end }}
19+ {{- end }}
Original file line number Diff line number Diff line change 1111 "affinity" : {
1212 "type" : " object"
1313 },
14+ "podDisruptionBudget" : {
15+ "type" : " object"
16+ },
1417 "commonAnnotations" : {
1518 "type" : " object"
1619 },
Original file line number Diff line number Diff line change @@ -173,6 +173,32 @@ tolerations: []
173173# -- Affinity for the operator to be installed.
174174affinity : {}
175175
176+ # -- Setup podDisruptionBudget for the operator
177+ # https://kubernetes.io/docs/tasks/run-application/configure-pdb/
178+ podDisruptionBudget :
179+
180+ # -- Specifies whether the PDB shoudl be enabled
181+ enabled : false
182+ # The PDB definition three attributes to control the availability requirements:
183+ # minAvailable or maxUnavailable (mutually exclusive).
184+ # unhealthyPodEvictionPolicy
185+ #
186+ # Field maxUnavailable tells how many pods can be down and minAvailable tells how many pods must be running in a cluster.
187+
188+ # The pdb template will check values according to below order
189+ #
190+ # {{- if .Values.podDisruptionBudget.minAvailable }}
191+ # minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
192+ # {{- end }}
193+ # {{- if .Values.podDisruptionBudget.maxUnavailable }}
194+ # maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
195+ # {{- end }}
196+ #
197+ # If both values are set, the template will use the first one and ignore the second one. currently by default minAvailable is set to 1
198+ minAvailable : 1
199+ maxUnavailable :
200+ unhealthyPodEvictionPolicy : IfHealthyBudget
201+
176202monitoring :
177203
178204 # -- Specifies whether the monitoring should be enabled. Requires Prometheus Operator CRDs.
You can’t perform that action at this time.
0 commit comments