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

jscheffl pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 8ab288a4d50 Fix Liveness / Readiness / Startup probe path for Airflow 
3.x #58129 (#58734)
8ab288a4d50 is described below

commit 8ab288a4d507ad54a62ba4ce4f3638142102bc42
Author: jvoravong <[email protected]>
AuthorDate: Tue Dec 2 15:38:11 2025 -0700

    Fix Liveness / Readiness / Startup probe path for Airflow 3.x #58129 
(#58734)
    
    * Fix Liveness / Readiness / Startup probe path for Airflow 3.x #58129
    
    * Update docker-tests/tests/docker_tests/test_docker_compose_quick_start.py
    
    Co-authored-by: Jason(Zhe-You) Liu 
<[email protected]>
    
    * Fix ruff formatting
    
    * Update docker-tests/tests/docker_tests/test_docker_compose_quick_start.py
    
    * Update docker-tests/tests/docker_tests/test_docker_compose_quick_start.py
    
    Co-authored-by: Jens Scheffler <[email protected]>
    
    ---------
    
    Co-authored-by: Jason(Zhe-You) Liu 
<[email protected]>
    Co-authored-by: Jens Scheffler <[email protected]>
---
 airflow-core/docs/howto/docker-compose/docker-compose.yaml       | 2 +-
 airflow-core/docs/howto/run-with-self-signed-certificate.rst     | 2 +-
 airflow-e2e-tests/tests/airflow_e2e_tests/conftest.py            | 2 +-
 chart/templates/api-server/api-server-deployment.yaml            | 6 +++---
 .../tests/docker_tests/test_docker_compose_quick_start.py        | 4 ++++
 helm-tests/tests/helm_tests/airflow_core/test_api_server.py      | 9 +++++++++
 task-sdk-integration-tests/docker-compose.yaml                   | 2 +-
 7 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/airflow-core/docs/howto/docker-compose/docker-compose.yaml 
b/airflow-core/docs/howto/docker-compose/docker-compose.yaml
index 01b15bf9cb8..ed88c68b673 100644
--- a/airflow-core/docs/howto/docker-compose/docker-compose.yaml
+++ b/airflow-core/docs/howto/docker-compose/docker-compose.yaml
@@ -123,7 +123,7 @@ services:
     ports:
       - "8080:8080"
     healthcheck:
-      test: ["CMD", "curl", "--fail", "http://localhost:8080/api/v2/version";]
+      test: ["CMD", "curl", "--fail", 
"http://localhost:8080/api/v2/monitor/health";]
       interval: 30s
       timeout: 10s
       retries: 5
diff --git a/airflow-core/docs/howto/run-with-self-signed-certificate.rst 
b/airflow-core/docs/howto/run-with-self-signed-certificate.rst
index 53a8446d0f7..72d30180815 100644
--- a/airflow-core/docs/howto/run-with-self-signed-certificate.rst
+++ b/airflow-core/docs/howto/run-with-self-signed-certificate.rst
@@ -69,7 +69,7 @@ Alter the API Server health check to trust the certificate:
       - "8080:8080"
     healthcheck:
       # Add --cacert to trust certificate
-      test: ["CMD", "curl", "--fail", "--cacert", 
"${AIRFLOW_PROJ_DIR:-.}/config/cert.pem", 
"https://localhost:8080/api/v2/version";]
+      test: ["CMD", "curl", "--fail", "--cacert", 
"${AIRFLOW_PROJ_DIR:-.}/config/cert.pem", 
"https://localhost:8080/api/v2/monitor/health";]
 
 Running Airflow
 ===============
diff --git a/airflow-e2e-tests/tests/airflow_e2e_tests/conftest.py 
b/airflow-e2e-tests/tests/airflow_e2e_tests/conftest.py
index 2886ca58b86..b02e6d4f574 100644
--- a/airflow-e2e-tests/tests/airflow_e2e_tests/conftest.py
+++ b/airflow-e2e-tests/tests/airflow_e2e_tests/conftest.py
@@ -112,7 +112,7 @@ def spin_up_airflow_environment(tmp_path_factory):
 
         compose_instance.start()
 
-        
compose_instance.wait_for(f"http://{DOCKER_COMPOSE_HOST_PORT}/api/v2/version";)
+        
compose_instance.wait_for(f"http://{DOCKER_COMPOSE_HOST_PORT}/api/v2/monitor/health";)
         compose_instance.exec_in_container(
             command=["airflow", "dags", "reserialize"], 
service_name="airflow-dag-processor"
         )
diff --git a/chart/templates/api-server/api-server-deployment.yaml 
b/chart/templates/api-server/api-server-deployment.yaml
index 48647e99900..03bfe12c3d5 100644
--- a/chart/templates/api-server/api-server-deployment.yaml
+++ b/chart/templates/api-server/api-server-deployment.yaml
@@ -188,7 +188,7 @@ spec:
               containerPort: {{ .Values.ports.apiServer }}
           livenessProbe:
             httpGet:
-              path: /api/v2/version
+              path: /api/v2/monitor/health
               port: {{ .Values.ports.apiServer }}
               scheme: {{ .Values.apiServer.livenessProbe.scheme | default 
"http" }}
             initialDelaySeconds: {{ 
.Values.apiServer.livenessProbe.initialDelaySeconds }}
@@ -197,7 +197,7 @@ spec:
             periodSeconds: {{ .Values.apiServer.livenessProbe.periodSeconds }}
           readinessProbe:
             httpGet:
-              path: /api/v2/version
+              path: /api/v2/monitor/health
               port: {{ .Values.ports.apiServer }}
               scheme: {{ .Values.apiServer.readinessProbe.scheme | default 
"http" }}
             initialDelaySeconds: {{ 
.Values.apiServer.readinessProbe.initialDelaySeconds }}
@@ -206,7 +206,7 @@ spec:
             periodSeconds: {{ .Values.apiServer.readinessProbe.periodSeconds }}
           startupProbe:
             httpGet:
-              path: /api/v2/version
+              path: /api/v2/monitor/health
               port: {{ .Values.ports.apiServer }}
               scheme: {{ .Values.apiServer.startupProbe.scheme | default 
"http" }}
             initialDelaySeconds: {{ 
.Values.apiServer.startupProbe.initialDelaySeconds }}
diff --git a/docker-tests/tests/docker_tests/test_docker_compose_quick_start.py 
b/docker-tests/tests/docker_tests/test_docker_compose_quick_start.py
index 16a8280a46c..bfefd46fc4c 100644
--- a/docker-tests/tests/docker_tests/test_docker_compose_quick_start.py
+++ b/docker-tests/tests/docker_tests/test_docker_compose_quick_start.py
@@ -115,6 +115,10 @@ def 
test_trigger_dag_and_wait_for_result(default_docker_image, tmp_path_factory,
         # Before we proceed, let's make sure our DAG has been parsed
         compose.execute(service="airflow-dag-processor", command=["airflow", 
"dags", "reserialize"])
 
+        # Verify API server health endpoint is accessible and returns valid 
response
+        health_status = api_request("GET", 
path="monitor/health").get("metadatabase").get("status")
+        assert health_status == "healthy"
+
         api_request("PATCH", path=f"dags/{DAG_ID}", json={"is_paused": False})
         api_request(
             "POST",
diff --git a/helm-tests/tests/helm_tests/airflow_core/test_api_server.py 
b/helm-tests/tests/helm_tests/airflow_core/test_api_server.py
index 45e2ec831d1..377c4b97030 100644
--- a/helm-tests/tests/helm_tests/airflow_core/test_api_server.py
+++ b/helm-tests/tests/helm_tests/airflow_core/test_api_server.py
@@ -72,6 +72,15 @@ class TestAPIServerDeployment:
             "spec.template.spec.containers[0].startupProbe.httpGet.scheme", 
docs[0]
         )
 
+    def test_should_use_monitor_health_for_http_probes(self):
+        docs = 
render_chart(show_only=["templates/api-server/api-server-deployment.yaml"])
+
+        for probe in ("livenessProbe", "readinessProbe", "startupProbe"):
+            assert (
+                
jmespath.search(f"spec.template.spec.containers[0].{probe}.httpGet.path", 
docs[0])
+                == "/api/v2/monitor/health"
+            )
+
     def test_should_add_extra_containers(self):
         docs = render_chart(
             values={
diff --git a/task-sdk-integration-tests/docker-compose.yaml 
b/task-sdk-integration-tests/docker-compose.yaml
index e3b5e40f297..82143e98b5e 100644
--- a/task-sdk-integration-tests/docker-compose.yaml
+++ b/task-sdk-integration-tests/docker-compose.yaml
@@ -95,7 +95,7 @@ services:
     ports:
       - "8080:8080"
     healthcheck:
-      test: ["CMD", "curl", "--fail", "http://localhost:8080/api/v2/version";]
+      test: ["CMD", "curl", "--fail", 
"http://localhost:8080/api/v2/monitor/health";]
       interval: 30s
       timeout: 10s
       retries: 5

Reply via email to