Skip to content
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: 4 additions & 0 deletions chart/templates/dag-processor/dag-processor-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ metadata:
{{- with .Values.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.dagProcessor.annotations }}
annotations:
{{- toYaml .Values.dagProcessor.annotations | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.dagProcessor.replicas }}
{{- if $revisionHistoryLimit }}
Expand Down
4 changes: 4 additions & 0 deletions chart/templates/flower/flower-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ metadata:
{{- with .Values.labels }}
{{ toYaml . | indent 4 }}
{{- end }}
{{- if .Values.flower.annotations }}
annotations:
{{- toYaml .Values.flower.annotations | nindent 4 }}
{{- end }}
spec:
replicas: 1
{{- if $revisionHistoryLimit }}
Expand Down
4 changes: 4 additions & 0 deletions chart/templates/pgbouncer/pgbouncer-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ metadata:
{{- with .Values.labels }}
{{ toYaml . | indent 4 }}
{{- end }}
{{- if .Values.pgbouncer.annotations }}
annotations:
{{- toYaml .Values.pgbouncer.annotations | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.pgbouncer.replicas | default "1" }}
{{- if $revisionHistoryLimit }}
Expand Down
4 changes: 4 additions & 0 deletions chart/templates/scheduler/scheduler-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ metadata:
{{- with .Values.labels }}
{{ toYaml . | indent 4 }}
{{- end }}
{{- if .Values.scheduler.annotations }}
annotations:
{{- toYaml .Values.scheduler.annotations | nindent 4 }}
{{- end }}
spec:
{{- if $stateful }}
serviceName: {{ .Release.Name }}-scheduler
Expand Down
4 changes: 4 additions & 0 deletions chart/templates/triggerer/triggerer-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ metadata:
{{- with .Values.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.triggerer.annotations }}
annotations:
{{- toYaml .Values.triggerer.annotations | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.triggerer.replicas }}
{{- if $revisionHistoryLimit }}
Expand Down
4 changes: 4 additions & 0 deletions chart/templates/webserver/webserver-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ metadata:
{{- with .Values.labels }}
{{ toYaml . | indent 4 }}
{{- end }}
{{- if .Values.webserver.annotations }}
annotations:
{{- toYaml .Values.webserver.annotations | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.webserver.replicas }}
{{- if $revisionHistoryLimit }}
Expand Down
4 changes: 4 additions & 0 deletions chart/templates/workers/worker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ metadata:
{{- with .Values.labels }}
{{ toYaml . | indent 4 }}
{{- end }}
{{- if .Values.workers.annotations }}
annotations:
{{- toYaml .Values.workers.annotations | nindent 4 }}
{{- end }}
spec:
{{- if $persistence }}
serviceName: {{ .Release.Name }}-worker
Expand Down
56 changes: 56 additions & 0 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1558,6 +1558,14 @@
}
]
},
"annotations": {
"description": "Annotations to add to the worker deployment",
"type": "object",
"default": {},
"additionalProperties": {
"type": "string"
}
},
"podAnnotations": {
"description": "Annotations to add to the worker pods.",
"type": "object",
Expand Down Expand Up @@ -1949,6 +1957,14 @@
"$ref": "#/definitions/io.k8s.api.core.v1.TopologySpreadConstraint"
}
},
"annotations": {
"description": "Annotations to add to the scheduler deployment",
"type": "object",
"default": {},
"additionalProperties": {
"type": "string"
}
},
"podAnnotations": {
"description": "Annotations to add to the scheduler pods.",
"type": "object",
Expand Down Expand Up @@ -2325,6 +2341,14 @@
"type": "integer",
"default": 60
},
"annotations": {
"description": "Annotations to add to the triggerer deployment",
"type": "object",
"default": {},
"additionalProperties": {
"type": "string"
}
},
"podAnnotations": {
"description": "Annotations to add to the triggerer pods.",
"type": "object",
Expand Down Expand Up @@ -2642,6 +2666,14 @@
"type": "integer",
"default": 60
},
"annotations": {
"description": "Annotations to add to the dag processor deployment",
"type": "object",
"default": {},
"additionalProperties": {
"type": "string"
}
},
"podAnnotations": {
"description": "Annotations to add to the dag processor pods.",
"type": "object",
Expand Down Expand Up @@ -3602,6 +3634,14 @@
"$ref": "#/definitions/io.k8s.api.core.v1.TopologySpreadConstraint"
}
},
"annotations": {
"description": "Annotations to add to the webserver deployment",
"type": "object",
"default": {},
"additionalProperties": {
"type": "string"
}
},
"podAnnotations": {
"description": "Annotations to add to the webserver pods.",
"type": "object",
Expand Down Expand Up @@ -3981,6 +4021,14 @@
"$ref": "#/definitions/io.k8s.api.core.v1.TopologySpreadConstraint"
}
},
"annotations": {
"description": "Annotations to add to the flower deployment",
"type": "object",
"default": {},
"additionalProperties": {
"type": "string"
}
},
"podAnnotations": {
"description": "Annotations to add to the Flower pods.",
"type": "object",
Expand Down Expand Up @@ -4225,6 +4273,14 @@
"x-docsSection": "Common",
"default": false
},
"annotations": {
"description": "Annotations to add to the PgBouncer deployment",
"type": "object",
"default": {},
"additionalProperties": {
"type": "string"
}
},
"replicas": {
"description": "Number of PgBouncer replicas to run in Deployment.",
"type": "integer",
Expand Down
21 changes: 21 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,9 @@ workers:
# hostnames:
# - "test.hostname.two"

# annotations for the worker resource
annotations: {}

podAnnotations: {}

# Labels specific to workers objects and pods
Expand Down Expand Up @@ -718,6 +721,9 @@ scheduler:

priorityClassName: ~

# annotations for scheduler deployment
annotations: {}

podAnnotations: {}

# Labels specific to scheduler objects and pods
Expand Down Expand Up @@ -1030,6 +1036,9 @@ webserver:
tolerations: []
topologySpreadConstraints: []

# annotations for webserver deployment
annotations: {}

podAnnotations: {}

# Labels specific webserver app
Expand Down Expand Up @@ -1128,6 +1137,9 @@ triggerer:

priorityClassName: ~

# annotations for the triggerer deployment
annotations: {}

podAnnotations: {}

# Labels specific to triggerer objects and pods
Expand Down Expand Up @@ -1226,6 +1238,9 @@ dagProcessor:

priorityClassName: ~

# annotations for the dag processor deployment
annotations: {}

podAnnotations: {}

waitForMigrations:
Expand Down Expand Up @@ -1328,6 +1343,9 @@ flower:

priorityClassName: ~

# annotations for the flower deployment
annotations: {}

podAnnotations: {}

# Labels specific to flower objects and pods
Expand Down Expand Up @@ -1409,6 +1427,9 @@ pgbouncer:
auth_type: md5
auth_file: /etc/pgbouncer/users.txt

# annotations to be added to the PgBouncer deployment
annotations: {}

# Create ServiceAccount
serviceAccount:
# Specifies whether a ServiceAccount should be created
Expand Down
13 changes: 13 additions & 0 deletions tests/charts/test_dag_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,3 +536,16 @@ def test_airflow_local_settings(self):
}
assert volume_mount in jmespath.search("spec.template.spec.containers[0].volumeMounts", docs[0])
assert volume_mount in jmespath.search("spec.template.spec.initContainers[0].volumeMounts", docs[0])

