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
1 change: 1 addition & 0 deletions chart/newsfragments/61919.significant.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``workers.extraPorts`` section is now deprecated in favor of ``workers.celery.extraPorts``. Please update your configuration accordingly.
8 changes: 8 additions & 0 deletions chart/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,14 @@ DEPRECATION WARNING:

{{- end }}

{{- if not (empty .Values.workers.extraPorts) }}

DEPRECATION WARNING:
`workers.extraPorts` has been renamed to `workers.celery.extraPorts`.
Please change your values as support for the old name will be dropped in a future release.

{{- end }}

{{- if not (empty .Values.webserver.defaultUser) }}

DEPRECATION WARNING:
Expand Down
10 changes: 9 additions & 1 deletion chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2309,7 +2309,7 @@
}
},
"extraPorts": {
"description": "Expose additional ports of Airflow Celery worker container.",
"description": "Expose additional ports of Airflow Celery worker container (deprecated, use `workers.celery.extraPorts` instead).",
"type": "array",
"default": [],
"items": {
Expand Down Expand Up @@ -3294,6 +3294,14 @@
],
"default": null
},
"extraPorts": {
"description": "Expose additional ports of Airflow Celery worker container.",
"type": "array",
"default": [],
"items": {
"$ref": "#/definitions/io.k8s.api.core.v1.ContainerPort"
}
},
"nodeSelector": {
"description": "Select certain nodes for Airflow Celery worker pods.",
"type": "object",
Expand Down
4 changes: 4 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1055,6 +1055,7 @@ workers:
# readOnly: true

# Expose additional ports of Airflow Celery workers. These can be used for additional metric collection.
# (deprecated, use workers.celery.extraPorts instead)
extraPorts: []

# Select certain nodes for Airflow Celery worker pods and pods created with pod-template-file
Expand Down Expand Up @@ -1383,6 +1384,9 @@ workers:
# This setting tells kubernetes that its ok to evict when it wants to scale a node down
safeToEvict: ~

# Expose additional ports of Airflow Celery workers. These can be used for additional metric collection.
extraPorts: []

# Select certain nodes for Airflow Celery worker pods
nodeSelector: {}

Expand Down
21 changes: 21 additions & 0 deletions helm-tests/tests/helm_tests/airflow_core/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1920,6 +1920,27 @@ def test_termination_grace_period(self, workers_values):

assert jmespath.search("spec.template.spec.terminationGracePeriodSeconds", docs[0]) == 5

@pytest.mark.parametrize(
"workers_values",
[
{"extraPorts": [{"name": "test-extra-port", "containerPort": 10}]},
{"celery": {"extraPorts": [{"name": "test-extra-port", "containerPort": 10}]}},
{
"extraPorts": [{"name": "test", "containerPort": 1}],
"celery": {"extraPorts": [{"name": "test-extra-port", "containerPort": 10}]},
},
],
)
def test_overwrite_extra_ports(self, workers_values):
docs = render_chart(
values={"workers": workers_values},
show_only=["templates/workers/worker-deployment.yaml"],
)

assert jmespath.search("spec.template.spec.containers[0].ports[:-1]", docs[0]) == [
{"name": "test-extra-port", "containerPort": 10}
]


class TestWorkerLogGroomer(LogGroomerTestBase):
"""Worker groomer."""
Expand Down
16 changes: 16 additions & 0 deletions helm-tests/tests/helm_tests/airflow_core/test_worker_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2430,6 +2430,13 @@ def test_overwrite_extra_volume_mounts(self, workers_values):
"extraPorts": [{"name": "test-extra-port", "containerPort": 10}],
"celery": {"enableDefault": False, "sets": [{"name": "set1"}]},
},
{
"celery": {
"extraPorts": [{"name": "test-extra-port", "containerPort": 10}],
"enableDefault": False,
"sets": [{"name": "set1"}],
},
},
{
"extraPorts": [{"name": "test", "containerPort": 1}],
"celery": {
Expand All @@ -2439,6 +2446,15 @@ def test_overwrite_extra_volume_mounts(self, workers_values):
],
},
},
{
"celery": {
"extraPorts": [{"name": "test", "containerPort": 1}],
"enableDefault": False,
"sets": [
{"name": "set1", "extraPorts": [{"name": "test-extra-port", "containerPort": 10}]}
],
},
},
],
)
def test_overwrite_extra_ports(self, workers_values):
Expand Down