Commit Graph
31 Commits
Author SHA1 Message Date
Divyansh Kamboj f9d6cd7f3a exporter: change deployment strategy to Recreate
Restarting the exporter using RollingRelease causes a race condition,
that results in exporter crashing and the ceph health to show a warning.

Signed-off-by: Divyansh Kamboj <dkamboj@redhat.com>
2023-11-27 15:20:25 +05:30
Travis Nielsen da2513e484 Merge pull request #13248 from rkachach/fix_issue_exporter_interval
mgr: get servicemonitor exporter's interval from MonitoringSpec
2023-11-21 16:02:38 -07:00
Redouane Kachach 6b71325dbe mgr: get servicemonitor exporter's interval from MonitoringSpec
this change updates the serviceMonitor interval of the the rook-ceph-exporter
with the value from the MonitoringSpec.

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

Signed-off-by: Redouane Kachach <rkachach@redhat.com>
2023-11-21 21:47:28 +01:00
avanthakkar 8fa561484a exporter: run exporter with specific keyring
Similar to the ceph crash collector daemon that generates a keyring with more
restrictive privileges, the exporter should also generate and use a more limited keyring.

Signed-off-by: avanthakkar <avanjohn@gmail.com>
2023-11-21 23:52:50 +05:30
parth-gr f007f2aca1 core: report node metrics using ceph telemetry
Add this reporting with the cephcluster reconcile,
Similar way we reported other telemetry's

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

Signed-off-by: parth-gr <paarora@redhat.com>
2023-11-16 19:13:22 +05:30
travisn a421143ddd Revert "core: use crash profile in crash daemon keyring"
This reverts commit fab23d3407.
The mgr requires rw access for the cron job that collects
the crashes.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2023-10-20 15:46:36 -06:00
travisn 29fb879675 exporter: change verbose info to debug logs
Several messages were showing up in the operator log
more often than necessary, so let's change them to
debug level.

Signed-off-by: travisn <tnielsen@redhat.com>
2023-10-04 12:45:39 -06:00
travisn fab23d3407 core: use crash profile in crash daemon keyring
The ceph documentation indicates to use the crash profile
instead of specifying rw for the mgr access.

Signed-off-by: travisn <tnielsen@redhat.com>
2023-09-28 11:43:01 -06:00
guoguangwu 235ac293ff core: import packages only once
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
2023-09-16 13:40:17 +08:00
Matthew Penner d09a43df37 exporter: bind to all interfaces if IPv6 is enabled
Previously ceph-exporter would only bind to IPv4 interfaces. Now if the
CephCluster is configured with `dualStack: true` and/or `ipFamily: IPv6`
an additional flag (`--addrs ::`) will be added to the ceph-exporter
container to make it listen both IPv6 and IPv4 interfaces.

Signed-off-by: Matthew Penner <me@matthewp.io>
2023-09-12 11:39:46 -06:00
Travis Nielsen ded675e758 Merge pull request #12825 from weirdwiz/service-monitor-port
monitoring: set port for servicemonitor for ceph-exporter
2023-09-01 11:58:41 -06: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
subhamkrai 29d2b6a071 core: restart ceph daemons when network updated
We need to restart all the ceph daemons whenever
cephCluster network settings are modified like
requiremsgr2, encryption and compression. This
required for Ceph to consider the new settings
it require new ceph daemons all over.

Signed-off-by: subhamkrai <srai@redhat.com>
2023-09-01 11:30:48 +05:30
subhamkrai a25071ac29 ci: fix golangCI lint remove k8s.io/utils/pointer
golangci linter was throughing error `k8s.io/utils/pointer`
package is deprecated. So, I have removed that.

Signed-off-by: subhamkrai <srai@redhat.com>
2023-08-16 21:48:42 +05:30
travisn 417f05311f exporter: ignore failed deletion of service monitor
If the ceph version does not suppport the exporter, the operator
will attempt to delete the service monitor related to the exporter
to ensure it does not exist for a node. If the expected rbac does
not exist, this will cause unnecessary errors since there would anyway
be no service monitor to delete. So we ignore the error of deleting
the service monitor for the exporter.

The context is also passed to the exporter so a new kubeconfig does
not need to be initiated and cause unnecessary logging about
invalid options for the config.

Signed-off-by: travisn <tnielsen@redhat.com>
2023-06-26 12:26:09 -06:00
travisn 557a3e06cc core: api updates for controller runtime v0.15
For the controller runtime v0.15 there are some breaking
changes to the api that need to be updated.

