Commit Graph
12 Commits
Author SHA1 Message Date
Joshua Hoblitt 3cb343f62a core: run gofumpt on all files
Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2025-03-26 10:41:48 -07:00
Redouane Kachach daec93eaaa monitoring: increasing metrics scraping interval from 5s to 10s
let's increase the monitoring interval to match the default interval
used by Prometheus when deployed by Ceph: 10s

Closes: https://github.com/rook/rook/issues/13883

Signed-off-by: Redouane Kachach <rkachach@redhat.com>
2024-03-13 13:29:01 +01:00
Redouane Kachach 06bc976959 mgr: set interval of serviceMonitor to the value from MonitoringSpec
This change updates the serviceMonitor interval field with the
value from the MonitoringSpec.

closes: https://github.com/rook/rook/issues/13159

Signed-off-by: Redouane Kachach <rkachach@redhat.com>
2023-11-09 06:35:20 +01:00
Divyansh Kamboj 708dd29a97 monitoring: set port for servicemonitor for ceph-exporter
ceph-exporter's ServiceMonitor and Service CRD contain different port
name, which results in no metrics being collected by prometheus.

this commit makes GetCephMonitor configurable, which we use to set
consistent port names in ServiceMonitor and Service for ceph-exporter.

Signed-off-by: Divyansh Kamboj <dkamboj@redhat.com>
2023-09-01 12:56:53 +05:30
Ho Kim 42caef169f mgr: update default rook_cluster of ServiceMonitor
When deploying a cluster with Helm Chart, if the namespace is not the default value `rook-ceph`, and if the monitoring feature is enabled, then the generated ServiceMonitor's `rook_cluster` selector now follows the namespace, not the hard-coded value `rook-ceph`.

Signed-off-by: Ho Kim <ho.kim@ulagbulag.io>
2023-05-30 23:58:50 +09:00
Travis Nielsen 4edcff04f7 monitoring: create prometheus rules with helm chart
The prometheus rules had been previously created if the cephcluster CR
setting monitoring.enabled was set to true. The rules were not customizable
and therefore not flexible enough. Now the rules are installed by the helm
chart. To customize the rules, a post-processor can be applied to the helm
chart.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-03-21 14:47:52 -06:00
Sébastien Han c890710b63 core: change directory layout
As per discussion, proposing a new layout for the charts/yaml/olm files.

./deploy
├── charts
│   ├── rook-ceph
│   │   └── templates
│   └── rook-ceph-cluster
│       └── templates
├── examples
│   ├── csi
│   │   ├── cephfs
│   │   └── rbd
│   ├── flex
│   ├── monitoring
│   ├── pre-k8s-1.16
└── olm
    └── assemble

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-11-30 09:12:53 +01:00
Mara Sophie Grosch 00a5debbab monitoring: allow overriding monitoring labels
The templates for the mgr-generated ServiceMonitor and PrometheusRule objects included the labels
prometheus and team, making it impossible to override them as user.

This adds a new method `OverwriteApplyToObjectMeta` to
pkg/apis/ceph.rook.io/v1.Labels, which, contrary to the existing
`ApplyToObjectMeta` method, overwrites existing labels.

Closes: https://github.com/rook/rook/issues/8502
Signed-off-by: Mara Sophie Grosch <littlefox@lf-net.org>
2021-11-17 17:32:05 +01:00
Sébastien Han dea3273eaf ceph: do not force go path in unit tests
Do not force unit tests to be run while the rook repo is in the GOPATH.
Now that Rook uses go modules, this is no longer necessary. Allow this
by creating a helper function that unit tests can use that return the
on-host path to the `rook` project root.

Followup of https://github.com/rook/rook/pull/7119/commits/15a487cd5aa5d4dc59bc15ef610cb182257d9287

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-02-03 08:56:41 +01:00
Blaine Gardner 15a487cd5a ceph: do not force go path in unit tests
Do not force unit tests to be run while the rook repo is in the GOPATH.
Now that Rook uses go modules, this is no longer necessary. Allow this
by creating a helper function that unit tests can use that return the
on-host path to the `rook` project root.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2021-02-01 18:28:36 -07:00
Alexander Trost 430e4dc0f4 k8sutil: set ResourceVersion for PrometheusRule
This change sets the ResourceVersion on the PrometheusRule object before
it is updated in Kubernetes.
This change fixes the following error
```
is invalid: metadata.resourceVersion: Invalid value: 0x0: must be specified for an update
```
which can occur during update when no ResourceVersion is set.

Resolves #4528

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2020-02-10 13:36:46 +01:00
Umanga Chapagain 732f3030d0 integrate prometheus based monitoring with rook-ceph
> add new field to cluster spec
> deploy servicemonitor
> deploy prometheusRule

Signed-off-by: Umanga Chapagain <chapagainumanga@gmail.com>
2019-07-08 11:40:17 +05:30