def test_should_add_component_specific_annotations(self):
docs = render_chart(
values={
"dagProcessor": {
"enabled": True,
"annotations": {"test_annotation": "test_annotation_value"},
},
},
show_only=["templates/dag-processor/dag-processor-deployment.yaml"],
)
assert "annotations" in jmespath.search("metadata", docs[0])
assert jmespath.search("metadata.annotations", docs[0])["test_annotation"] == "test_annotation_value"
13 changes: 13 additions & 0 deletions tests/charts/test_flower.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,19 @@ def test_airflow_local_settings(self):
}
assert volume_mount in jmespath.search("spec.template.spec.containers[0].volumeMounts", docs[0])

def test_should_add_component_specific_annotations(self):
docs = render_chart(
values={
"flower": {
"enabled": True,
"annotations": {"test_annotation": "test_annotation_value"},
},
},
show_only=["templates/flower/flower-deployment.yaml"],
)
assert "annotations" in jmespath.search("metadata", docs[0])
assert jmespath.search("metadata.annotations", docs[0])["test_annotation"] == "test_annotation_value"


class TestFlowerService:
@pytest.mark.parametrize(
Expand Down
13 changes: 13 additions & 0 deletions tests/charts/test_pgbouncer.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,19 @@ def test_pgbouncer_replicas_are_configurable(self):
)
assert 2 == jmespath.search("spec.replicas", docs[0])

