Skip to content

Commit 36ac509

Browse files
authored
feat(helm): add pdb for minion and minion-stateless (#17538)
thanks for the contribution
1 parent 128003a commit 36ac509

File tree

3 files changed

+102
-3
lines changed

3 files changed

+102
-3
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
{{- $pdb := .Values.minionStateless.pdb }}
21+
22+
{{- if $pdb.enabled }}
23+
{{- if and $pdb.minAvailable $pdb.maxUnavailable }}
24+
{{- fail "minionStateless.pdb: specify only one of minAvailable or maxUnavailable" }}
25+
{{- end }}
26+
{{- if not (or $pdb.minAvailable $pdb.maxUnavailable) }}
27+
{{- fail "minionStateless.pdb: when enabled is true, you must set either minAvailable or maxUnavailable" }}
28+
{{- end }}
29+
30+
apiVersion: policy/v1
31+
kind: PodDisruptionBudget
32+
metadata:
33+
name: {{ include "pinot.minionStateless.fullname" . }}
34+
namespace: {{ include "pinot.namespace" . }}
35+
spec:
36+
{{- if $pdb.minAvailable }}
37+
minAvailable: {{ $pdb.minAvailable }}
38+
{{- else }}
39+
maxUnavailable: {{ $pdb.maxUnavailable }}
40+
{{- end }}
41+
selector:
42+
matchLabels:
43+
{{- include "pinot.minionStatelessMatchLabels" . | nindent 6 }}
44+
{{- end }}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
{{- $pdb := .Values.minion.pdb }}
21+
22+
{{- if $pdb.enabled }}
23+
{{- if and $pdb.minAvailable $pdb.maxUnavailable }}
24+
{{- fail "minion.pdb: specify only one of minAvailable or maxUnavailable" }}
25+
{{- end }}
26+
{{- if not (or $pdb.minAvailable $pdb.maxUnavailable) }}
27+
{{- fail "minion.pdb: when enabled is true, you must set either minAvailable or maxUnavailable" }}
28+
{{- end }}
29+
30+
apiVersion: policy/v1
31+
kind: PodDisruptionBudget
32+
metadata:
33+
name: {{ include "pinot.minion.fullname" . }}
34+
namespace: {{ include "pinot.namespace" . }}
35+
spec:
36+
{{- if $pdb.minAvailable }}
37+
minAvailable: {{ $pdb.minAvailable }}
38+
{{- else }}
39+
maxUnavailable: {{ $pdb.maxUnavailable }}
40+
{{- end }}
41+
selector:
42+
matchLabels:
43+
{{- include "pinot.minionMatchLabels" . | nindent 6 }}
44+
{{- end }}

helm/pinot/values.yaml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ controller:
150150
pluginsDir: /opt/pinot/plugins
151151

152152
pdb:
153-
enabled: false
153+
enabled: false
154154
minAvailable: ""
155155
maxUnavailable: 50%
156156

@@ -445,7 +445,7 @@ server:
445445
pluginsDir: /opt/pinot/plugins
446446

447447
pdb:
448-
enabled: false
448+
enabled: false
449449
minAvailable: ""
450450
maxUnavailable: 1
451451

@@ -631,6 +631,11 @@ minion:
631631
configs: |-
632632
pinot.set.instance.id.to.hostname=true
633633
634+
# In a PodDisruptionBudget, only one of minAvailable or maxUnavailable may be set.
635+
# By default we use maxUnavailable; override this section if you prefer minAvailable.
636+
pdb:
637+
enabled: false
638+
maxUnavailable: 1
634639

635640
# ------------------------------------------------------------------------------
636641
# Pinot Minion Stateless:
@@ -699,7 +704,7 @@ minionStateless:
699704
# - containerPort: 1234
700705
# protocol: PROTOCOL
701706
# name: extra-port
702-
707+
703708
resources:
704709
requests:
705710
memory: "1.25Gi"
@@ -736,6 +741,12 @@ minionStateless:
736741
configs: |-
737742
pinot.set.instance.id.to.hostname=true
738743
744+
# In a PodDisruptionBudget, only one of minAvailable or maxUnavailable may be set.
745+
# By default we use maxUnavailable; override this section if you prefer minAvailable.
746+
pdb:
747+
enabled: false
748+
maxUnavailable: 1
749+
739750
# ------------------------------------------------------------------------------
740751
# Zookeeper:
741752
# NOTE: IN PRODUCTION USE CASES, IT's BEST TO USE ZOOKEEPER K8S OPERATOR

0 commit comments

Comments
 (0)