Skip to content

Instantly share code, notes, and snippets.

@andy108369
Last active September 9, 2022 14:23
Show Gist options
  • Save andy108369/f9422ed015a7027a419b47655e8ec3f1 to your computer and use it in GitHub Desktop.
Save andy108369/f9422ed015a7027a419b47655e8ec3f1 to your computer and use it in GitHub Desktop.

Enabling Ceph dashboard

image


Make sure it is enabled in the config

Get the admin password:

kubectl -n rook-ceph get secret rook-ceph-dashboard-password -o json | jq -r '.data.password | @base64d'

If it does not work, then reset it using the following commands:

$ kubectl -n rook-ceph exec -ti $(kubectl -n rook-ceph get pod -l "app=rook-ceph-tools" -o jsonpath='{.items[0].metadata.name}') -- bash
$ echo 'YourPasSword123' > /tmp/dash.pass
$ ceph dashboard ac-user-set-password admin -i /tmp/dash.pass 
{"username": "admin", "password": "$REDACTED", "roles": ["administrator"], "name": null, "email": null, "lastUpdate": 1662067137, "enabled": true, "pwdExpirationDate": null, "pwdUpdateRequired": false}
[rook@rook-ceph-tools-645584ff48-wmqs8 /]$ rm /tmp/dash.pass

Forward the Ceph dashboard port to your laptop:

kubectl -n rook-ceph port-forward svc/rook-ceph-mgr-dashboard 8443:8443

Now you can access Ceph dashboard in your browser:

https://127.0.0.1:8443

Username: admin
Password: <REDACTED>

Or, if you don't want to forward the ports, you can access it over a mapped port by enabling it in the config first:

$ kubectl -n rook-ceph get service
NAME                                     TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)             AGE
...
rook-ceph-mgr-dashboard                  ClusterIP   10.233.42.176   <none>        8443/TCP            3d7h
rook-ceph-mgr-dashboard-external-https   NodePort    10.233.1.162    <none>        8443:31057/TCP      22h

Find the port to which your Ceph Dashboard got mapped to in your K8s cluster, in my case that's 31057/tcp port, so I can then access it via http://<k8s-ip>:31057 address.

Next steps?

Enable Monitoring https://github.com/rook/rook/blob/v1.9.9/deploy/charts/rook-ceph-cluster/values.yaml#L38-L40

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