From 4cf55bdb9e541a62c01286729125bf1e0a6178b2 Mon Sep 17 00:00:00 2001 From: Shweta Bhosale Date: Tue, 23 Sep 2025 22:03:05 +0530 Subject: [PATCH] mgr/cephadm: Fixed stats frontend to always enable health url Fixes: https://tracker.ceph.com/issues/71707 Signed-off-by: Shweta Bhosale --- .../mgr/cephadm/templates/services/ingress/haproxy.cfg.j2 | 4 ++-- src/pybind/mgr/cephadm/tests/test_services.py | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/cephadm/templates/services/ingress/haproxy.cfg.j2 b/src/pybind/mgr/cephadm/templates/services/ingress/haproxy.cfg.j2 index 943ed969ad7..997620b369c 100644 --- a/src/pybind/mgr/cephadm/templates/services/ingress/haproxy.cfg.j2 +++ b/src/pybind/mgr/cephadm/templates/services/ingress/haproxy.cfg.j2 @@ -45,7 +45,6 @@ defaults {% endif %} maxconn 8000 -{% if spec.enable_stats %} frontend stats mode http {% for monitor_ip in monitor_ips %} @@ -55,14 +54,15 @@ frontend stats bind {{ monitor_ip }}:{{ monitor_port }} {% endif %} {% endfor %} +{% if spec.enable_stats %} stats enable stats uri /stats stats refresh 10s stats auth {{ user }}:{{ password }} http-request use-service prometheus-exporter if { path /metrics } +{% endif %} monitor-uri /health -{% endif %} frontend frontend {% if spec.ssl or spec.ssl_cert %} bind {{ ip }}:{{ frontend_port }} ssl crt /var/lib/haproxy/haproxy.pem {{ v4v6_flag }} diff --git a/src/pybind/mgr/cephadm/tests/test_services.py b/src/pybind/mgr/cephadm/tests/test_services.py index 902be51286e..f5eb56d7530 100644 --- a/src/pybind/mgr/cephadm/tests/test_services.py +++ b/src/pybind/mgr/cephadm/tests/test_services.py @@ -4001,6 +4001,11 @@ class TestNFS: 'timeout server 30s\n ' 'timeout check 5s\n ' 'maxconn 8000\n' + '\nfrontend stats\n' + ' mode http\n' + ' bind 1.2.3.4:8999\n' + ' bind 1.2.3.7:8999\n' + ' monitor-uri /health\n' '\nfrontend frontend\n ' 'bind 1.2.3.4:8089\n ' 'default_backend backend\n\n' -- 2.47.3