Skip to content

mgr/dashboard,cephadm: automate setup of RGW credentials for dashboard - #42252

Merged
liewegas merged 8 commits into
ceph:masterfrom
liewegas:dashboard-rgw
Aug 11, 2021
Merged

liewegas merged 8 commits into
ceph:masterfrom
liewegas:dashboard-rgw

Conversation

@liewegas

@liewegas liewegas commented Jul 8, 2021 •

Copy link
Copy Markdown
Member
  • New 'ceph dashboard connect-rgw' command to set up RGW credentials
  • Trigger credential check when rgw service created or destroyed. Note that what we really want is a credential check any time an RGW realm is created or destroyed, but we don't have that visibility. We could supplement by just calling the current check every 24h or something, though. And eventually if/when we have a mgr/rgw module that pulls some of this rgw realm management into the mgr, then we can trigger it at the right time.

@alfonsomthd UPDATE:

  • Dashboard > Object Gateway: if empty credentials are detected, we trigger the credentials configuration.

Fixes: https://tracker.ceph.com/issues/44605

Related PR: #41590

TODO

  • we should trigger when the dashboard module is first enabled? or perhaps even when the dashboard loads (on every mgr startup)?
  • update docs

@liewegas
liewegas requested review from a team as code owners July 8, 2021 20:10
@liewegas
liewegas requested review from Waadkh7, aaryanporwal and cypherean and removed request for a team July 8, 2021 20:10
@github-actions

github-actions Bot commented Jul 8, 2021

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@alfonsomthd
alfonsomthd requested a review from jmolmo July 9, 2021 07:49
@liewegas
liewegas force-pushed the dashboard-rgw branch 2 times, most recently from 5e34821 to 82d7d3a Compare July 13, 2021 16:53
@alfonsomthd
alfonsomthd force-pushed the dashboard-rgw branch 2 times, most recently from 76e92ef to 5fa7d20 Compare July 28, 2021 14:51
@liewegas
liewegas requested a review from a team July 28, 2021 14:51
@github-actions github-actions Bot added the tests label Jul 28, 2021
@alfonsomthd

Copy link
Copy Markdown
Contributor

jenkins test dashboard

@liewegas

liewegas commented Aug 9, 2021

Copy link
Copy Markdown
Member Author

retest this please

liewegas and others added 7 commits August 10, 2021 14:06
…d/destroyed

We don't always know when a realm is created/destroyed, but we can use
service config and purge to cover most such cases.

Signed-off-by: Sage Weil <[email protected]>
- Align Dashboard with cephadm: configure credentials using the same logic.
- Fix: create a 'dashboard' user per realm (before: only on 1st realm).
- Lint fixes, test coverage, method renaming to better reflect behavior and method visibility.

Fixes: https://tracker.ceph.com/issues/44605
Signed-off-by: Alfonso Martínez <[email protected]>
- Rename the dashboard command to better reflect its behavior.
- Rename '_radosgw_admin' method to 'send_rgwadmin_command' for consistency with
  'send_mon_command' and move it to the mgr_module.py .
- Cleanup: remove unneeded rgw settings.
- Better error handling and test coverage.

Fixes: https://tracker.ceph.com/issues/44605
Signed-off-by: Alfonso Martínez <[email protected]>
…ce spec.

Align rgw service id pattern with cephadm: ceph#39877
  - Update rgw pattern to allow service id for non-multisite config.
  - Extract realm and zone from service id (when detected) and add them to the service spec.

Fixes: https://tracker.ceph.com/issues/44605
Signed-off-by: Alfonso Martínez <[email protected]>
@alfonsomthd
alfonsomthd force-pushed the dashboard-rgw branch 2 times, most recently from 84e9930 to 265d79f Compare August 10, 2021 13:52
@alfonsomthd

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

@jmolmo jmolmo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@alfonsomthd
alfonsomthd self-requested a review August 11, 2021 10:50
@alfonsomthd

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

@liewegas
liewegas merged commit 6f8bdfb into ceph:master Aug 11, 2021
@liewegas
liewegas deleted the dashboard-rgw branch August 11, 2021 15:28
dsavineau added a commit to dsavineau/ceph-ansible that referenced this pull request Aug 17, 2021
Since [1] multiple ceph dashboard commands have been removed and this is
breaking the current ceph-ansible dashboard with RGW automation.
This removes the following dashboard rgw commands:

- ceph dashboard set-rgw-api-access-key
- ceph dashboard set-rgw-api-secret-key
- ceph dashboard set-rgw-api-host
- ceph dashboard set-rgw-api-port
- ceph dashboard set-rgw-api-scheme

Which are replaced by `ceph dashboard set-rgw-credentials`

The RGW user creation task is also removed.

Finally moving the delegate_to statement from the rgw tasks at the block
level.

[1] ceph/ceph#42252

Signed-off-by: Dimitri Savineau <[email protected]>
@sebastian-philipp