def test_should_add_component_specific_annotations(self):
docs = render_chart(
values={
"pgbouncer": {
"enabled": True,
"annotations": {"test_annotation": "test_annotation_value"},
},
},
show_only=["templates/pgbouncer/pgbouncer-deployment.yaml"],
)
assert "annotations" in jmespath.search("metadata", docs[0])
assert jmespath.search("metadata.annotations", docs[0])["test_annotation"] == "test_annotation_value"


class TestPgbouncerConfig:
def test_config_not_created_by_default(self):
Expand Down
12 changes: 12 additions & 0 deletions tests/charts/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,18 @@ def test_scheduler_deployment_has_executor_label(self, executor):
assert 1 == len(docs)
assert executor == docs[0]["metadata"]["labels"].get("executor")

def test_should_add_component_specific_annotations(self):
docs = render_chart(
values={
"scheduler": {
"annotations": {"test_annotation": "test_annotation_value"},
},
},
show_only=["templates/scheduler/scheduler-deployment.yaml"],
)
assert "annotations" in jmespath.search("metadata", docs[0])
assert jmespath.search("metadata.annotations", docs[0])["test_annotation"] == "test_annotation_value"


class TestSchedulerNetworkPolicy:
def test_should_add_component_specific_labels(self):
Expand Down
12 changes: 12 additions & 0 deletions tests/charts/test_triggerer.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,18 @@ def test_airflow_local_settings(self):
assert volume_mount in jmespath.search("spec.template.spec.containers[0].volumeMounts", docs[0])
assert volume_mount in jmespath.search("spec.template.spec.initContainers[0].volumeMounts", docs[0])

def test_should_add_component_specific_annotations(self):
docs = render_chart(
values={
"triggerer": {
"annotations": {"test_annotation": "test_annotation_value"},
},
},
show_only=["templates/triggerer/triggerer-deployment.yaml"],
)
assert "annotations" in jmespath.search("metadata", docs[0])
assert jmespath.search("metadata.annotations", docs[0])["test_annotation"] == "test_annotation_value"


class TestTriggererServiceAccount:
def test_should_add_component_specific_labels(self):
Expand Down
12 changes: 12 additions & 0 deletions tests/charts/test_webserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,18 @@ def test_dags_persistence_volume_no_sidecar(self, dags_values, expected_claim_na
assert 1 == len(jmespath.search("spec.template.spec.containers", docs[0]))
assert 1 == len(jmespath.search("spec.template.spec.initContainers", docs[0]))

def test_should_add_component_specific_annotations(self):
docs = render_chart(
values={
"webserver": {
"annotations": {"test_annotation": "test_annotation_value"},
},
},
show_only=["templates/webserver/webserver-deployment.yaml"],
)
assert "annotations" in jmespath.search("metadata", docs[0])
assert jmespath.search("metadata.annotations", docs[0])["test_annotation"] == "test_annotation_value"


class TestWebserverService:
def test_default_service(self):
Expand Down
12 changes: 12 additions & 0 deletions tests/charts/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,18 @@ def test_persistence_volume_annotations(self):
)
assert {"foo": "bar"} == jmespath.search("spec.volumeClaimTemplates[0].metadata.annotations", docs[0])

def test_should_add_component_specific_annotations(self):
docs = render_chart(
values={
"workers": {
"annotations": {"test_annotation": "test_annotation_value"},
},
},
show_only=["templates/workers/worker-deployment.yaml"],
)
assert "annotations" in jmespath.search("metadata", docs[0])
assert jmespath.search("metadata.annotations", docs[0])["test_annotation"] == "test_annotation_value"


class TestWorkerKedaAutoScaler:
def test_should_add_component_specific_labels(self):
Expand Down