]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Addressing comments from the last review
authorRedouane Kachach <rkachach@redhat.com>
Wed, 19 Oct 2022 08:42:20 +0000 (10:42 +0200)
committerAdam King <adking@redhat.com>
Wed, 5 Apr 2023 17:32:07 +0000 (13:32 -0400)
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
(cherry picked from commit dcde3df9390925b2fe03e95d51c4c910f967e0d6)

doc/mgr/rgw.rst
src/pybind/mgr/cephadm/serve.py
src/pybind/mgr/rgw/module.py
src/python-common/ceph/deployment/service_spec.py
src/python-common/ceph/rgw/rgwam_core.py

index 7436833ba7525df87120da9e712f9a5b035ce610..dc280b06de50aed45fca30dfc61b95199160e54a 100644 (file)
@@ -51,6 +51,16 @@ Following is an example of RGW mutlisite spec file:
           the user can provide any orchestration supported rgw parameters including advanced
           configuration features such as SSL certificates etc.
 
+Users can also specify custom zone endpoints in the spec (or through the cmd line). In this case, no
+cephadm daemons will be launched. Following is an example RGW spec file with zone endpoints:
+
+.. code-block:: yaml
+
+  rgw_realm: myrealm
+  rgw_zonegroup: myzonegroup
+  rgw_zone: myzone
+  zone_endpoints: http://<rgw_host1>:<rgw_port1>, http://<rgw_host2>:<rgw_port2>
+
 
 Realm Credentials Token
 -----------------------
index 2748739bd4e62bce4a314f555b9ac64cf931e135..7e2f9aa069142149a58f409d884d9b7a5b67f0c4 100644 (file)
@@ -580,7 +580,7 @@ class CephadmServe:
             'zonegroup_name': rgw_spec.rgw_zonegroup,
             'zone_name': rgw_spec.rgw_zone,
             'realm_token': rgw_spec.rgw_realm_token,
-            'endpoints': ep,
+            'zone_endpoints': ep,
         }
         self.log.debug(f'rgw cmd: {zone_update_cmd}')
         rc, out, err = self.mgr.mon_command(zone_update_cmd)
index d74426eeb6a0c9e3e11c4d19f3a62030c019df2b..74ac8a22b2acccc3b223b13119375e4e15c470a6 100644 (file)
@@ -130,7 +130,7 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
                                  zone_name: Optional[str] = None,
                                  port: Optional[int] = None,
                                  placement: Optional[str] = None,
-                                 endpoints: Optional[str] = None,
+                                 zone_endpoints: Optional[str] = None,
                                  start_radosgw: Optional[bool] = True,
                                  inbuf: Optional[str] = None):
         """Bootstrap new rgw realm, zonegroup, and zone"""
@@ -147,7 +147,7 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
                                  rgw_zone=zone_name,
                                  rgw_frontend_port=port,
                                  placement=placement_spec,
-                                 endpoints=endpoints)]
+                                 zone_endpoints=zone_endpoints)]
         else:
             err_msg = 'Invalid arguments: either pass a spec with -i or provide the realm, zonegroup and zone.'
             return HandleCommandResult(retval=-errno.EINVAL, stdout='', stderr=err_msg)
@@ -238,12 +238,12 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
         return HandleCommandResult(retval=0, stdout=json.dumps(realms_info, indent=4), stderr='')
 
     @CLICommand('rgw zone modify', perm='rw')
-    def update_zone_info(self, realm_name: str, zonegroup_name: str, zone_name: str, realm_token: str, endpoints: List[str]):
+    def update_zone_info(self, realm_name: str, zonegroup_name: str, zone_name: str, realm_token: str, zone_endpoints: List[str]):
         try:
             retval, out, err = RGWAM(self.env).zone_modify(realm_name,
                                                            zonegroup_name,
                                                            zone_name,
-                                                           endpoints,
+                                                           zone_endpoints,
                                                            realm_token)
             return (retval, 'Zone updated successfully', '')
         except RGWAMException as e:
@@ -258,7 +258,7 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
                              port: Optional[int] = None,
                              placement: Optional[str] = None,
                              start_radosgw: Optional[bool] = True,
-                             endpoints: Optional[str] = None,
+                             zone_endpoints: Optional[str] = None,
                              inbuf: Optional[str] = None):
         """Bootstrap new rgw zone that syncs with zone on another cluster in the same realm"""
 
@@ -275,7 +275,7 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
                                  rgw_realm_token=realm_token,
                                  rgw_frontend_port=port,
                                  placement=placement_spec,
-                                 endpoints=endpoints)]
+                                 zone_endpoints=zone_endpoints)]
         else:
             err_msg = 'Invalid arguments: either pass a spec with -i or provide the zone_name and realm_token.'
             return HandleCommandResult(retval=-errno.EINVAL, stdout='', stderr=err_msg)
index a025b91461cbd999cfa0303fa0ce4b9e76aa40f4..7f5f2fee381b083e32d00de5b23e07fb2aa88613 100644 (file)
@@ -877,7 +877,7 @@ class RGWSpec(ServiceSpec):
                  custom_configs: Optional[List[CustomConfig]] = None,
                  rgw_realm_token: Optional[str] = None,
                  update_endpoints: Optional[bool] = False,
-                 endpoints: Optional[str] = None  # commad separated endpoints list
+                 zone_endpoints: Optional[str] = None  # commad separated endpoints list
                  ):
         assert service_type == 'rgw', service_type
 
@@ -914,7 +914,7 @@ class RGWSpec(ServiceSpec):
         self.ssl = ssl
         self.rgw_realm_token = rgw_realm_token
         self.update_endpoints = update_endpoints
-        self.endpoints = endpoints
+        self.zone_endpoints = zone_endpoints
 
     def get_port_start(self) -> List[int]:
         return [self.get_port()]
index 8506328ae0df316689633fa4ca23a503e5c3c674..e55e0ff14b4c19343f17a9236165c3b7f72bb93e 100644 (file)
@@ -542,10 +542,10 @@ class RGWAM:
         access_key = rgw_acces_key.access_key if rgw_acces_key else ''
         secret = rgw_acces_key.secret_key if rgw_acces_key else ''
         self.zone_op().modify(zone, zonegroup, None,
-                              access_key, secret, endpoints=rgw_spec.endpoints)
+                              access_key, secret, endpoints=rgw_spec.zone_endpoints)
         self.update_period(realm, zonegroup)
 
-        if start_radosgw and rgw_spec.endpoints is None:
+        if start_radosgw and rgw_spec.zone_endpoints is None:
             # Instruct the orchestrator to start RGW daemons, asynchronically, this will
             # call back the rgw module to update the master zone with the corresponding endpoints
             realm_token = RealmToken(realm_name,