Skip to content

mgr/cephadm: streamline rgw deployment#36162

Merged
sebastian-philipp merged 1 commit intoceph:masterfrom
Daniel-Pivonka:cephadm-43681
Jul 30, 2020
Merged

mgr/cephadm: streamline rgw deployment#36162
sebastian-philipp merged 1 commit intoceph:masterfrom
Daniel-Pivonka:cephadm-43681

Conversation

@Daniel-Pivonka
Copy link

@Daniel-Pivonka Daniel-Pivonka commented Jul 17, 2020

Streamline the rgw deployment process for cephadm:

Currently to deploy rgw you first:

need a healthy cluster (ceph -s -> HEALTH_OK)
create a realm (radosgw-admin realm create --rgw-realm=*<realm-name>* --default)
create a zonegroup (radosgw-admin zonegroup create --rgw-zonegroup=default --master --default)
create a zone (radosgw-admin zone create --rgw-zonegroup=default --rgw-zone=*<zone-name>* --master --default)

then finally deploy the rgw service (ceph orch apply rgw *<realm-name>* *<zone-name>* --placement=*<placement>*)

To streamline this process cephadm handles those steps:

ceph orch apply rgw *<realm-name>* *<zone-name>* --placement=*<placement>* (this one command handles everything)

when a user creates a rgw service they supply the realm and zone they want
and then before creating the rgw service cephadm can:

check the cluster health
creates the realm if needed
create a zonegroup if needed (this is always 'default' for now)
create a zone if needed

then deploy the rgw service like normal

Fixes: https://tracker.ceph.com/issues/43681
Signed-off-by: Daniel-Pivonka dpivonka@redhat.com

@mgfritch
Copy link
Contributor

move this logic down into the bin/cephadm deploy .. command?

and then use the rgw keyring for these commands?

something like this inside the rgw container:

$ cat /etc/ceph/keyring               
[client.rgw.realm.zone.subcluster.host1.lxwzqu]
        key = AQBcyRBfcYdDDRAAtSFGuepz+xbxtMunaMxYSQ==


$ radosgw-admin --user rgw.realm.zone.subcluster.host1.lxwzqu realm create --rgw-realm=realm --default
{   
    "id": "5e755f13-9820-4c67-93fb-552772fe7686",
    "name": "realm",
    "current_period": "8f94490f-8632-4336-bd4c-adf219e70c99",
    "epoch": 1
}

Copy link
Contributor

@mgfritch mgfritch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a rgw generate_config function for the config-json...?

similar to this:

def generate_config(self, daemon_spec: CephadmDaemonSpec) -> Tuple[Dict[str, Any], List[str]]:
# Ceph.daemons (mon, mgr, mds, osd, etc)
cephadm_config = self.mgr._get_config_and_keyring(
daemon_spec.daemon_type,
daemon_spec.daemon_id,
host=daemon_spec.host,
keyring=daemon_spec.keyring,
extra_ceph_config=daemon_spec.extra_config.pop('config', ''))
if daemon_spec.extra_config:
cephadm_config.update({'files': daemon_spec.extra_config})
return cephadm_config, []

@sebastian-philipp
Copy link
Contributor

@cbodley we need to call radosgw-admin from the MGR to setup the realm etc. Do you have any other ideas other than extending the MGR keyring accordingly?

@cbodley
Copy link
Contributor

cbodley commented Jul 20, 2020

Do you have any other ideas other than extending the MGR keyring accordingly?

i think it's reasonable to put it there, yeah

Copy link
Contributor

@sebastian-philipp sebastian-philipp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great! (even though a bit awkward to call radosgw-admin in the mgr container)

@sebastian-philipp sebastian-philipp requested a review from a team July 22, 2020 20:24
@sebastian-philipp
Copy link
Contributor

adding dashboard cause this is the base for a future dashboard integration

@Daniel-Pivonka Daniel-Pivonka force-pushed the cephadm-43681 branch 2 times, most recently from 8f76b20 to 35a5762 Compare July 27, 2020 22:25
@sebastian-philipp
Copy link
Contributor

______________________________________________________________________________________________________________________________ summary _______________________________________________________________________________________________________________________________
  py3: commands succeeded
  mypy: commands succeeded
  congratulations :)

locally on my system.

@sebastian-philipp
Copy link
Contributor

jenkins test make check

@smithfarm
Copy link
Contributor

Are you planning to add documentation to this PR, or will that be done via a separate PR?

@Daniel-Pivonka Daniel-Pivonka marked this pull request as ready for review July 28, 2020 20:53
@Daniel-Pivonka Daniel-Pivonka requested a review from a team as a code owner July 28, 2020 20:53
@Daniel-Pivonka Daniel-Pivonka changed the title [WIP] mgr/cephadm: streamline rgw deployment mgr/cephadm: streamline rgw deployment Jul 28, 2020
@Daniel-Pivonka
Copy link
Author

tests passed finally!
Added doc changes
made this a real pr and removed [WIP]

@sebastian-philipp sebastian-philipp added the wip-swagner-testing My Teuthology tests label Jul 29, 2020
cephadm will create realm, zonegroup, and zone if needed before creating rgw service

fixes: https://tracker.ceph.com/issues/43681
Signed-off-by: Daniel-Pivonka <dpivonka@redhat.com>
Copy link
Contributor

@mgfritch mgfritch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@sebastian-philipp
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants