]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: use ip_hash to enforce the same prometheues upstream 62166/head
authorRedouane Kachach <rkachach@ibm.com>
Fri, 7 Mar 2025 05:54:24 +0000 (06:54 +0100)
committerRedouane Kachach <rkachach@ibm.com>
Fri, 7 Mar 2025 05:57:02 +0000 (06:57 +0100)
Implemented ip_hash in Nginx to ensure consistent upstream selection
for Prometheus in HA scenarios. This helps maintain query consistency
in Grafana and reduces gaps caused by Prometheus instance failovers.

Fixes: https://tracker.ceph.com/issues/70352?
Signed-off-by: Redouane Kachach <rkachach@ibm.com>
src/pybind/mgr/cephadm/templates/services/mgmt-gateway/nginx.conf.j2
src/pybind/mgr/cephadm/tests/test_services.py

index 14af0fd48ca8de5c04fb680dd90dfef1ee243914..035e6f9e68c84e92fe112d56a706c2345f9efd3b 100644 (file)
@@ -52,6 +52,7 @@ http {
 
 {% if prometheus_endpoints %}
     upstream prometheus_servers {
+     ip_hash;
      {% for ep in prometheus_endpoints %}
      server {{ ep }};
      {% endfor %}
index ecadc7a0049a1eee54bba5acd474eab45ee03c06..08e861652a206780d17d897c012379e271638ff0 100644 (file)
@@ -4004,6 +4004,7 @@ class TestMgmtGateway:
                                              }
 
                                              upstream prometheus_servers {
+                                              ip_hash;
                                               server 192.168.100.100:9095;
                                               server 192.168.100.101:9095;
                                              }
@@ -4256,6 +4257,7 @@ class TestMgmtGateway:
                                              }
 
                                              upstream prometheus_servers {
+                                              ip_hash;
                                               server 192.168.100.100:9095;
                                               server 192.168.100.101:9095;
                                              }