Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm Chart - support for priorityClassName #20794

Merged
merged 62 commits into from
Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
a1c532e
[16185] Added LocalKubernetesExecutor to breeze supported executors
subkanthi Nov 22, 2021
6cbb506
Merge branch 'master' of github.com:subkanthi/airflow
subkanthi Nov 22, 2021
d16a343
Revert "[16185] Added LocalKubernetesExecutor to breeze supported exe…
subkanthi Nov 22, 2021
a336e17
Merge branch 'apache:main' into master
subkanthi Nov 30, 2021
382eedf
Merge branch 'apache:main' into master
subkanthi Dec 2, 2021
c3030fb
Merge branch 'apache:main' into master
subkanthi Dec 4, 2021
1c3c029
Merge branch 'apache:main' into master
subkanthi Dec 6, 2021
0eb6598
Merge branch 'apache:main' into master
subkanthi Dec 10, 2021
35a344e
Merge branch 'apache:main' into master
subkanthi Dec 12, 2021
8d47486
Merge branch 'apache:main' into master
subkanthi Dec 12, 2021
f450679
Merge branch 'apache:main' into master
subkanthi Dec 14, 2021
67c6f5e
Merge branch 'apache:main' into master
subkanthi Dec 14, 2021
a09d628
Merge branch 'apache:main' into master
subkanthi Dec 14, 2021
1568b72
Merge branch 'apache:main' into master
subkanthi Dec 15, 2021
a89daf1
Merge branch 'apache:main' into master
subkanthi Dec 16, 2021
3c24d50
Merge branch 'apache:main' into master
subkanthi Dec 18, 2021
874b0c2
Merge branch 'apache:main' into master
subkanthi Dec 19, 2021
c07aabf
Merge branch 'apache:main' into master
subkanthi Dec 20, 2021
0f385fc
Merge branch 'apache:main' into master
subkanthi Dec 20, 2021
8bab66c
Merge branch 'apache:main' into master
subkanthi Dec 21, 2021
9f34837
Merge branch 'apache:main' into master
subkanthi Dec 24, 2021
a1dea59
Merge branch 'apache:main' into master
subkanthi Dec 29, 2021
2cbccda
Merge branch 'apache:main' into master
subkanthi Dec 30, 2021
00fbfcb
Merge branch 'apache:main' into master
subkanthi Dec 30, 2021
0c7cc12
Merge branch 'apache:main' into master
subkanthi Dec 31, 2021
3a308dc
Merge branch 'apache:main' into master
subkanthi Dec 31, 2021
c2aa679
Merge branch 'apache:main' into master
subkanthi Jan 4, 2022
a50c41a
Merge branch 'apache:main' into master
subkanthi Jan 5, 2022
2631ca1
Merge branch 'apache:main' into master
subkanthi Jan 6, 2022
8ce7c49
Merge branch 'apache:main' into master
subkanthi Jan 7, 2022
8fb9929
Merge branch 'apache:main' into master
subkanthi Jan 7, 2022
0a9a843
Merge branch 'apache:main' into master
subkanthi Jan 9, 2022
085e4ab
Added priorityClassName to webserver values
subkanthi Jan 10, 2022
43129d3
Added support for priorityClassName to flower, pgbouncer, scheduler, …
subkanthi Jan 10, 2022
0a976e0
Added priorityClassName to workers
subkanthi Jan 10, 2022
b2a30ba
Merge branch 'apache:main' into master
subkanthi Jan 12, 2022
3e1b58c
Merge branch 'apache:main' into master
subkanthi Jan 15, 2022
41a420c
Merge branch 'apache:main' into master
subkanthi Jan 18, 2022
d94c4ce
Merge branch 'apache:main' into master
subkanthi Jan 18, 2022
01f9319
Merge branch 'apache:main' into master
subkanthi Jan 18, 2022
cf2376f
Merge branch 'apache:main' into master
subkanthi Jan 22, 2022
8880c75
Merge branch 'apache:main' into master
subkanthi Jan 23, 2022
ee61fa9
Merge branch 'apache:main' into master
subkanthi Jan 24, 2022
8822af9
Merge branch 'apache:main' into master
subkanthi Jan 24, 2022
22a314e
Merge branch 'apache:main' into master
subkanthi Jan 24, 2022
2f54ba1
Merge branch 'apache:main' into master
subkanthi Jan 24, 2022
05162fd
Merge branch 'apache:main' into master
subkanthi Jan 25, 2022
b335457
Merge branch 'apache:main' into master
subkanthi Jan 27, 2022
f1f4970
Updates based on PR review comments
subkanthi Jan 27, 2022
d0d4315
Changed priorityClassName to tilde, update values.schema.json to incl…
subkanthi Jan 27, 2022
5c3c3e2
Added test case for priorityClassName in helm charts
subkanthi Jan 27, 2022
7d72855
Merge branch 'apache:main' into master
subkanthi Jan 27, 2022
ef84ed4
Resolved conflicts
subkanthi Jan 27, 2022
a1c3cce
Merge branch 'apache:main' into master
subkanthi Jan 28, 2022
02775d1
Update chart/values.yaml
subkanthi Jan 28, 2022
b533553
Update chart/values.schema.json
subkanthi Jan 28, 2022
3697725
Merge branch 'master' of github.com:subkanthi/airflow into add_priori…
subkanthi Jan 28, 2022
0e56669
Merge branch 'add_priority_class' of github.com:subkanthi/airflow int…
subkanthi Jan 28, 2022
1487425
Changed priorityClass helm test based on PR review comments
subkanthi Jan 28, 2022
428847f
Merge branch 'master' of github.com:subkanthi/airflow into add_priori…
subkanthi Jan 29, 2022
e48fba8
Merge branch 'master' of github.com:subkanthi/airflow into add_priori…
subkanthi Feb 4, 2022
a5089f2
Changed priorityClassName comments
subkanthi Feb 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions chart/templates/flower/flower-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ spec:
tolerations:
{{ toYaml $tolerations | indent 8 }}
serviceAccountName: {{ include "flower.serviceAccountName" . }}
{{- if .Values.flower.priorityClassName }}
priorityClassName: {{ .Values.flower.priorityClassName }}
subkanthi marked this conversation as resolved.
Show resolved Hide resolved
{{- end }}
restartPolicy: Always
securityContext: {{ $securityContext | nindent 8 }}
{{- if or .Values.registry.secretName .Values.registry.connection }}
Expand Down
3 changes: 3 additions & 0 deletions chart/templates/pgbouncer/pgbouncer-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ spec:
checksum/pgbouncer-config-secret: {{ include (print $.Template.BasePath "/secrets/pgbouncer-config-secret.yaml") . | sha256sum }}
checksum/pgbouncer-certificates-secret: {{ include (print $.Template.BasePath "/secrets/pgbouncer-certificates-secret.yaml") . | sha256sum }}
spec:
{{- if .Values.pgbouncer.priorityClassName }}
priorityClassName: {{ .Values.pgbouncer.priorityClassName }}
subkanthi marked this conversation as resolved.
Show resolved Hide resolved
{{- end }}
nodeSelector:
{{ toYaml $nodeSelector | indent 8 }}
affinity:
Expand Down
3 changes: 3 additions & 0 deletions chart/templates/scheduler/scheduler-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ spec:
{{- toYaml .Values.scheduler.podAnnotations | nindent 8 }}
{{- end }}
spec:
{{- if .Values.scheduler.priorityClassName }}
priorityClassName: {{ .Values.scheduler.priorityClassName }}
{{- end }}
nodeSelector:
{{ toYaml $nodeSelector | indent 8 }}
affinity:
Expand Down
3 changes: 3 additions & 0 deletions chart/templates/statsd/statsd-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ spec:
checksum/statsd-config: {{ include (print $.Template.BasePath "/configmaps/statsd-configmap.yaml") . | sha256sum }}
{{- end }}
spec:
{{- if .Values.statsd.priorityClassName }}
priorityClassName: {{ .Values.statsd.priorityClassName }}
{{- end }}
nodeSelector:
{{ toYaml $nodeSelector | indent 8 }}
affinity:
Expand Down
3 changes: 3 additions & 0 deletions chart/templates/triggerer/triggerer-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ spec:
{{- toYaml .Values.triggerer.podAnnotations | nindent 8 }}
{{- end }}
spec:
{{- if .Values.triggerer.priorityClassName }}
priorityClassName: {{ .Values.triggerer.priorityClassName }}
{{- end }}
nodeSelector:
{{- toYaml $nodeSelector | nindent 8 }}
affinity:
Expand Down
3 changes: 3 additions & 0 deletions chart/templates/webserver/webserver-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ spec:
{{- end }}
spec:
serviceAccountName: {{ include "webserver.serviceAccountName" . }}
{{- if .Values.webserver.priorityClassName }}
priorityClassName: {{ .Values.webserver.priorityClassName }}
{{- end }}
nodeSelector:
{{ toYaml $nodeSelector | indent 8 }}
affinity:
Expand Down
3 changes: 3 additions & 0 deletions chart/templates/workers/worker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ spec:
{{- toYaml .Values.workers.podAnnotations | nindent 8 }}
{{- end }}
spec:
{{- if .Values.workers.priorityClassName }}
priorityClassName: {{ .Values.workers.priorityClassName }}
{{- end }}
nodeSelector:
{{ toYaml $nodeSelector | indent 8 }}
affinity:
Expand Down
28 changes: 28 additions & 0 deletions chart/tests/test_airflow_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,3 +268,31 @@ def test_have_all_config_mounts_on_init_containers(self):
}
for doc in docs:
assert expected_mount in jmespath.search("spec.template.spec.initContainers[0].volumeMounts", doc)