Signed-off-by: travisn <tnielsen@redhat.com>
2023-06-22 10:33:28 -06:00
avanthakkar 41a8294510 core: cleanup exporter resources
Cleanup exporter daemon even if ceph version is not supported along with other resources like
metrics service and service monitor.
Signed-off-by: avanthakkar <avanjohn@gmail.com>
2023-06-01 02:04:17 +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 fd935f19a7 Merge pull request #12216 from travisn/no-service-mon-default
monitoring: Skip creating the service monitor for the exporter if monitoring is not enabled
2023-05-10 09:56:23 -06:00
travisn 1b80767877 monitoring: no service monitor by default for exporter
The exporter is enabled by default, but the service monitor
can only be enabled if prometheus CRDs are available. The
monitoring.enabled must be set to true as the flag that
prometheus is available and the service monitor should
be created.

Signed-off-by: travisn <tnielsen@redhat.com>
2023-05-09 14:52:40 -06:00
avanthakkar 8a8eb863d0 core: add termination grace period for exporter pods
Shorten the termination time for exporter pod before it
gets deleted to avoid crashing of pod.
Signed-off-by: avanthakkar <avanjohn@gmail.com>
2023-05-10 02:16:12 +05:30
travisn 92a0ab37e3 monitoring: configurable option to disable prometheus metrics
The prometheus mgr module and ceph exporter can now be optionally
disabled by the monitoring.metricsDisabled setting in the
CephCluster CR. These will not be disabled by default, rather
than the mgr module being disabled by default from v1.11.4.

Signed-off-by: travisn <tnielsen@redhat.com>
2023-05-05 16:04:51 -06:00
avanthakkar 32b2445ee4 core: disable exporter service
Create the exporter service only if exporter pods are created.
Signed-off-by: avanthakkar <avanjohn@gmail.com>
2023-04-21 15:32:56 +05:30
avanthakkar 3e46522423 core: disable exporter for Ceph v17.2.6
The expected ceph version for exporter is changed temporarily because
some regression was detected in Ceph version 17.2.6.
Thus, disabling ceph-exporter for now until all the regression are fixed.

Signed-off-by: avanthakkar <avanjohn@gmail.com>
2023-04-13 02:15:36 +05:30
avanthakkar 1a000673a4 core: remove ceph-conf-dir volume mount from exporter
Remove the `ceph-conf-dir` volume and volume mount from exporter
as it's no more required to spin up exporter daemon

Signed-off-by: avanthakkar <avanjohn@gmail.com>
2023-03-21 21:16:06 +05:30
avanthakkar e235e01fa1 core: add missing labels in exporter deployment
Adding missing `ceph_daemon_id` & `rook_cluster` labels to the exporter deployment.
Signed-off-by: avanthakkar <avanjohn@gmail.com>
2023-03-09 20:57:48 +05:30
avanthakkarandTravis Nielsen b6013d9b11 core: add env var to exporter for ceph config
The exporter requires the mon config and keyring.
Use the CEPH_ARGS env var to specify the config
instead of expecting a ceph.conf to be generated
by another component on the host path.

Co-Authored-By: Travis Nielsen <tnielsen@redhat.com>
Signed-off-by: Avan Thakkar <athakkar@redhat.com>
2023-03-07 13:26:31 -07:00
Ben Gao ed6ed25257 core: on crash pod ensure rook version label is not set
ceph crash pod gets rook version label added unintentionally, which is only for deployment label.
changes include:
1, make a copy of the labels for pod spec from deployment labels just before adding rook version label.
2, add unit test to make sure it works as designed.
This fix along with pr 11674 is to stop ceph daemons pod restarting unnecessarily after upgrading rook operator.

Signed-off-by: Ben Gao <bengao168@msn.com>
2023-02-28 22:19:25 +08:00
Avan Thakkar 460900756c core: add service monitor for ceph-exporter service
Signed-off-by: Avan Thakkar <athakkar@redhat.com>
2023-02-15 15:44:56 +05:30
Avan Thakkar 2f8ee60374 core: introduce ceph-exporter
Signed-off-by: Avan Thakkar <athakkar@redhat.com>
2023-02-06 02:47:09 -05:00
Travis Nielsen b693a5cca5 core: refactor crash collector for more node daemons
The crash collector controller is designed for watching nodes where
ceph daemons are running, and ensuring a special daemon is running
on that node to provide additional support for ceph on that node.
The crash collector is the first example of a daemon that should be
running on all the ceph daemon nodes. The next example of such a
node daemon will be the ceph exporter that will listen for the
ceph metrics as described in the design doc.
https://github.com/rook/rook/blob/master/design/ceph/ceph-exporter.md

Now the crash collector controller is renamed to the node daemon controller
so the ceph exporter daemon can also be managed by the same controller.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-12-09 16:57:05 -07:00