mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
qa/tasks/cephadm: deploy node-exporter
Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
97d73304ae
commit
e8520eba52
qa
@ -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, prometheus.a]
|
||||
- [mon.a, mon.c, mgr.y, osd.0, osd.1, osd.2, osd.3, client.0, node-exporter.a]
|
||||
- [mon.b, mgr.x, osd.4, osd.5, osd.6, osd.7, client.1, prometheus.a, node-exporter.b]
|
||||
openstack:
|
||||
- volumes: # attached to each instance
|
||||
count: 4
|
||||
|
@ -642,9 +642,9 @@ def ceph_mdss(ctx, config):
|
||||
yield
|
||||
|
||||
@contextlib.contextmanager
|
||||
def ceph_prometheus(ctx, config):
|
||||
def ceph_monitoring(daemon_type, ctx, config):
|
||||
"""
|
||||
Deploy prometheus
|
||||
Deploy prometheus, node-exporter, etc.
|
||||
"""
|
||||
cluster_name = config['cluster']
|
||||
fsid = ctx.ceph[cluster_name].fsid
|
||||
@ -653,20 +653,20 @@ def ceph_prometheus(ctx, config):
|
||||
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)]:
|
||||
if teuthology.is_type(daemon_type, 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',
|
||||
'ceph', 'orch', 'apply', daemon_type,
|
||||
str(len(nodes))] + nodes
|
||||
)
|
||||
for role, i in daemons.items():
|
||||
remote, id_ = i
|
||||
ctx.daemons.register_daemon(
|
||||
remote, 'prometheus', id_,
|
||||
remote, daemon_type, id_,
|
||||
cluster=cluster_name,
|
||||
fsid=fsid,
|
||||
logger=log.getChild(role),
|
||||
@ -1039,7 +1039,8 @@ def task(ctx, config):
|
||||
lambda: ceph_osds(ctx=ctx, config=config),
|
||||
lambda: ceph_mdss(ctx=ctx, config=config),
|
||||
lambda: ceph_rgw(ctx=ctx, config=config),
|
||||
lambda: ceph_prometheus(ctx=ctx, config=config),
|
||||
lambda: ceph_monitoring('prometheus', ctx=ctx, config=config),
|
||||
lambda: ceph_monitoring('node-exporter', ctx=ctx, config=config),
|
||||
lambda: ceph_clients(ctx=ctx, config=config),
|
||||
lambda: distribute_config_and_admin_keyring(ctx=ctx, config=config),
|
||||
):
|
||||
|
Loading…
Reference in New Issue
Block a user