Commit Graph
202 Commits
Author SHA1 Message Date
Travis Nielsen 93adc5dd6b core: include namespace more consistently in logging
When writing to the operator log, where possible
the namespace of the resource on which the operator
is working will be logged as a standard prefix
to more easily troubleshoot what resource is being reconciled

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2025-11-20 15:49:43 -07:00
Travis Nielsen 83047a17d1 operator: fix concurrency issues in the cluster controller
Use a sync map for the clusterMap in the cluster controller
and fix other issues to allow for concurrent cluster
reconcile.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2025-11-17 11:46:33 -07:00
Yite Gu bf6c295d02 core: use sync.Map for cluster.monitoringRoutines
`cluster.monitoringRoutines` stores three types of
daemon health: "mon", "osd", and "status". These are
used by three goroutines respectively, resulting in:
fatal error: concurrent map reads and map writes.

Signed-off-by: Yite Gu <guyite@bytedance.com>
2025-11-06 19:36:40 +08:00
Santosh Pillai 1ff7604f82 core: use updated context in prevalidaiton checks
If the CephCluster spec is updated before the prevalidation check, then
Cluster.context still refers to the cancelled context of the operator.
This PR just updates the cluster context to use the latest operator
context.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2025-09-16 12:57:12 +05:30
Blaine Gardner 982b2fe632 Merge pull request #16372 from sp98/delete-bootstrap-keys
core: delete bootstrap keys
2025-09-02 12:16:59 -06:00
Santosh Pillai 4cdba0df54 core: delete bootstrap keys
Delete the client.boostrap.* keys. These keys are not created by rook so
it can't rotate them. This PR just delete these keys in the
postMonStartUpAction.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2025-09-01 08:55:23 +05:30
Travis Nielsen 57bdd548e2 Merge pull request #16399 from travisn/update-client-profile
csi: Set the cephfs kernel mount options when network encryption is enabled
2025-08-28 10:27:02 -06:00
Travis Nielsen 6309cd367e csi: default to secure kernel mount options if network encrypted
If the network is encrypted with msgr2, cephfs requires
the mount options to include ms_mode=secure. Now this
will be set by default if the mount options are not
already set in the cephcluster CR or the operator env
var CSI_CEPHFS_KERNEL_MOUNT_OPTIONS.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2025-08-27 16:30:47 -06:00
Blaine Gardner 7c33186e72 core: admin cephx key rotation
Implement CephX key rotation for Rook's client.admin user.

Admin user rotation is risky, so this has been tested extensively both
in unit tests as well as by manually injecting failures during runtime.
In testing, all failures were able to be recovered by the recovery
routine.

A mutex is also added to help ensure that two simultaneous admin key
rotation processes cannot be running simultaneously for any given
namespace. The mutex is tested in unit tests, and it was verified during
runtime via  manual testing.

Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
2025-08-27 14:47:45 -06:00
Blaine Gardner 2fd9c9a88c core: finalize CephCluster CephX status handling
Cleanup up overall usage of CephX statuses in CephCluster.

Convert all CephX statuses to non-pointer types. There is no specific
need for pointer types, and keeping these as non-pointers means there is
not a risk of nil pointer exceptions in all the various Rook controllers
for upgraded clusters.

Move initialization of CephCluster CephX status items to
`preMonStartupActions()`. This helps resolve 2 issues:

1. 'Uninitialized' state was being set for external CephClusters where
   CephX statuses are not relevant.
2. 'Uninitialized' state was being set for upgraded clusters whose key
   status cannot be determined.

Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
2025-08-18 14:53:08 -06:00
Santosh Pillai fe42fe102f mon: rotate keys
rotate mon daemon keys and update the cephx status for mons in the
cephcluster resource.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2025-08-14 11:16:39 +05:30
Travis Nielsen 4d0834f605 Merge pull request #16210 from parth-gr/cephx-exporter
exporter: automate rotate exporter cephx keys
2025-08-01 10:09:39 -06:00
Travis Nielsen cef47087dd Merge pull request #16029 from BlaineEXE/osd-automatic-rotation
OSD: implement automated cephx key rotation for osds
2025-08-01 10:08:39 -06:00
parth-gr 9ec7a767c3 exporter: automate rotate exporter cephx keys
rotate cephx keys based on keyRotationPolicy
and update cephxStatus for the ceph exporter daemon pods.

Signed-off-by: parth-gr <partharora1010@gmail.com>
2025-07-31 23:55:37 +05:30
parth-gr fd6d22fcfe core: automate rotate crashcollector keys
rotate cephx keys based on keyRotationPolicy
and update cephxStatus for the crashcollector
daemon pods.

Signed-off-by: parth-gr <partharora1010@gmail.com>
2025-07-31 11:30:55 +05:30
Blaine Gardner 4189a196c1 osd: implement automated cephx key rotation for osds
Implement automated CephX key rotation for OSDs.

OSDs have marshalled CephX statuses applied as an annotation on the OSD
pod spec, which differs from other Rook Ceph daemons for a two reasons:

