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

18400 chart custom pod annotations #18481

Merged
merged 3 commits into from
Sep 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions chart/templates/flower/flower-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ spec:
{{- with .Values.labels }}
{{ toYaml . | indent 8 }}
{{- end }}
{{- if .Values.airflowPodAnnotations }}
{{- if or (.Values.airflowPodAnnotations) (.Values.flower.podAnnotations) }}
annotations:
{{- toYaml .Values.airflowPodAnnotations | nindent 8 }}
{{- mustMerge .Values.flower.podAnnotations .Values.airflowPodAnnotations | toYaml | nindent 8 }}
{{- end }}
spec:
nodeSelector:
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 @@ -85,6 +85,9 @@ spec:
{{- if .Values.airflowPodAnnotations }}
{{- toYaml .Values.airflowPodAnnotations | nindent 8 }}
{{- end }}
{{- if .Values.scheduler.podAnnotations }}
jedcunningham marked this conversation as resolved.
Show resolved Hide resolved
{{- toYaml .Values.scheduler.podAnnotations | nindent 8 }}
{{- end }}
spec:
nodeSelector:
{{ toYaml $nodeSelector | indent 8 }}
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 @@ -67,6 +67,9 @@ spec:
{{- if .Values.airflowPodAnnotations }}
{{- toYaml .Values.airflowPodAnnotations | nindent 8 }}
{{- end }}
{{- if .Values.triggerer.podAnnotations }}
{{- toYaml .Values.triggerer.podAnnotations | nindent 8 }}
{{- end }}
spec:
nodeSelector:
{{- toYaml $nodeSelector | nindent 8 }}
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 @@ -81,6 +81,9 @@ spec:
{{- if .Values.airflowPodAnnotations }}
{{- toYaml .Values.airflowPodAnnotations | nindent 8 }}
{{- end }}
{{- if .Values.webserver.podAnnotations }}
{{- toYaml .Values.webserver.podAnnotations | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "webserver.serviceAccountName" . }}
nodeSelector:
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 @@ -77,6 +77,9 @@ spec:
{{- if .Values.airflowPodAnnotations }}
{{- toYaml .Values.airflowPodAnnotations | nindent 8 }}
{{- end }}
{{- if .Values.workers.podAnnotations }}
{{- toYaml .Values.workers.podAnnotations | nindent 8 }}
{{- end }}
spec:
nodeSelector:
{{ toYaml $nodeSelector | indent 8 }}
Expand Down
8 changes: 6 additions & 2 deletions chart/tests/test_airflow_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,20 @@ def test_annotations(self):
release_name = "TEST-BASIC"
k8s_objects = render_chart(
name=release_name,
values={"airflowPodAnnotations": {"test-annotation/safe-to-evict": "true"}},
values={
"airflowVersion": "2.2.0", # Needed for triggerer to be enabled.
"airflowPodAnnotations": {"test-annotation/safe-to-evict": "true"},
},
show_only=[
"templates/scheduler/scheduler-deployment.yaml",
"templates/workers/worker-deployment.yaml",
"templates/webserver/webserver-deployment.yaml",
"templates/flower/flower-deployment.yaml",
"templates/triggerer/triggerer-deployment.yaml",
],
)

assert 4 == len(k8s_objects)
assert 5 == len(k8s_objects)

for k8s_object in k8s_objects:
annotations = k8s_object["spec"]["template"]["metadata"]["annotations"]
Expand Down
Loading