Deploying Ceph Object Gateway using the rgw module

Bootstrapping the Ceph Object Gateway realm creates a new realm entity, a new zonegroup, and a new zone. The rgw module instructs the orchestrator to create and deploy the corresponding Ceph Object Gateway daemons.

Before you begin

  • A running IBM Storage Ceph cluster.

About this task

Enable the rgw module by using the ceph mgr module enable rgw command. After enabling the rgw module, either pass the arguments in the command line or use the YAML specification file to bootstrap the realm.

Procedure

  1. Log in to the Cephadm shell.
    cephadm shell
    For example,
    [root@host01 ~]# cephadm shell
  2. Enable the rgw module.
    ceph mgr module enable rgw
    For example,
    [ceph: root@host01 /]# ceph mgr module enable rgw
  3. Bootstrap the Ceph Object Gateway realm by using either the command-line or the YAML specification file.
    • Bootstrap the Ceph Object Gateway realm by using the command-line interface.
      ceph rgw realm bootstrap [--realm name REALM_NAME] [--zonegroup-name ZONEGROUP_NAME] [--zone-name ZONE_NAME] [--port PORT_NUMBER] [--placement HOSTNAME] [--start-radosgw]
      For example,
      [ceph: root@host01 /]# ceph rgw realm bootstrap --realm-name myrealm --zonegroup-name myzonegroup --zone-name myzone --port 5500 --placement="host01 host02" --start-radosgw
      Realm(s) created correctly. Please, use 'ceph rgw realm tokens' to get the token.
    • Bootstrap the Ceph Object Gateway realm using the YAML specification file.
      1. As a root user, create the YAML file.
        rgw_realm: REALM_NAME
        rgw_zonegroup: ZONEGROUP_NAME
        rgw_zone: ZONE_NAME
        placement:
          hosts:
           - HOSTNAME_1
           - HOSTNAME_2
        For example,
        [root@host01 ~]# cat rgw.yaml
        
        rgw_realm: myrealm
        rgw_zonegroup: myzonegroup
        rgw_zone: myzone
        placement:
          hosts:
           - host01
           - host02
      2. Mount the YAML file under a directory in the container.
        cephadm shell --mount rgw.yaml:/var/lib/ceph/rgw/rgw.yaml
        For example,
        [root@host01 ~]# cephadm shell --mount rgw.yaml:/var/lib/ceph/rgw/rgw.yaml
      3. Bootstrap the realm.
        Note: The specification file that is used by the rgw module has the same format as the one used by the orchestrator. Therefore, you can provide any orchestration supported Ceph Object Gateway parameters including advanced configuration features such as SSL certificates.
        ceph rgw realm bootstrap -i /var/lib/ceph/rgw/rgw.yaml
        For example,
        [ceph: root@host01 /]# ceph rgw realm bootstrap -i /var/lib/ceph/rgw/rgw.yaml
  4. List the available tokens.
    Note: If you run this command before the Ceph Object Gateway daemons are fully deployed a message is displayed showing that there are no tokens because there are no endpoints yet.
    ceph rgw realm tokens | jq
    For example,
    [ceph: root@host01 /]# ceph rgw realm tokens | jq
    
    [
      {
        "realm": "myrealm",
        "token": "ewogICAgInJlYWxtX25hbWUiOiAibXlyZWFsbSIsCiAgICAicmVhbG1faWQiOiAiZDA3YzAwZWYtOTA0MS00ZjZlLTg4MDQtN2Q0MDI0MDU1NmFlIiwKICAgICJlbmRwb2ludCI6ICJodHRwOi8vdm0tMDA6NDMyMSIsCiAgICAiYWNjZXNzX2tleSI6ICI5NTY1VFZSMVFWTExFRzdVNFIxRCIsCiAgICAic2VjcmV0IjogImQ3b0FJQXZrNEdYeXpyd3Q2QVZ6bEZNQmNnRG53RVdMMHFDenE3cjUiCn1="
      }
    ]

What to do next

Verify the Ceph Object Gateway deployment.
For example,
[ceph: root@host01 /]# ceph orch list --daemon-type=rgw
NAME                                                   HOST                    PORTS  STATUS          REFRESHED  AGE  MEM USE  MEM LIM  VERSION          IMAGE ID      CONTAINER ID
rgw.myrealm.myzonegroup.ceph-saya-6-osd-host01.eburst  ceph-saya-6-osd-host01  *:80   running (111m)  9m ago     111m  82.3M   -        17.2.6-22.el9cp  2d5b080de0b0  2f3eaca7e88e