A large cluster could have hundreds or thousands of OSDs, so it is more
critical that Rook avoid rotating OSD keys more than once in the event a
CephCluster reconcile restarts partway through OSD creation/updation.

OSDs do not have their CephX keys stored in K8s Secrets, whose resource
version is used for enforcing the desired restart behavior other daemon
pods like RGWs.

Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
2025-07-30 14:18:54 -06:00
subhamkrai 6d5401c50d csi: automate CSI cephx key rotation
This PR implements the CSI cephx key rotation feature,
which follows overlapping rotation for non-daemon keys.
Refer to the cephx rotation API from design PR 15915 for details.

Signed-off-by: subhamkrai <srai@redhat.com>
2025-07-25 15:39:00 +05:30
Santosh Pillai b486e308c3 mgr: rotate cephx keys
rotate cephx keys based on keyRotationPolicy and update cephxStatus for
the MGR daemon pods.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2025-07-21 12:31:35 +05:30
Santosh Pillai a07f2478f3 core: init cephxStatus on cephCluster
Set cephXStatus on the CephCluster status to Uninitialized when the
cluster is first created.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2025-07-10 20:43:58 +05:30
Patryk Rostkowski 45b0ef2104 operator: specify ceph config via secret
Adds .spec.cephConfigFromSecret to CephCluster for loading
Ceph config parameters from a Kubernetes Secret.

Signed-off-by: Patryk Rostkowski <patrostkowski@gmail.com>
2025-04-23 07:51:22 +02:00
Patryk Rostkowski 44a2eaf02f operator: decouple mon and mgr post-startup operations
Fixes an ordering issue where spec.cephConfig settings failed to apply
because the manager wasn't yet running. Moved the config logic from
postMonStartupActions() to a new postMgrStartupActions() to ensure
the mgr is ready before applying config, allowing successful reconciliation.

Signed-off-by: Patryk Rostkowski <patrostkowski@gmail.com>
2025-04-02 14:35:06 +02:00
Travis Nielsen e479b051bc osd: configure cluster full settings when osds fill up
When the clusters reach full, nearfull, or backfill full thresholds
ceph will raise health warnings and stop allowing IO or backfill
depending on the threshold. These settings require special ceph
commands instead of being generic ceph config. Allow these settings
to be set from the CephCluster CR in the spec.storage
section.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2024-05-30 12:10:41 -06:00
Satoru Takeuchi f776c0b35e core: remove pacific specific code
Since pacific is no longer supported, we can remove pacific specific
code.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2024-05-15 02:26:33 +00:00
Travis Nielsen 25d36c4c75 mon: remove quincy check since quincy is min version
With the removal of Ceph Pacific support, no need to check if Quincy
is avaiable to support encryption on the wire.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2024-05-01 15:07:09 -06:00
Alexander Trost 4ed35d6bd6 operator: allow setting ceph config options via ceph cluster crd
This implements the "Ceph Config via Ceph Cluster CRD" design document
as a `cephConfig:` structure on the CRD.
This also fixes the `yq` commands used to manipulate the
`cluster-test.yaml` that caused CI issues for this PR and potentially
unknowingly others.

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2023-12-02 00:05:48 +01:00
Rakshith R 59cb0dd4bf csi: add CSIDriverOptions section in cephCluster CR
This commit adds new CSIDriverOptions section in
cephCluster CR. This section contains settings
for read affinity and kernel+fuse Mount options
These settings will be injected directly into
rook-ceph-csi-config cm to be applicable per
ceph cluster.

Signed-off-by: Rakshith R <rar@redhat.com>
2023-11-29 19:34:28 +05:30
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
Travis Nielsen 297e8400e5 Merge pull request #12850 from parth-gr/node-telemetry
core: report node metrics using ceph telemetry
2023-11-16 14:55:44 -07:00
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 03d077aa6b core: remove support for ceph pacific
Pacific is end of life and no longer necessary to
support in Rook with v1.13.

Signed-off-by: travisn <tnielsen@redhat.com>
2023-11-14 17:07:03 -07:00
Blaine Gardner 3c43268d0a multus: detect network CIDRs via canary
Change how Rook detects network CIDRs for Multus networks. The IPAM
configuration is only defined as an arbitrary string JSON blob with a
"type" field and nothing more. Rook's detection of CIDRs for whereabouts
had already grown out of date since the initial implementation.
Additionally, Rook did not support DHCP IPAM, which is a reasonable
choice for users. And more, Rook did not support CNI plugin chaining,
which further complicates NADs. Based on the CNI spec, network chaning
can result in any changes to network CIDRs from the first-given plugin.

All these problems make it more and more difficult for Rook to support
Multus by inspecting the NAD itself to predict network CIDRs. Instead,
it is better for Rook to treat the CNI process as a black box. To
preserve legacy functionality of auto-detecting networks and to make
that as robust as possible, change to a canary-style architecture like
that used for Ceph mons, from which Rook will detect the network CIDRs
if possible.

Also allow users to specify overrides for CIDR ranges. This allows Rook
to still support esoteric and unexpected NAD or network configurations
where a CIDR range is not detectable or where the range detected would
be incomplete. Because it may be impossible for Rook to understand the
network CIDRs wholistically while residing only on a portion of the
network, this feature should have been present from Multus's inception.

