From: Shweta Bhosale Date: Tue, 23 Sep 2025 16:33:05 +0000 (+0530) Subject: mgr/cephadm: Fixed stats frontend to always enable health url X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7f007fe75abbc1be0ff7c634b7e4e85518a1a9f5;p=ceph-ci.git mgr/cephadm: Fixed stats frontend to always enable health url Fixes: https://tracker.ceph.com/issues/71707 Signed-off-by: Shweta Bhosale (cherry picked from commit 4cf55bdb9e541a62c01286729125bf1e0a6178b2) Resolves: rhbz#2353516 --- 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 57083989396..6e6c076dac6 100644 --- a/src/pybind/mgr/cephadm/templates/services/ingress/haproxy.cfg.j2 +++ b/src/pybind/mgr/cephadm/templates/services/ingress/haproxy.cfg.j2 @@ -49,7 +49,6 @@ defaults {% endif %} maxconn 8000 -{% if spec.enable_stats %} frontend stats mode http {% for monitor_ip in monitor_ips %} @@ -59,14 +58,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 6a628aef120..c22e38ca518 100644 --- a/src/pybind/mgr/cephadm/tests/test_services.py +++ b/src/pybind/mgr/cephadm/tests/test_services.py @@ -4154,6 +4154,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'