This is an automated email from the ASF dual-hosted git repository.

jscheffl pushed a commit to branch chart/v1-2x-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/chart/v1-2x-test by this push:
     new 967452b4ee0 [chart/v1-2x-test] Add workers.celery.extraPorts (#61919) 
(#64408)
967452b4ee0 is described below

commit 967452b4ee0ba5e243865d0f0a090f95cdb96f8d
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Sun Mar 29 16:09:46 2026 +0200

    [chart/v1-2x-test] Add workers.celery.extraPorts (#61919) (#64408)
    
    * Add workers.celery.extraPorts
    
    * Add newsfragment
    (cherry picked from commit f0d5b38b3d597f26eb0029bd884d255c2b1419b4)
    
    Co-authored-by: Przemysław Mirowski <[email protected]>
---
 chart/newsfragments/61919.significant.rst           |  1 +
 chart/templates/NOTES.txt                           |  8 ++++++++
 chart/values.schema.json                            | 10 +++++++++-
 chart/values.yaml                                   |  4 ++++
 .../tests/helm_tests/airflow_core/test_worker.py    | 21 +++++++++++++++++++++
 .../helm_tests/airflow_core/test_worker_sets.py     | 16 ++++++++++++++++
 6 files changed, 59 insertions(+), 1 deletion(-)

diff --git a/chart/newsfragments/61919.significant.rst 
b/chart/newsfragments/61919.significant.rst
new file mode 100644
index 00000000000..996df952b27
--- /dev/null
+++ b/chart/newsfragments/61919.significant.rst
@@ -0,0 +1 @@
+``workers.extraPorts`` section is now deprecated in favor of 
``workers.celery.extraPorts``. Please update your configuration accordingly.
diff --git a/chart/templates/NOTES.txt b/chart/templates/NOTES.txt
index 55852c89ecf..989d6dfb05f 100644
--- a/chart/templates/NOTES.txt
+++ b/chart/templates/NOTES.txt
@@ -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:
diff --git a/chart/values.schema.json b/chart/values.schema.json
index b724734ce2d..c6b06707539 100644
--- a/chart/values.schema.json
+++ b/chart/values.schema.json
@@ -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": {
@@ -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",
diff --git a/chart/values.yaml b/chart/values.yaml
index f135ea8eb29..b10b06fca89 100644
--- a/chart/values.yaml
+++ b/chart/values.yaml
@@ -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
@@ -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: {}
 
diff --git a/helm-tests/tests/helm_tests/airflow_core/test_worker.py 
b/helm-tests/tests/helm_tests/airflow_core/test_worker.py
index 0aa34273eed..d08df7c07da 100644
--- a/helm-tests/tests/helm_tests/airflow_core/test_worker.py
+++ b/helm-tests/tests/helm_tests/airflow_core/test_worker.py
@@ -1920,6 +1920,27 @@ class TestWorker:
 
         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."""
diff --git a/helm-tests/tests/helm_tests/airflow_core/test_worker_sets.py 
b/helm-tests/tests/helm_tests/airflow_core/test_worker_sets.py
index d5f3180b22b..ef6dcb39f65 100644
--- a/helm-tests/tests/helm_tests/airflow_core/test_worker_sets.py
+++ b/helm-tests/tests/helm_tests/airflow_core/test_worker_sets.py
@@ -2430,6 +2430,13 @@ class TestWorkerSets:
                 "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": {
@@ -2439,6 +2446,15 @@ class TestWorkerSets:
                     ],
                 },
             },
+            {
+                "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):

Reply via email to