2018-06-07 15:08:58 -07:00
---
2019-10-24 10:22:08 +02:00
title : Ceph Dashboard
2018-06-07 15:08:58 -07:00
---
2019-10-24 10:22:08 +02:00
The dashboard is a very helpful tool to give you an overview of the status of your Ceph cluster, including overall health,
2018-06-07 15:08:58 -07:00
status of the mon quorum, status of the mgr, osd, and other Ceph daemons, view pools and PG status, show logs for the daemons,
and more. Rook makes it simple to enable the dashboard.
2022-05-12 19:29:40 +02:00

2018-06-07 15:08:58 -07:00
2019-10-24 10:22:08 +02:00
## Enable the Ceph Dashboard
2018-06-07 15:08:58 -07:00
2021-02-04 18:45:37 +05:30
The [dashboard ](https://docs.ceph.com/en/latest/mgr/dashboard/ ) can be enabled with settings in the CephCluster CRD. The CephCluster CRD must have the dashboard `enabled` setting set to `true` .
2018-06-09 15:43:23 +02:00
This is the default setting in the example manifests.
2019-10-24 10:22:08 +02:00
2018-06-07 15:08:58 -07:00
```yaml
2022-05-12 19:29:40 +02:00
[ ...]
spec :
dashboard :
enabled : true
2018-06-07 15:08:58 -07:00
```
2019-10-24 10:22:08 +02:00
The Rook operator will enable the ceph-mgr dashboard module. A service object will be created to expose that port inside the Kubernetes cluster. Rook will
2019-07-13 22:43:56 -06:00
enable port 8443 for https access.
2018-10-31 16:30:39 -06:00
2019-07-13 22:43:56 -06:00
This example shows that port 8443 was configured.
2019-10-24 10:22:08 +02:00
```console
2022-05-12 19:29:40 +02:00
$ kubectl -n rook-ceph get service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
rook-ceph-mgr ClusterIP 10.108.111.192 <none> 9283/TCP 3h
rook-ceph-mgr-dashboard ClusterIP 10.110.113.240 <none> 8443/TCP 3h
2018-06-07 15:08:58 -07:00
```
2018-12-07 12:42:04 +01:00
The first service is for reporting the [Prometheus metrics ](ceph-monitoring.md ), while the latter service is for the dashboard.
2018-06-09 15:43:23 +02:00
If you are on a node in the cluster, you will be able to connect to the dashboard by using either the
2018-10-31 16:30:39 -06:00
DNS name of the service at `https://rook-ceph-mgr-dashboard-https:8443` or by connecting to the cluster IP,
in this example at `https://10.110.113.240:8443` .
2018-10-12 12:21:29 -06:00
2019-10-24 10:22:08 +02:00
### Login Credentials
2018-10-12 20:09:03 -06:00
2018-10-12 12:21:29 -06:00
After you connect to the dashboard you will need to login for secure access. Rook creates a default user named
2021-06-09 09:40:27 +02:00
`admin` and generates a secret called `rook-ceph-dashboard-password` in the namespace where the Rook Ceph cluster is running.
2018-10-12 12:21:29 -06:00
To retrieve the generated password, you can run the following:
2019-10-24 10:22:08 +02:00
```console
2019-01-31 21:39:02 +01:00
kubectl -n rook-ceph get secret rook-ceph-dashboard-password -o jsonpath="{['data']['password']}" | base64 --decode && echo
2018-10-12 12:21:29 -06:00
```
2018-06-07 15:08:58 -07:00
2018-07-20 00:12:58 +03:00
## Configure the Dashboard
2019-01-08 14:34:11 -08:00
The following dashboard configuration settings are supported:
2018-07-20 00:12:58 +03:00
```yaml
2022-05-12 19:29:40 +02:00
spec :
dashboard :
urlPrefix : /ceph-dashboard
port : 8443
ssl : true
2018-07-20 00:12:58 +03:00
```
2019-01-08 14:34:11 -08:00
* `urlPrefix` If you are accessing the dashboard via a reverse proxy, you may
2024-04-22 11:54:27 -06:00
wish to serve it under a URL prefix. To get the dashboard to use hyperlinks
that include your prefix, you can set the `urlPrefix` setting.
2019-01-08 14:34:11 -08:00
* `port` The port that the dashboard is served on may be changed from the
2024-04-22 11:54:27 -06:00
default using the `port` setting. The corresponding K8s service exposing the
port will automatically be updated.
2019-01-08 16:29:57 -08:00
* `ssl` The dashboard may be served without SSL (useful for when you deploy the
2024-04-22 11:54:27 -06:00
dashboard behind a proxy already served using SSL) by setting the `ssl` option
to be false.
2019-01-08 14:34:11 -08:00
2022-10-07 11:42:03 +02:00
## Visualization of 'Physical Disks' section in the dashboard
Information about physical disks is available only in [Rook host clusters ](../../CRDs/Cluster/host-cluster.md ).
The Rook manager module is required by the dashboard to obtain the information about physical disks, but it is disabled by default. Before it is enabled, the dashboard 'Physical Disks' section will show an error message.
2023-02-06 15:10:32 +01:00
To prepare the Rook manager module to be used in the dashboard, modify your Ceph Cluster CRD:
2022-10-07 11:42:03 +02:00
```yaml
mgr :
modules :
- name : rook
enabled : true
```
And apply the changes:
```console
2023-02-06 15:10:32 +01:00
$ kubectl apply -f cluster.yaml
2022-10-07 11:42:03 +02:00
```
Once the Rook manager module is enabled as the orchestrator backend, there are two settings required for showing disk information:
2023-02-06 15:10:32 +01:00
* `ROOK_ENABLE_DISCOVERY_DAEMON` : Set to `true` to provide the dashboard the information about physical disks. The default is `false` .
* `ROOK_DISCOVER_DEVICES_INTERVAL` : The interval for changes to be refreshed in the set of physical disks in the cluster. The default is `60` minutes.
2022-10-07 11:42:03 +02:00
Modify the operator.yaml, and apply the changes:
```console
2023-02-06 15:10:32 +01:00
$ kubectl apply -f operator.yaml
2022-10-07 11:42:03 +02:00
```
2018-06-07 15:08:58 -07:00
## Viewing the Dashboard External to the Cluster
Commonly you will want to view the dashboard from outside the cluster. For example, on a development machine with the
2018-06-09 15:43:23 +02:00
cluster running inside minikube you will want to access the dashboard from the host.
2018-06-07 15:08:58 -07:00
There are several ways to expose a service that will depend on the environment you are running in.
You can use an [Ingress Controller ](https://kubernetes.io/docs/concepts/services-networking/ingress/ ) or [other methods ](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types ) for exposing services such as
NodePort, LoadBalancer, or ExternalIPs.
2019-01-05 16:56:36 -05:00
### Node Port
2018-06-07 15:08:58 -07:00
The simplest way to expose the service in minikube or similar environment is using the NodePort to open a port on the
2018-10-31 16:30:39 -06:00
VM that can be accessed by the host. To create a service with the NodePort, save this yaml as `dashboard-external-https.yaml` .
2018-06-07 15:08:58 -07:00
```yaml
apiVersion : v1
kind : Service
metadata :
2018-10-31 16:30:39 -06:00
name : rook-ceph-mgr-dashboard-external-https
2018-06-07 15:08:58 -07:00
namespace : rook-ceph
labels :
app : rook-ceph-mgr
rook_cluster : rook-ceph
spec :
ports :
- name : dashboard
2018-10-03 16:14:51 -06:00
port : 8443
2018-06-07 15:08:58 -07:00
protocol : TCP
2018-10-03 16:14:51 -06:00
targetPort : 8443
2018-06-07 15:08:58 -07:00
selector :
app : rook-ceph-mgr
rook_cluster : rook-ceph
2023-10-15 22:54:11 -04:00
mgr_role : active
2018-06-07 15:08:58 -07:00
sessionAffinity : None
type : NodePort
```
Now create the service:
2019-10-24 10:22:08 +02:00
```console
kubectl create -f dashboard-external-https.yaml
2018-06-07 15:08:58 -07:00
```
2019-03-03 22:12:11 +09:00
You will see the new service `rook-ceph-mgr-dashboard-external-https` created:
2019-10-24 10:22:08 +02:00
```console
2022-05-12 19:29:40 +02:00
$ kubectl -n rook-ceph get service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
rook-ceph-mgr ClusterIP 10.108.111.192 <none> 9283/TCP 4h
rook-ceph-mgr-dashboard ClusterIP 10.110.113.240 <none> 8443/TCP 4h
rook-ceph-mgr-dashboard-external-https NodePort 10.101.209.6 <none> 8443:31176/TCP 4h
2018-06-07 15:08:58 -07:00
```
2018-10-03 16:14:51 -06:00
In this example, port `31176` will be opened to expose port `8443` from the ceph-mgr pod. Find the ip address
2018-10-12 12:21:29 -06:00
of the VM. If using minikube, you can run `minikube ip` to find the ip address.
2018-10-31 16:30:39 -06:00
Now you can enter the URL in your browser such as `https://192.168.99.110:31176` and the dashboard will appear.
2019-01-05 16:56:36 -05:00
2019-05-31 17:29:54 +02:00
### Load Balancer
If you have a cluster on a cloud provider that supports load balancers,
you can create a service that is provisioned with a public hostname.
2019-10-24 10:22:08 +02:00
The yaml is the same as `dashboard-external-https.yaml` except for the following property:
2019-05-31 17:29:54 +02:00
```yaml
2019-10-24 10:22:08 +02:00
spec :
[ ...]
2019-05-31 17:29:54 +02:00
type : LoadBalancer
```
Now create the service:
2019-10-24 10:22:08 +02:00
```console
kubectl create -f dashboard-loadbalancer.yaml
2019-05-31 17:29:54 +02:00
```
You will see the new service `rook-ceph-mgr-dashboard-loadbalancer` created:
2019-10-24 10:22:08 +02:00
```console
2022-05-12 19:29:40 +02:00
$ kubectl -n rook-ceph get service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
rook-ceph-mgr ClusterIP 172.30.11.40 <none> 9283/TCP 4h
rook-ceph-mgr-dashboard ClusterIP 172.30.203.185 <none> 8443/TCP 4h
rook-ceph-mgr-dashboard-loadbalancer LoadBalancer 172.30.27.242 a7f23e8e2839511e9b7a5122b08f2038-1251669398.us-east-1.elb.amazonaws.com 8443:32747/TCP 4h
2019-05-31 17:29:54 +02:00
```
2019-10-24 10:22:08 +02:00
Now you can enter the URL in your browser such as `https://a7f23e8e2839511e9b7a5122b08f2038-1251669398.us-east-1.elb.amazonaws.com:8443` and the dashboard will appear.
2019-05-31 17:29:54 +02:00
2019-01-05 16:56:36 -05:00
### Ingress Controller
If you have a cluster with an [nginx Ingress Controller ](https://kubernetes.github.io/ingress-nginx/ )
and a Certificate Manager (e.g. [cert-manager ](https://cert-manager.readthedocs.io/ )) then you can create an
Ingress like the one below. This example achieves four things:
2023-08-22 10:07:19 +08:00
1. Exposes the dashboard on the Internet (using a reverse proxy)
2. Issues a valid TLS Certificate for the specified domain name (using [ACME ](https://en.wikipedia.org/wiki/Automated_Certificate_Management_Environment ))
2019-01-05 16:56:36 -05:00
3. Tells the reverse proxy that the dashboard itself uses HTTPS
4. Tells the reverse proxy that the dashboard itself does not have a valid certificate (it is self-signed)
```yaml
2021-05-18 11:20:13 -06:00
apiVersion : networking.k8s.io/v1
2019-01-05 16:56:36 -05:00
kind : Ingress
metadata :
name : rook-ceph-mgr-dashboard
namespace : rook-ceph
annotations :
kubernetes.io/tls-acme : "true"
nginx.ingress.kubernetes.io/backend-protocol : "HTTPS"
nginx.ingress.kubernetes.io/server-snippet : |
proxy_ssl_verify off;
spec :
2023-06-22 23:31:24 +02:00
ingressClassName : "nginx"
2019-01-05 16:56:36 -05:00
tls :
- hosts :
- rook-ceph.example.com
secretName : rook-ceph.example.com
rules :
- host : rook-ceph.example.com
http :
paths :
- path : /
2021-05-18 11:20:13 -06:00
pathType : Prefix
2019-01-05 16:56:36 -05:00
backend :
2021-05-18 11:20:13 -06:00
service :
name : rook-ceph-mgr-dashboard
port :
name : https-dashboard
2019-01-05 16:56:36 -05:00
```
Customise the Ingress resource to match your cluster. Replace the example domain name `rook-ceph.example.com`
with a domain name that will resolve to your Ingress Controller (creating the DNS entry if required).
Now create the Ingress:
2019-10-24 10:22:08 +02:00
```console
kubectl create -f dashboard-ingress-https.yaml
2019-01-05 16:56:36 -05:00
```
You will see the new Ingress `rook-ceph-mgr-dashboard` created:
2019-10-24 10:22:08 +02:00
```console
2022-05-12 19:29:40 +02:00
$ kubectl -n rook-ceph get ingress
NAME HOSTS ADDRESS PORTS AGE
rook-ceph-mgr-dashboard rook-ceph.example.com 80, 443 5m
2019-01-05 16:56:36 -05:00
```
And the new Secret for the TLS certificate:
2019-10-24 10:22:08 +02:00
```console
2021-02-18 18:24:22 +05:30
kubectl -n rook-ceph get secret rook-ceph.example.com
2022-05-12 19:29:40 +02:00
NAME TYPE DATA AGE
rook-ceph.example.com kubernetes.io/tls 2 4m
2019-01-05 16:56:36 -05:00
```
2019-10-24 10:22:08 +02:00
2019-01-05 16:56:36 -05:00
You can now browse to `https://rook-ceph.example.com/` to log into the dashboard.