Skip to content

Commit f93ffa4

Browse files
committed
make pdb configurable
1 parent d02199b commit f93ffa4

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

chart/templates/pdb.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
1+
{{- if .Values.pdb.enabled }}
12
{{- if ge (int .Values.replicaCount) 2 }}
23
apiVersion: policy/v1
34
kind: PodDisruptionBudget
45
metadata:
56
name: {{ include "reactivejob-operator.fullname" . }}
7+
{{- with .Values.pdb.annotations }}
8+
annotations:
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
611
labels:
712
{{- include "reactivejob-operator.labels" . | nindent 4 }}
13+
{{- with .Values.pdb.labels }}
14+
{{- toYaml . | nindent 4 }}
15+
{{- end }}
816
spec:
9-
minAvailable: 1
17+
{{- if .Values.pdb.maxUnavailable }}
18+
maxUnavailable: {{ .Values.pdb.maxUnavailable }}
19+
{{- else }}
20+
minAvailable: {{ .Values.pdb.minAvailable }}
21+
{{- end }}
1022
selector:
1123
matchLabels:
1224
{{- include "reactivejob-operator.selectorLabels" . | nindent 6 }}
1325
{{- end }}
26+
{{- end }}

chart/values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ resources:
4747
memory: 128Mi
4848
# -- CPU request
4949
cpu: 100m
50+
pdb:
51+
# -- Whether to create a PodDisruptionBudget for the webhook
52+
enabled: true
53+
# -- Labels to set on the PodDisruptionBudget
54+
labels: {}
55+
# -- Annotations to set on the PodDisruptionBudget
56+
annotations: {}
57+
# -- Number of pods that are available after eviction as number or percentage (e.g. 50%)
58+
# @default -- `"1"` (defaults to 1 if not specified)
59+
minAvailable: "1"
60+
# -- Number of pods that are unavailable after eviction as number or percentage (e.g: 50%); has higher precedence over `pdb.minAvailable`
61+
maxUnavailable: ""
5062
webhook:
5163
certManager:
5264
# -- Whether to use cert-manager to manage webhook tls

0 commit comments

Comments
 (0)