Skip to content

Commit ad147f2

Browse files
author
Aashish Sharma
committed
mgr/cephadm: RGW service deployment defaults to 'default' realm/zonegroup/zone despite non-default spec in service
When we create an RGW service using the ceph orch apply command, the service is always deployed in the default realm, zonegroup, and zone, even if we specify a different realm, zonegroup, or zone in the service spec. This happens because certain configuration values, like rgw_realm, rgw_zonegroup, and rgw_zone, need to be set for the RGW instances before the daemons are deployed. Currently, these configurations are being applied after the RGW daemons are deployed, which requires a service restart to reflect the correct realm, zonegroup, and zone. Ideally, these configurations should be applied before the RGW daemons are deployed, so they are correctly placed in the desired realm, zonegroup, and zone from the start. Fixes: https://tracker.ceph.com/issues/68461 Signed-off-by: Aashish Sharma <[email protected]>
1 parent a291280 commit ad147f2

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

src/pybind/mgr/cephadm/module.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@ def __init__(self, *args: Any, **kwargs: Any):
764764
self.iscsi_service: IscsiService = cast(IscsiService, self.cephadm_services['iscsi'])
765765
self.nvmeof_service: NvmeofService = cast(NvmeofService, self.cephadm_services['nvmeof'])
766766
self.node_proxy_service: NodeProxy = cast(NodeProxy, self.cephadm_services['node-proxy'])
767+
self.rgw_service: RgwService = cast(RgwService, self.cephadm_services['rgw'])
767768

768769
self.scheduled_async_actions: List[Callable] = []
769770

src/pybind/mgr/cephadm/serve.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,10 @@ def update_progress() -> None:
950950
)
951951
continue
952952

953+
# set multisite config before deploying the rgw daemon
954+
if service_type == 'rgw':
955+
self.mgr.rgw_service.set_realm_zg_zone(cast(RGWSpec, spec))
956+
953957
# deploy new daemon
954958
daemon_id = slot.name
955959

src/pybind/mgr/cephadm/services/cephadmservice.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -984,10 +984,9 @@ class RgwService(CephService):
984984
def allow_colo(self) -> bool:
985985
return True
986986

987-
def config(self, spec: RGWSpec) -> None: # type: ignore
987+
def set_realm_zg_zone(self, spec: RGWSpec) -> None:
988988
assert self.TYPE == spec.service_type
989989

990-
# set rgw_realm rgw_zonegroup and rgw_zone, if present
991990
if spec.rgw_realm:
992991
ret, out, err = self.mgr.check_mon_command({
993992
'prefix': 'config set',
@@ -1010,6 +1009,12 @@ def config(self, spec: RGWSpec) -> None: # type: ignore
10101009
'value': spec.rgw_zone,
10111010
})
10121011

1012+
def config(self, spec: RGWSpec) -> None: # type: ignore
1013+
assert self.TYPE == spec.service_type
1014+
1015+
# set rgw_realm rgw_zonegroup and rgw_zone, if present
1016+
self.set_realm_zg_zone(spec)
1017+
10131018
if spec.generate_cert and not spec.rgw_frontend_ssl_certificate:
10141019
# generate a self-signed cert for the rgw service
10151020
cert, key = self.mgr.cert_mgr.ssl_certs.generate_root_cert(custom_san_list=spec.zonegroup_hostnames)

0 commit comments

Comments
 (0)