Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
titleToolbox
collapsetrue
# 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
languagebash
titleDelete Toolbox
collapsetrue
$ 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
languagebashyml
titlePrometheus Instancesservice-monitor.yaml
collapsetrue
$ cd # The path is "rook/cluster/examples/kubernetes/ceph/monitoring"

# make the following change in the service-monitor.yaml fileapiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: rook-ceph-mgr
  namespace: rook-ceph
  labels:
    team: rook 
	release: prometheus	# <--- Insert the indicated label
    team: rook
spec:
  namespaceSelector:
    matchNames:
      - rook-ceph
  selector:

# Save the file and create the component
$ kubectl create -f service-monitor.yaml    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 serviceMonitorservice monitor. How do I find out which label is used by Prometheus? Try running a describe and look for the ServiceMonitorSelector parameter 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
languagebash
titleDescribe Prometheus
collapsetrue
$ 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>

The serviceMonitor, in turn, points to the components it wants to analyze thanks to the parameters

Code Block
languageyml
titleserviceMonitor selectors
collapsetrue
spec:
  namespaceSelector:
    matchNames:
      - rook-ceph
  selector:
    matchLabels:
      app: rook-ceph-mgr	# <--- Pay attention!!!
      rook_cluster: rook-ceph

Once the Prometheus server is running, you can open a web browser and go http://<VM_FIP>:<Prometheus_port>. You should see a new target.

...