Improving CIDR auto-detection and allowing users to specify overrides
for auto-detected CIDRs rounds out Rook's Multus support for CephCluster
(core/RADOS) installations. No further architectural changes should be
needed for CephClusters as regards application of public/cluster network
CIDRs for Multus networks.

Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
2023-09-07 10:12:55 -06:00
Thomas Way 891fdb3f77 operator: use msgr2 if compression is enabled
Closes: #11795
Signed-off-by: Thomas Way <thomas@6f.io>
2023-03-20 17:43:37 +00:00
sp98 7292ac5927 core: export mon and OSD services
Signed-off-by: sp98 <sapillai@redhat.com>
2023-02-27 21:36:59 +05:30
Madhu Rajanna 0ab6c34bf2 core: set rbd default map options
Set the rbd map default option to ms_mode=prefer_crc
when v2 ports are used and encryption is disabled.
If we dont pass/set the ms_mode in the map options
the kernel client will assume its using v1 ports
and map operation will fail.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2023-02-15 12:46:40 +01:00
Travis Nielsen 5e0cf95228 Merge pull request #11627 from travisn/require-msgrv2
core: Option to require msgrv2 even without encryption
2023-02-10 10:58:22 -07:00
Travis Nielsen e7320ad63b mon: allow mons on msgr1 even if v2 settings required
Mons that are configured on msgr1 will be using the v1 port
in the csi driver since only one port is allowed in the configmap.
To allow mons to be started on v2 while keeping quorum with the
v1 mons, the v1 mons must continue running on the v1 port.
So even if msgr2 is required, allow existing v1 mons to continue
running on that port.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2023-02-10 09:38:09 -07:00
Travis Nielsen ab3209c140 helm: add labels and annotations to config overrides configmap
The default configmap does not have any labels or annotations
applied. If the helm chart is later updated to configure the
ceph config overrides, the configmap will fail to be created
by the chart since it doesn't have the needed label and helm
annotations so helm will know it can take over the resource
management.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2023-02-10 07:33:35 -07:00
Madhu Rajanna d1a86f6a63 core: unset messenger2 configuration
Unset encryption configuration and default
rbd map option when the encryption is not
enabled or it disabled after sometime.

Unset compression option also when the compression
is disabled.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2023-01-18 11:05:42 +01:00
Madhu Rajanna bc41df4dd8 core: set rbd_default_map_options for encryption
Set rbd_default_map_options to secure when encryption
is enabled or else set it to prefer-crc.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2023-01-12 10:02:15 +01:00
Travis Nielsen aa2c31f154 Merge pull request #11493 from parth-gr/external-errors
external: Dont call telemetry if the cluster is external
2023-01-03 10:14:50 -07:00
parth-gr a52e2f1794 external: dont call telemetry if the cluster is external
closes: https://github.com/rook/rook/issues/11470
Signed-off-by: parth-gr <paarora@redhat.com>
2023-01-02 20:41:40 +05:30
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
Travis Nielsen 1291885501 mon: use the assimilate mode for setall commands
The monstore has a SetAll method for applying multiple settings
that was applying them individually. Now we use the assimilate
config option to make this more efficient.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-11-03 10:23:10 -06:00
Travis Nielsen 0514547d56 mon: refactor helper to assimilate mon store settings
More settings can use the assimilate command if refactored
to a different go package.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-11-03 09:04:46 -06:00
Blaine Gardner 2965373ea9 Merge pull request #10898 from parth-gr/test-nfs
nfs: fix nfs if multus is enabled
2022-09-22 12:27:47 -06:00
parth-gr 26584fc6e5 core: update loadclusterInfo with multus check
if Multus is enabled the clusterinfo should be updated with
network as multus as to run the ceph cmds in remote
executor

Signed-off-by: parth-gr <paarora@redhat.com>
2022-09-22 14:46:51 +05:30
subhamkrai cfc5f19f92 core: use assimilate-conf command to run commands
this commit uses the ceph feature assimilate-conf to set
multiple configurations for ceph global/pods at one file and
use that in command to set the required configuration in one
line command.
for example:
`ceph config assimilate-conf -i <input file> -o <output file>`

Signed-off-by: subhamkrai <srai@redhat.com>
2022-09-15 17:53:58 +05:30
Jiffin Tony Thottan 5c8ca01bd0 object: adding support for sse s3 for RGW
The RGW support server side encryption with help of s3 protocol, till
now the `sse:kms` was support in which keys will be provided by the user
and but it will be saved in external management service like vault. Now
the support for `sse:s3` is added so the entire encryption key
management is performed by RGW itsels.

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2022-07-28 11:50:48 +05:30
Travis Nielsen e3256c07fe Merge pull request #10523 from leseb/fix-stuck-reconciler
core: fix stuck reconciler (more checkpoints for cancelled context)
2022-07-18 08:58:07 -06:00
Sébastien Han 247d725aac core: let IsInitialized return errors
Let's return an error instead of a bool so we can better parse it and
decide what to do with it.

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-07-12 12:07:57 +02:00