From: Sage Weil Date: Fri, 20 Mar 2020 21:11:24 +0000 (-0400) Subject: mgr/rook: list rgw services X-Git-Tag: v15.2.0~3^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=818b8583c84b9aabdd8a9b5d661608904c60ae67;p=ceph.git mgr/rook: list rgw services Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/rook/module.py b/src/pybind/mgr/rook/module.py index d1fad01e02b34..cabc5080a790a 100644 --- a/src/pybind/mgr/rook/module.py +++ b/src/pybind/mgr/rook/module.py @@ -320,7 +320,36 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator): last_refresh=now, ) - # FIXME: CephObjectstores + # CephObjectstores + all_zones = self.rook_cluster.rook_api_get( + "cephobjectstores/") + self.log.debug('CephObjectstores %s' % all_zones) + for zone in all_zones.get('items', []): + rgw_realm = zone['metadata']['name'] + rgw_zone = rgw_realm + svc = 'rgw.' + rgw_realm + '.' + rgw_zone + if svc in spec: + continue + active = zone['spec']['gateway']['instances']; + if 'securePort' in zone['spec']['gateway']: + ssl = True + port = zone['spec']['gateway']['securePort'] + else: + ssl = False + port = zone['spec']['gateway']['port'] or 80 + spec[svc] = orchestrator.ServiceDescription( + service_name=svc, + spec=RGWSpec( + rgw_realm=rgw_realm, + rgw_zone=rgw_zone, + ssl=ssl, + rgw_frontend_port=port, + placement=PlacementSpec(count=active), + ), + size=active, + container_image_name=image_name, + last_refresh=now, + ) for dd in self._list_daemons(): if dd.service_name() not in spec: diff --git a/src/pybind/mgr/rook/rook_cluster.py b/src/pybind/mgr/rook/rook_cluster.py index 2686c61e9df68..f177c1668e804 100644 --- a/src/pybind/mgr/rook/rook_cluster.py +++ b/src/pybind/mgr/rook/rook_cluster.py @@ -335,6 +335,9 @@ class RookCluster(object): 'phase': d['status']['phase'], 'container_image_name': image_name, 'refreshed': refreshed, + # these may get set below... + 'started': None, + 'created': None, } # note: we want UTC but no tzinfo