Copy link
Copy Markdown
Contributor
TASK [ceph-dashboard : set the rgw user] ***************************************
task path: /home/jenkins-build/build/workspace/ceph-ansible-prs-centos-container-update/roles/ceph-dashboard/tasks/configure_dashboard.yml:274
Tuesday 17 August 2021  14:37:08 +0000 (0:00:00.100)       0:22:14.819 ******** 
fatal: [mgr0 -> mon0]: FAILED! => changed=false 
  cmd:
  - podman
  - exec
  - ceph-mon-mon0
  - ceph
  - --cluster
  - ceph
  - dashboard
  - set-rgw-api-user-id
  - ceph-dashboard
  delta: '0:00:00.537218'
  end: '2021-08-17 14:37:08.831031'
  msg: non-zero return code
  rc: 22
  start: '2021-08-17 14:37:08.293813'
  stderr: |-
    no valid command found; 10 closest matches:
    dashboard set-jwt-token-ttl <seconds:int>
    dashboard get-jwt-token-ttl
    dashboard create-self-signed-cert
    dashboard grafana dashboards update
    dashboard get-account-lockout-attempts
    dashboard set-account-lockout-attempts <value>
    dashboard reset-account-lockout-attempts
    dashboard get-alertmanager-api-host
    dashboard set-alertmanager-api-host <value>
    dashboard reset-alertmanager-api-host
    Error EINVAL: invalid command
  stderr_lines: <omitted>
  stdout: ''
  stdout_lines: <omitted>

dsavineau added a commit to ceph/ceph-ansible that referenced this pull request Aug 17, 2021
Since [1] multiple ceph dashboard commands have been removed and this is
breaking the current ceph-ansible dashboard with RGW automation.
This removes the following dashboard rgw commands:

- ceph dashboard set-rgw-api-access-key
- ceph dashboard set-rgw-api-secret-key
- ceph dashboard set-rgw-api-host
- ceph dashboard set-rgw-api-port
- ceph dashboard set-rgw-api-scheme

Which are replaced by `ceph dashboard set-rgw-credentials`

The RGW user creation task is also removed.

Finally moving the delegate_to statement from the rgw tasks at the block
level.

[1] ceph/ceph#42252

Signed-off-by: Dimitri Savineau <[email protected]>
mergify Bot pushed a commit to ceph/ceph-ansible that referenced this pull request Sep 16, 2021
Since [1] multiple ceph dashboard commands have been removed and this is
breaking the current ceph-ansible dashboard with RGW automation.
This removes the following dashboard rgw commands:

- ceph dashboard set-rgw-api-access-key
- ceph dashboard set-rgw-api-secret-key
- ceph dashboard set-rgw-api-host
- ceph dashboard set-rgw-api-port
- ceph dashboard set-rgw-api-scheme

Which are replaced by `ceph dashboard set-rgw-credentials`

The RGW user creation task is also removed.

Finally moving the delegate_to statement from the rgw tasks at the block
level.

[1] ceph/ceph#42252

Signed-off-by: Dimitri Savineau <[email protected]>
(cherry picked from commit 2ee2194)
dsavineau added a commit to ceph/ceph-ansible that referenced this pull request Sep 17, 2021
Since [1] multiple ceph dashboard commands have been removed and this is
breaking the current ceph-ansible dashboard with RGW automation.
This removes the following dashboard rgw commands:

- ceph dashboard set-rgw-api-access-key
- ceph dashboard set-rgw-api-secret-key
- ceph dashboard set-rgw-api-host
- ceph dashboard set-rgw-api-port
- ceph dashboard set-rgw-api-scheme

Which are replaced by `ceph dashboard set-rgw-credentials`

The RGW user creation task is also removed.

Finally moving the delegate_to statement from the rgw tasks at the block
level.

[1] ceph/ceph#42252

Signed-off-by: Dimitri Savineau <[email protected]>
(cherry picked from commit 2ee2194)
guits pushed a commit to ceph/ceph-ansible that referenced this pull request Sep 18, 2021
Since [1] multiple ceph dashboard commands have been removed and this is
breaking the current ceph-ansible dashboard with RGW automation.
This removes the following dashboard rgw commands:

- ceph dashboard set-rgw-api-access-key
- ceph dashboard set-rgw-api-secret-key
- ceph dashboard set-rgw-api-host
- ceph dashboard set-rgw-api-port
- ceph dashboard set-rgw-api-scheme

Which are replaced by `ceph dashboard set-rgw-credentials`

The RGW user creation task is also removed.

Finally moving the delegate_to statement from the rgw tasks at the block
level.

[1] ceph/ceph#42252

Signed-off-by: Dimitri Savineau <[email protected]>
(cherry picked from commit 2ee2194)
stuartgrace-bbc pushed a commit to bbc/ceph-ansible that referenced this pull request Jan 30, 2024
Since [1] multiple ceph dashboard commands have been removed and this is
breaking the current ceph-ansible dashboard with RGW automation.
This removes the following dashboard rgw commands:

- ceph dashboard set-rgw-api-access-key
- ceph dashboard set-rgw-api-secret-key
- ceph dashboard set-rgw-api-host
- ceph dashboard set-rgw-api-port
- ceph dashboard set-rgw-api-scheme

Which are replaced by `ceph dashboard set-rgw-credentials`

The RGW user creation task is also removed.

Finally moving the delegate_to statement from the rgw tasks at the block
level.

[1] ceph/ceph#42252

Signed-off-by: Dimitri Savineau <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants