From c490acd1281413e399c5d09a5d9594ee8f9357b0 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 10 Mar 2021 17:51:49 -0500 Subject: [PATCH] mgr/cephadm: add support for rgw_frontend_type (beast or civetweb) Previously we were assuming beast. Signed-off-by: Sage Weil --- .../mgr/cephadm/services/cephadmservice.py | 20 +++++++++++++------ .../ceph/deployment/service_spec.py | 2 ++ .../ceph/tests/test_service_spec.py | 1 + 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/pybind/mgr/cephadm/services/cephadmservice.py b/src/pybind/mgr/cephadm/services/cephadmservice.py index 46062479973..31dea4fdc0f 100644 --- a/src/pybind/mgr/cephadm/services/cephadmservice.py +++ b/src/pybind/mgr/cephadm/services/cephadmservice.py @@ -732,12 +732,20 @@ class RgwService(CephService): # configure frontend args = [] - if spec.ssl: - args.append(f"ssl_port={daemon_spec.ports[0]}") - args.append(f"ssl_certificate=config://rgw/cert/{spec.service_name()}.crt") - else: - args.append(f"port={daemon_spec.ports[0]}") - frontend = f'beast {" ".join(args)}' + ftype = spec.rgw_frontend_type or "beast" + if ftype == 'beast': + if spec.ssl: + args.append(f"ssl_port={daemon_spec.ports[0]}") + args.append(f"ssl_certificate=config://rgw/cert/{spec.service_name()}.crt") + else: + args.append(f"port={daemon_spec.ports[0]}") + elif ftype == 'civetweb': + if spec.ssl: + args.append(f"port={daemon_spec.ports[0]}s") # note the 's' suffix on port + args.append(f"ssl_certificate=config://rgw/cert/{spec.service_name()}.crt") + else: + args.append(f"port={daemon_spec.ports[0]}") + frontend = f'{ftype} {" ".join(args)}' ret, out, err = self.mgr.check_mon_command({ 'prefix': 'config set', diff --git a/src/python-common/ceph/deployment/service_spec.py b/src/python-common/ceph/deployment/service_spec.py index 1c45780778c..00a6a73b1ed 100644 --- a/src/python-common/ceph/deployment/service_spec.py +++ b/src/python-common/ceph/deployment/service_spec.py @@ -707,6 +707,7 @@ class RGWSpec(ServiceSpec): rgw_zone: Optional[str] = None, rgw_frontend_port: Optional[int] = None, rgw_frontend_ssl_certificate: Optional[List[str]] = None, + rgw_frontend_type: Optional[str] = None, unmanaged: bool = False, ssl: bool = False, preview_only: bool = False, @@ -728,6 +729,7 @@ class RGWSpec(ServiceSpec): self.rgw_zone = rgw_zone self.rgw_frontend_port = rgw_frontend_port self.rgw_frontend_ssl_certificate = rgw_frontend_ssl_certificate + self.rgw_frontend_type = rgw_frontend_type self.ssl = ssl def get_port_start(self) -> Optional[int]: diff --git a/src/python-common/ceph/tests/test_service_spec.py b/src/python-common/ceph/tests/test_service_spec.py index 210e63d1307..ec75e3dbaed 100644 --- a/src/python-common/ceph/tests/test_service_spec.py +++ b/src/python-common/ceph/tests/test_service_spec.py @@ -201,6 +201,7 @@ placement: hosts: - ceph-001 spec: + rgw_frontend_type: civetweb rgw_realm: default-rgw-realm rgw_zone: eu-central-1 --- -- 2.39.5