]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/rook: Explicitly enable prometheus module 68029/head
authorDavid Galloway <david.galloway@ibm.com>
Fri, 27 Mar 2026 16:22:44 +0000 (12:22 -0400)
committerDavid Galloway <david.galloway@ibm.com>
Fri, 27 Mar 2026 16:36:34 +0000 (12:36 -0400)
Signed-off-by: David Galloway <david.galloway@ibm.com>
src/pybind/mgr/rook/ci/scripts/bootstrap-rook-cluster.sh

index a2fab9608e31d35b41027f804df150a840dd3ae0..5b0dfb18d100e87d53e05ac30f14f806438da061 100755 (executable)
@@ -207,10 +207,18 @@ enable_monitoring() {
     $KUBECTL wait --for=condition=ready pod -l app.kubernetes.io/name=prometheus \
         -n rook-ceph --timeout=120s
 
-    # Verify ceph mgr prometheus module is actually serving on port 9283
+    # If the ceph mgr prometheus module is not yet serving on port 9283, enable
+    # it explicitly. We check first to avoid restarting an already-running
+    # instance, which would trigger a port 9283 conflict.
     local mgr_pod
     mgr_pod=$($KUBECTL -n rook-ceph get pods -l app=rook-ceph-mgr \
         -o jsonpath='{.items[0].metadata.name}')
+    if ! $KUBECTL -n rook-ceph exec "$mgr_pod" -- \
+            curl -sf http://localhost:9283/metrics 2>/dev/null | grep -q 'ceph_health_status'; then
+        echo "ceph mgr prometheus module not yet serving, enabling it..."
+        $KUBECTL -n rook-ceph exec deploy/rook-ceph-tools -- ceph mgr module enable prometheus
+    fi
+
     local attempts=0
     until $KUBECTL -n rook-ceph exec "$mgr_pod" -- \
         curl -sf http://localhost:9283/metrics | grep -q 'ceph_health_status'; do