...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
# The file is located in the folder "rook/clusterdeploy/examples/kubernetes/ceph" $ kubectl create -f toolbox.yaml # Once the rook-ceph-tools pod is running, you can connect to it with $ kubectl -n rook-ceph exec -it deploy/rook-ceph-tools -- bash |
...
When you are done with the toolbox, you can remove the deployment kubectl -n deployment with
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
$ kubectl -n rook-ceph delete deploy/rook-ceph-tools |
...
Ceph Dashboard
The dashboard is a very helpful tool to give you an overview of the status of your Ceph cluster, including overall health, 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.
...
Each Rook Ceph cluster has some built in metrics collectors/exporters for monitoring with Prometheus. If you do not have Prometheus running, follow the steps presented here, to enable monitoring of Rook.
With the Prometheus operator running, we can create a service monitor that will watch the Rook cluster and collect metrics regularly. From the root of your locally cloned Rook repo, go the monitoring directorydirectory and make the following change to the service-monitor.yaml
file
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
$ cd # The path is "rook/cluster/examples/kubernetes/ceph/monitoring" apiVersion: monitoring $ kubectl create -f service-monitor.yaml $ kubectl create -f prometheus.yaml $ kubectl create -f prometheus-service.yaml # Ensure that the Prometheus server pod gets created and advances to the Running state before moving on $ kubectl -n rook-ceph get pod prometheus-rook-prometheus-0.coreos.com/v1 kind: ServiceMonitor metadata: name: rook-ceph-mgr namespace: rook-ceph labels: release: prometheus # <--- Insert the indicated label team: rook spec: namespaceSelector: matchNames: - rook-ceph selector: matchLabels: app: rook-ceph-mgr rook_cluster: rook-ceph endpoints: - port: http-metrics path: /metrics interval: 5s |
Save the file and create the component. The release: prometheus
label that we have introduced serves so that the Prometheus operator can "see" the service monitor. How do I find out which label is used by Prometheus? Try running a describe and look for the Service Monitor Selector
parameter. The service monitor, in turn, points to the components it wants to analyze thanks to the parameters namespaceSelector
and selector
.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
$ kubectl describe prometheus -n monitoring
Name: prometheus-kube-prometheus-prometheus
Namespace: monitoring
Labels: app=kube-prometheus-stack-prometheus
app.kubernetes.io/managed-by=Helm
chart=kube-prometheus-stack-13.5.0
heritage=Helm
release=prometheus
Annotations: meta.helm.sh/release-name: prometheus
meta.helm.sh/release-namespace: monitoring
API Version: monitoring.coreos.com/v1
Kind: Prometheus
.
.
.
Service Monitor Selector:
Match Labels:
Release: prometheus # <--- Pay attention!!!
Shards: 1
Version: v2.24.0
Events: <none> |
Once the Prometheus server is running, you can open a web browser and go http://<VM_FIP>:<port>
.<Prometheus_port>
. You should see a new target.