def test_priority_class_name(self):
docs = render_chart(
values={
"flower": {"priorityClassName": "low-priority-flower"},
"pgbouncer": {"priorityClassName": "low-priority-pgbouncer"},
"scheduler": {"priorityClassName": "low-priority-scheduler"},
"statsd": {"priorityClassName": "low-priority-statsd"},
"triggerer": {"priorityClassName": "low-priority-triggerer"},
"webserver": {"priorityClassName": "low-priority-webserver"},
"workers": {"priorityClassName": "low-priority-worker"},
},
show_only=[
"templates/flower/flower-deployment.yaml",
"templates/pgbouncer/pgbouncer-deployment.yaml",
"templates/scheduler/scheduler-deployment.yaml",
"templates/statsd/statsd-deployment.yaml",
"templates/triggerer/triggerer-deployment.yaml",
"templates/webserver/webserver-deployment.yaml",
"templates/workers/worker-deployment.yaml",
],
)

for doc in docs:
component = doc['metadata']['labels']['component']
priority = doc['spec']['template']['spec']['priorityClassName']

assert priority == f"low-priority-{component}"
56 changes: 56 additions & 0 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1351,6 +1351,14 @@
"type": "string"
}
},
"priorityClassName": {
"description": "Specify priority for worker pods.",
"type": [
"string",
"null"
],
"default": null
},
"affinity": {
"description": "Specify scheduling constraints for worker pods.",
"type": "object",
Expand Down Expand Up @@ -1660,6 +1668,14 @@
"type": "string"
}
},
"priorityClassName": {
"description": "Specify priority for scheduler pods.",
"type": [
"string",
"null"
],
"default": null
},
"affinity": {
"description": "Specify scheduling constraints for scheduler pods.",
"type": "object",
Expand Down Expand Up @@ -1930,6 +1946,14 @@
"type": "string"
}
},
"priorityClassName": {
"description": "Specify priority for triggerer pods.",
"type": [
"string",
"null"
],
"default": null
},
"affinity": {
"description": "Specify scheduling constraints for triggerer pods.",
"type": "object",
Expand Down Expand Up @@ -2632,6 +2656,14 @@
"type": "string"
}
},
"priorityClassName": {
"description": "Specify priority for webserver pods.",
"type": [
"string",
"null"
],
"default": null
},
"affinity": {
"description": "Specify scheduling constraints for webserver pods.",
"type": "object",
Expand Down Expand Up @@ -2915,6 +2947,14 @@
"type": "string"
}
},
"priorityClassName": {
"description": "Specify priority for Flower pods.",
"type": [
"string",
"null"
],
"default": null
},
"affinity": {
"description": "Specify scheduling constraints for Flower pods.",
"type": "object",
Expand Down Expand Up @@ -3046,6 +3086,14 @@
"type": "string"
}
},
"priorityClassName": {
"description": "Specify priority for StatsD pods.",
"type": [
"string",
"null"
],
"default": null
},
"affinity": {
"description": "Specify scheduling constraints for StatsD pods.",
"type": "object",
Expand Down Expand Up @@ -3347,6 +3395,14 @@
"type": "string"
}
},
"priorityClassName": {
"description": "Specify priority for PgBouncer pods.",
"type": [
"string",
"null"
],
"default": null
},
"affinity": {
"description": "Specify scheduling constraints for PgBouncer pods.",
"type": "object",
Expand Down
12 changes: 12 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ workers:

# Select certain nodes for airflow worker pods.
nodeSelector: {}
priorityClassName: ~
affinity: {}
# default worker affinity is:
# podAntiAffinity:
Expand Down Expand Up @@ -638,6 +639,8 @@ scheduler:
# weight: 100
tolerations: []

priorityClassName: ~

podAnnotations: {}

logGroomerSidecar:
Expand Down Expand Up @@ -866,6 +869,7 @@ webserver:

# Select certain nodes for airflow webserver pods.
nodeSelector: {}
priorityClassName: ~
affinity: {}
# default webserver affinity is:
# podAntiAffinity:
Expand Down Expand Up @@ -960,6 +964,8 @@ triggerer:
# weight: 100
tolerations: []

priorityClassName: ~

podAnnotations: {}

# Flower settings
Expand Down Expand Up @@ -1049,6 +1055,8 @@ flower:
affinity: {}
tolerations: []

priorityClassName: ~

podAnnotations: {}

# Statsd settings
Expand Down Expand Up @@ -1090,6 +1098,8 @@ statsd:
affinity: {}
tolerations: []

priorityClassName: ~

# Additional mappings for statsd exporter.
extraMappings: []

Expand Down Expand Up @@ -1196,6 +1206,8 @@ pgbouncer:
affinity: {}
tolerations: []

priorityClassName: ~

uid: 65534

metricsExporterSidecar:
Expand Down