Skip to content

Commit 3818da8

Browse files
feat(helm): optionally set pod disruption budgets (#27163)
1 parent 986e417 commit 3818da8

14 files changed

+317
-13
lines changed

helm/superset/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ maintainers:
2929
- name: craig-rueda
3030
3131
url: https://github.com/craig-rueda
32-
version: 0.12.5
32+
version: 0.12.6
3333
dependencies:
3434
- name: postgresql
3535
version: 12.1.6

helm/superset/README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ NOTE: This file is generated by helm-docs: https://github.com/norwoodj/helm-docs
2323

2424
# superset
2525

26-
![Version: 0.12.5](https://img.shields.io/badge/Version-0.12.5-informational?style=flat-square)
26+
![Version: 0.12.6](https://img.shields.io/badge/Version-0.12.6-informational?style=flat-square)
2727

2828
Apache Superset is a modern, enterprise-ready business intelligence web application
2929

@@ -134,6 +134,10 @@ On helm this can be set on `extraSecretEnv.SUPERSET_SECRET_KEY` or `configOverri
134134
| supersetCeleryBeat.forceReload | bool | `false` | If true, forces deployment to reload on each upgrade |
135135
| supersetCeleryBeat.initContainers | list | a container waiting for postgres | List of init containers |
136136
| supersetCeleryBeat.podAnnotations | object | `{}` | Annotations to be added to supersetCeleryBeat pods |
137+
| supersetCeleryBeat.podDisruptionBudget | object | `{"enabled":false,"maxUnavailable":1,"minAvailable":1}` | Sets the [pod disruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for supersetCeleryBeat pods |
138+
| supersetCeleryBeat.podDisruptionBudget.enabled | bool | `false` | Whether the pod disruption budget should be created |
139+
| supersetCeleryBeat.podDisruptionBudget.maxUnavailable | int | `1` | If set, minAvailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
140+
| supersetCeleryBeat.podDisruptionBudget.minAvailable | int | `1` | If set, maxUnavailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
137141
| supersetCeleryBeat.podLabels | object | `{}` | Labels to be added to supersetCeleryBeat pods |
138142
| supersetCeleryBeat.podSecurityContext | object | `{}` | |
139143
| supersetCeleryBeat.resources | object | `{}` | Resource settings for the CeleryBeat pods - these settings overwrite might existing values from the global resources object defined above. |
@@ -153,6 +157,10 @@ On helm this can be set on `extraSecretEnv.SUPERSET_SECRET_KEY` or `configOverri
153157
| supersetCeleryFlower.livenessProbe.successThreshold | int | `1` | |
154158
| supersetCeleryFlower.livenessProbe.timeoutSeconds | int | `1` | |
155159
| supersetCeleryFlower.podAnnotations | object | `{}` | Annotations to be added to supersetCeleryFlower pods |
160+
| supersetCeleryFlower.podDisruptionBudget | object | `{"enabled":false,"maxUnavailable":1,"minAvailable":1}` | Sets the [pod disruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for supersetCeleryFlower pods |
161+
| supersetCeleryFlower.podDisruptionBudget.enabled | bool | `false` | Whether the pod disruption budget should be created |
162+
| supersetCeleryFlower.podDisruptionBudget.maxUnavailable | int | `1` | If set, minAvailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
163+
| supersetCeleryFlower.podDisruptionBudget.minAvailable | int | `1` | If set, maxUnavailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
156164
| supersetCeleryFlower.podLabels | object | `{}` | Labels to be added to supersetCeleryFlower pods |
157165
| supersetCeleryFlower.podSecurityContext | object | `{}` | |
158166
| supersetCeleryFlower.readinessProbe.failureThreshold | int | `3` | |
@@ -210,6 +218,10 @@ On helm this can be set on `extraSecretEnv.SUPERSET_SECRET_KEY` or `configOverri
210218
| supersetNode.livenessProbe.successThreshold | int | `1` | |
211219
| supersetNode.livenessProbe.timeoutSeconds | int | `1` | |
212220
| supersetNode.podAnnotations | object | `{}` | Annotations to be added to supersetNode pods |
221+
| supersetNode.podDisruptionBudget | object | `{"enabled":false,"maxUnavailable":1,"minAvailable":1}` | Sets the [pod disruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for supersetNode pods |
222+
| supersetNode.podDisruptionBudget.enabled | bool | `false` | Whether the pod disruption budget should be created |
223+
| supersetNode.podDisruptionBudget.maxUnavailable | int | `1` | If set, minAvailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
224+
| supersetNode.podDisruptionBudget.minAvailable | int | `1` | If set, maxUnavailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
213225
| supersetNode.podLabels | object | `{}` | Labels to be added to supersetNode pods |
214226
| supersetNode.podSecurityContext | object | `{}` | |
215227
| supersetNode.readinessProbe.failureThreshold | int | `3` | |
@@ -250,6 +262,10 @@ On helm this can be set on `extraSecretEnv.SUPERSET_SECRET_KEY` or `configOverri
250262
| supersetWebsockets.livenessProbe.successThreshold | int | `1` | |
251263
| supersetWebsockets.livenessProbe.timeoutSeconds | int | `1` | |
252264
| supersetWebsockets.podAnnotations | object | `{}` | |
265+
| supersetWebsockets.podDisruptionBudget | object | `{"enabled":false,"maxUnavailable":1,"minAvailable":1}` | Sets the [pod disruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for supersetWebsockets pods |
266+
| supersetWebsockets.podDisruptionBudget.enabled | bool | `false` | Whether the pod disruption budget should be created |
267+
| supersetWebsockets.podDisruptionBudget.maxUnavailable | int | `1` | If set, minAvailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
268+
| supersetWebsockets.podDisruptionBudget.minAvailable | int | `1` | If set, maxUnavailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
253269
| supersetWebsockets.podLabels | object | `{}` | |
254270
| supersetWebsockets.podSecurityContext | object | `{}` | |
255271
| supersetWebsockets.readinessProbe.failureThreshold | int | `3` | |
@@ -294,6 +310,10 @@ On helm this can be set on `extraSecretEnv.SUPERSET_SECRET_KEY` or `configOverri
294310
| supersetWorker.livenessProbe.successThreshold | int | `1` | |
295311
| supersetWorker.livenessProbe.timeoutSeconds | int | `60` | |
296312
| supersetWorker.podAnnotations | object | `{}` | Annotations to be added to supersetWorker pods |
313+
| supersetWorker.podDisruptionBudget | object | `{"enabled":false,"maxUnavailable":1,"minAvailable":1}` | Sets the [pod disruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for supersetWorker pods |
314+
| supersetWorker.podDisruptionBudget.enabled | bool | `false` | Whether the pod disruption budget should be created |
315+
| supersetWorker.podDisruptionBudget.maxUnavailable | int | `1` | If set, minAvailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
316+
| supersetWorker.podDisruptionBudget.minAvailable | int | `1` | If set, maxUnavailable must not be set - see https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget |
297317
| supersetWorker.podLabels | object | `{}` | Labels to be added to supersetWorker pods |
298318
| supersetWorker.podSecurityContext | object | `{}` | |
299319
| supersetWorker.readinessProbe | object | `{}` | No startup/readiness probes by default since we don't really care about its startup time (it doesn't serve traffic) |

helm/superset/templates/_helpers.tpl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,28 @@ RESULTS_BACKEND = RedisCache(
136136
{{- end }}
137137

138138
{{- end }}
139+
140+
{{- define "supersetCeleryBeat.selectorLabels" -}}
141+
app: {{ include "superset.name" . }}-celerybeat
142+
release: {{ .Release.Name }}
143+
{{- end }}
144+
145+
{{- define "supersetCeleryFlower.selectorLabels" -}}
146+
app: {{ include "superset.name" . }}-flower
147+
release: {{ .Release.Name }}
148+
{{- end }}
149+
150+
{{- define "supersetNode.selectorLabels" -}}
151+
app: {{ include "superset.name" . }}
152+
release: {{ .Release.Name }}
153+
{{- end }}
154+
155+
{{- define "supersetWebsockets.selectorLabels" -}}
156+
app: {{ include "superset.name" . }}-ws
157+
release: {{ .Release.Name }}
158+
{{- end }}
159+
160+
{{- define "supersetWorker.selectorLabels" -}}
161+
app: {{ include "superset.name" . }}-worker
162+
release: {{ .Release.Name }}
163+
{{- end }}

helm/superset/templates/deployment-beat.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ spec:
3636
replicas: 1
3737
selector:
3838
matchLabels:
39-
app: {{ template "superset.name" . }}-celerybeat
40-
release: {{ .Release.Name }}
39+
{{- include "supersetCeleryBeat.selectorLabels" . | nindent 6 }}
4140
template:
4241
metadata:
4342
annotations:

helm/superset/templates/deployment-flower.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ spec:
3535
replicas: {{ .Values.supersetCeleryFlower.replicaCount }}
3636
selector:
3737
matchLabels:
38-
app: {{ template "superset.name" . }}-flower
39-
release: {{ .Release.Name }}
38+
{{- include "supersetCeleryFlower.selectorLabels" . | nindent 6 }}
4039
template:
4140
metadata:
4241
annotations:

helm/superset/templates/deployment-worker.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ spec:
3939
{{- end }}
4040
selector:
4141
matchLabels:
42-
app: {{ template "superset.name" . }}-worker
43-
release: {{ .Release.Name }}
42+
{{- include "supersetWorker.selectorLabels" . | nindent 6 }}
4443
{{- if .Values.supersetWorker.strategy }}
4544
strategy: {{- toYaml .Values.supersetWorker.strategy | nindent 4 }}
4645
{{- end }}

helm/superset/templates/deployment-ws.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ spec:
3535
replicas: {{ .Values.supersetWebsockets.replicaCount }}
3636
selector:
3737
matchLabels:
38-
app: "{{ template "superset.name" . }}-ws"
39-
release: {{ .Release.Name }}
38+
{{- include "supersetWebsockets.selectorLabels" . | nindent 6 }}
4039
{{- if .Values.supersetWebsockets.strategy }}
4140
strategy: {{- toYaml .Values.supersetWebsockets.strategy | nindent 4 }}
4241
{{- end }}

helm/superset/templates/deployment.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ spec:
4242
{{- end }}
4343
selector:
4444
matchLabels:
45-
app: {{ template "superset.name" . }}
46-
release: {{ .Release.Name }}
45+
{{- include "supersetNode.selectorLabels" . | nindent 6 }}
4746
template:
4847
metadata:
4948
annotations:
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{{/*
2+
3+
Licensed to the Apache Software Foundation (ASF) under one or more
4+
contributor license agreements. See the NOTICE file distributed with
5+
this work for additional information regarding copyright ownership.
6+
The ASF licenses this file to You under the Apache License, Version 2.0
7+
(the "License"); you may not use this file except in compliance with
8+
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, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
18+
*/}}
19+
20+
{{- with .Values.supersetCeleryBeat.podDisruptionBudget }}
21+
{{- if .enabled -}}
22+
{{- if and .minAvailable .maxUnavailable }}
23+
{{- fail "Only one of minAvailable or maxUnavailable should be set" }}
24+
{{- end}}
25+
apiVersion: policy/v1
26+
kind: PodDisruptionBudget
27+
metadata:
28+
name: {{ include "superset.fullname" $ }}-celerybeat-pdb
29+
labels:
30+
app: {{ template "superset.name" $ }}-celerybeat
31+
chart: {{ template "superset.chart" $ }}
32+
release: {{ $.Release.Name }}
33+
heritage: {{ $.Release.Service }}
34+
spec:
35+
{{- if .minAvailable }}
36+
minAvailable: {{ .minAvailable }}
37+
{{- end }}
38+
{{- if .maxUnavailable }}
39+
maxUnavailable: {{ .maxUnavailable }}
40+
{{- end }}
41+
selector:
42+
matchLabels:
43+
{{- include "supersetCeleryBeat.selectorLabels" $ | nindent 6 }}
44+
{{- end }}
45+
{{- end }}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{{/*
2+
3+
Licensed to the Apache Software Foundation (ASF) under one or more
4+
contributor license agreements. See the NOTICE file distributed with
5+
this work for additional information regarding copyright ownership.
6+
The ASF licenses this file to You under the Apache License, Version 2.0
7+
(the "License"); you may not use this file except in compliance with
8+
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, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
18+
*/}}
19+
20+
{{- with .Values.supersetCeleryFlower.podDisruptionBudget }}
21+
{{- if .enabled -}}
22+
{{- if and .minAvailable .maxUnavailable }}
23+
{{- fail "Only one of minAvailable or maxUnavailable should be set" }}
24+
{{- end}}
25+
apiVersion: policy/v1
26+
kind: PodDisruptionBudget
27+
metadata:
28+
name: {{ include "superset.fullname" $ }}-flower-pdb
29+
labels:
30+
app: {{ template "superset.name" $ }}-flower
31+
chart: {{ template "superset.chart" $ }}
32+
release: {{ $.Release.Name }}
33+
heritage: {{ $.Release.Service }}
34+
spec:
35+
{{- if .minAvailable }}
36+
minAvailable: {{ .minAvailable }}
37+
{{- end }}
38+
{{- if .maxUnavailable }}
39+
maxUnavailable: {{ .maxUnavailable }}
40+
{{- end }}
41+
selector:
42+
matchLabels:
43+
{{- include "supersetCeleryFlower.selectorLabels" $ | nindent 6 }}
44+
{{- end }}
45+
{{- end }}

0 commit comments

Comments
 (0)