]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/suites/rados/cephadm: deploy prometheus.a 33073/head
authorSage Weil <sage@redhat.com>
Thu, 13 Feb 2020 19:44:08 +0000 (13:44 -0600)
committerSage Weil <sage@redhat.com>
Thu, 13 Feb 2020 19:59:36 +0000 (13:59 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
qa/clusters/fixed-2.yaml
qa/suites/rados/cephadm/smoke/fixed-2.yaml
qa/tasks/cephadm.py

index 5d5fcca9c950fd9b3adafbf8d3d1910e4317c2cd..ca92a8ff1881008331b6283ff0ff363fd72c921b 100644 (file)
@@ -1,6 +1,6 @@
 roles:
 - [mon.a, mon.c, mgr.y, osd.0, osd.1, osd.2, osd.3, client.0]
-- [mon.b, mgr.x, osd.4, osd.5, osd.6, osd.7, client.1]
+- [mon.b, mgr.x, osd.4, osd.5, osd.6, osd.7, client.1, prometheus.a]
 openstack:
 - volumes: # attached to each instance
     count: 4
index 5d5fcca9c950fd9b3adafbf8d3d1910e4317c2cd..ca92a8ff1881008331b6283ff0ff363fd72c921b 100644 (file)
@@ -1,6 +1,6 @@
 roles:
 - [mon.a, mon.c, mgr.y, osd.0, osd.1, osd.2, osd.3, client.0]
-- [mon.b, mgr.x, osd.4, osd.5, osd.6, osd.7, client.1]
+- [mon.b, mgr.x, osd.4, osd.5, osd.6, osd.7, client.1, prometheus.a]
 openstack:
 - volumes: # attached to each instance
     count: 4
index b97edb52e0b2237bbe68d6f71e02be0138b497d7..0b19dfeba17e1ec371826ce2453a16f7c4f37f02 100644 (file)
@@ -640,6 +640,41 @@ def ceph_mdss(ctx, config):
 
     yield
 
+@contextlib.contextmanager
+def ceph_prometheus(ctx, config):
+    """
+    Deploy prometheus
+    """
+    cluster_name = config['cluster']
+    fsid = ctx.ceph[cluster_name].fsid
+
+    nodes = []
+    daemons = {}
+    for remote, roles in ctx.cluster.remotes.items():
+        for role in [r for r in roles
+                    if teuthology.is_type('prometheus', cluster_name)(r)]:
+            c_, _, id_ = teuthology.split_role(role)
+            log.info('Adding %s on %s' % (role, remote.shortname))
+            nodes.append(remote.shortname + '=' + id_)
+            daemons[role] = (remote, id_)
+    if nodes:
+        _shell(ctx, cluster_name, remote, [
+            'ceph', 'orch', 'apply', 'prometheus',
+            str(len(nodes))] + nodes
+        )
+    for role, i in daemons.items():
+        remote, id_ = i
+        ctx.daemons.register_daemon(
+            remote, 'prometheus', id_,
+            cluster=cluster_name,
+            fsid=fsid,
+            logger=log.getChild(role),
+            wait=False,
+            started=True,
+        )
+
+    yield
+
 @contextlib.contextmanager
 def ceph_clients(ctx, config):
     cluster_name = config['cluster']
@@ -954,6 +989,7 @@ def task(ctx, config):
             lambda: ceph_mgrs(ctx=ctx, config=config),
             lambda: ceph_osds(ctx=ctx, config=config),
             lambda: ceph_mdss(ctx=ctx, config=config),
+            lambda: ceph_prometheus(ctx=ctx, config=config),
             lambda: ceph_clients(ctx=ctx, config=config),
             lambda: distribute_config_and_admin_keyring(ctx=ctx, config=config),
     ):