Commit Graph
914 Commits
Author SHA1 Message Date
Asish Kumar 24a35e4e74 pool: clean up unused crush rules
Clean up stale CRUSH rules after the Ceph mgr starts so rules left behind by pool failure-domain or device-class changes do not accumulate indefinitely.

The cleanup is guarded by a package-level RWMutex. Pool create and update paths hold the read lock while creating and assigning CRUSH rules, while cluster-wide cleanup holds the write lock before listing pools and deleting unused rules. This keeps pool reconciles parallel with each other while preventing cleanup from deleting a rule that another reconcile has just created but not yet attached to a pool.

Keep direct pool-delete cleanup for the pool's current CRUSH rule, make the cluster-wide cleanup best-effort across all unused rules, and add an operator-level ROOK_DELETE_UNUSED_CRUSH_RULES setting for clusters that need to leave unused custom rules in place.

Document the operator and Helm settings, regenerate the Helm chart docs, and add a pending release note for the default cleanup behavior.

Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
2026-04-24 23:57:40 +05:30
Prabhala Tara Aasrita 85ee8631cf osd: fix KMS log error format specifier
During OSD provisioning, the KMS error log incorrectly uses logger.Error() instead of logger.Errorf(), causing the format specifier %q to appear in the logs. Changed logger.Error to logger.Errorf to fix the same.

Signed-off-by: Prabhala Tara Aasrita <taraasrita@ibm.com>
2026-04-23 16:19:33 +05:30
Denis Egorenko b3ffac9e0d mds: fix incorrect behaviour for CephFS health state when no active standby
Set expected standby mds daemons, when changing activeStandby mds parameter.

Resolves #17372

Signed-Off-By: Denis Egorenko <degorenko@mirantis.com>
2026-04-20 13:09:41 +04:00
Prabhala Tara Aasrita eccc8128af mon: mute MON_NETSPLIT health warning in stretch clusters
Ceph incorrectly raises the MON_NETSPLIT health warning in stretch cluster configurations. Added a call to MuteHealthWarning() in postMonStartupActions() which runs `ceph health mute MON_NETSPLIT --sticky` to suppress the warning during reconcile. All errors are logged as warnings and the reconcile proceeds.

Signed-off-by: Prabhala Tara Aasrita <taraasrita@ibm.com>
2026-04-17 19:29:03 +05:30
Santosh c6836c474a rgw: support SSE-S3 with vault agent
Support using SSE-S3 encryption with RGW using vault Agent auth.
RGW sends requests to the agent instead of directly to Vault, and the agent transparently injects the authentication token. This eliminates using and managing a static token

Signed-off-by: Santosh <sapillai@redhat.com>
2026-04-07 12:18:29 +05:30
Blaine Gardner 170077bdfe Merge pull request #17225 from sp98/forceful-osd-cleanup
osd: zap disks for forceful OSD installation
2026-03-26 12:45:38 -06:00
Santosh 92324588ba osd: zap disks for forceful OSD installation
When cephCluster is resinstalled and WipeDevicesFromOtherClusters is set
to true, then Rook cleans up the OSD disks using ceph-volum lvm zap, so
that new OSD can created on this disk. This PR removes the dependencies
of the "ceph-volume lvm zap" and provides implements the entry disk
"ceph-volume lvm zap" logic within rook

Signed-off-by: Santosh <sapillai@redhat.com>
2026-03-26 11:28:43 +05:30
Travis Nielsen 51adb471f3 osd: remove obsolete osd methods
Remove helper methods for querying and configuring
various osd settings that are no longer in use anywhere
in Rook

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2026-03-24 11:09:42 -06:00
Oded Viner b88648d10f pool: clean up erasure code profile on pool deletion
deleting an erasure coded CephBlockPool left the ec profile
orphaned. recreating with different settings failed because
the old profile could not be overridden.
- delete ec profile during CephBlockPool deletion
- disable --format json on ec profile set command
- fix ec profile name mismatch in CephObjectStore deletion

Signed-off-by: Oded Viner <oviner@redhat.com>
2026-03-18 23:53:57 +02:00
Artem Torubarov 845293c3cd rgw: not update shared pools if prev pool is not empty
Signed-off-by: Artem Torubarov <artem.torubarov@sap.com>
2026-03-04 14:36:38 +01:00
Satoru Takeuchi b2def4c4d6 Merge pull request #17123 from sp98/fix-forceful-osd-deletion
osd: check devlinks while cleaning osd disks
2026-02-27 18:01:19 +09:00
Santosh 475fc7c7a6 osd: check devlinks while cleaning osd disks
In getOSDDiskToBeWiped(), when the RealPath doesn't match the device path reported by ceph-volume, also check each entry in the space-separated DevLinks string. This handles the case where ceph-volume raw list reports an LVM symlink (e.g. /dev/rhel/ceph-data) that differs from the resolved RealPath (e.g. /dev/mapper/rhel-ceph--data).

Signed-off-by: Santosh <sapillai@redhat.com>
2026-02-26 20:07:10 +05:30
Satoru Takeuchi 6f8b2aee94 osd: fix osd on multipath device with metadata device
OSDs are created with `ceph-volume lvm batch` if `metadataDevice`
field is specified in CephCluster CR. Since this command does not
support kernel names (e.g. `/dev/dm-X`) for multipath devices,
we should use real names (e.g. `/dev/mapper/mpathX`) instead.

NOTE:
I intentionally keep raw mode OSD creation code as is
because `ceph-volume raw prepare` supports kernel names
for any devices.

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

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2026-02-18 08:03:08 +00:00
dependabot[bot] 3c51e808f2 build(deps): bump the k8s-dependencies group with 6 updates
Bumps the k8s-dependencies group with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [k8s.io/api](https://github.com/kubernetes/api) | `0.34.2` | `0.34.3` |
| [k8s.io/apiextensions-apiserver](https://github.com/kubernetes/apiextensions-apiserver) | `0.34.2` | `0.34.3` |
| [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) | `0.34.2` | `0.34.3` |
| [k8s.io/cli-runtime](https://github.com/kubernetes/cli-runtime) | `0.34.2` | `0.34.3` |
| [k8s.io/client-go](https://github.com/kubernetes/client-go) | `0.34.2` | `0.34.3` |
| [k8s.io/cloud-provider](https://github.com/kubernetes/cloud-provider) | `0.34.2` | `0.34.3` |

Updates `k8s.io/api` from 0.34.2 to 0.34.3
- [Commits](https://github.com/kubernetes/api/compare/v0.34.2...v0.34.3)

Updates `k8s.io/apiextensions-apiserver` from 0.34.2 to 0.34.3
- [Release notes](https://github.com/kubernetes/apiextensions-apiserver/releases)
- [Commits](https://github.com/kubernetes/apiextensions-apiserver/compare/v0.34.2...v0.34.3)

Updates `k8s.io/apimachinery` from 0.34.2 to 0.34.3
- [Commits](https://github.com/kubernetes/apimachinery/compare/v0.34.2...v0.34.3)

Updates `k8s.io/cli-runtime` from 0.34.2 to 0.34.3
- [Commits](https://github.com/kubernetes/cli-runtime/compare/v0.34.2...v0.34.3)

Updates `k8s.io/client-go` from 0.34.2 to 0.34.3
- [Changelog](https://github.com/kubernetes/client-go/blob/master/CHANGELOG.md)
- [Commits](https://github.com/kubernetes/client-go/compare/v0.34.2...v0.34.3)

Updates `k8s.io/cloud-provider` from 0.34.2 to 0.34.3
- [Commits](https://github.com/kubernetes/cloud-provider/compare/v0.34.2...v0.34.3)

---
updated-dependencies:
- dependency-name: k8s.io/api
  dependency-version: 0.34.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/apiextensions-apiserver
  dependency-version: 0.34.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/apimachinery
  dependency-version: 0.34.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/cli-runtime
  dependency-version: 0.34.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/client-go
  dependency-version: 0.34.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
- dependency-name: k8s.io/cloud-provider
  dependency-version: 0.34.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: k8s-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-07 07:59:21 -07:00
Jongwoo Han d59b4dcb84 core: replace custom contains() with slices.Contains()
Signed-off-by: Jongwoo Han <jongwooo.han@gmail.com>
2025-12-24 13:28:05 +09:00
subhamkrai 304cdc8c83 core: remove support for reef v18 in Rook v1.19
For Rook v1.19,removing support for Ceph Reef. It is at end of life.
Users on Reef can continue to use Rook v1.18.x or older.
The latest two Ceph versions Squid and Tentacle are supported.

Signed-off-by: subhamkrai <srai@redhat.com>
2025-12-04 13:11:35 +05:30
Travis Nielsen f252bf68af Merge pull request #16713 from sp98/allow-snaptrim-wait-pg-for-PDBs
osd: support snaptrimp and snaptrip_wait pgs
2025-11-17 10:10:20 -07:00
Santosh Pillai c0eb34815f osd: support snaptrimp and snaptrip_wait pgs
If the ceph status is "active+lean+snaptrimp" or
"ative+clean+snatrip_wait" , the the PDB controller should treat this
ceph staus as healthy and don't block the node drain

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2025-11-14 11:07:06 +05:30
Travis Nielsen 9a79a48f9e Merge pull request #16661 from subhamkrai/fix-rns-race-condition
namespace: add retryOnConflict when updating status
2025-11-13 10:38:17 -07:00
huyejia a6239dedfe osd: replace Split in loops with more efficient SplitSeq
Signed-off-by: huyejia <huyejia@outlook.jp>
2025-11-12 16:52:12 +08:00
subhamkrai c8ee7305d4 namespace: add retryOnConflict when updating status
currently, in RNS crd while updating status we don't
have retryOnConflicts, similar to other CRD due to
this RNS status was not updated succesfully and to
fix this we have restart the rook operator pod.

Signed-off-by: subhamkrai <srai@redhat.com>
2025-11-12 10:16:43 +05:30
Joshua Hoblitt 43f26534ed osd: add CephCluster.spec.storage.OSDMaxUpdatesInParallel
Configures the maximum number of OSDs to update in parallel.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2025-11-03 12:10:28 -07:00
Travis Nielsen 938380734d pool: skip setting the target size ratio to 0 by default
The target size ratio is currently always being set to 0, when
neither the legacy targetSizeRatio nor the parameter for
target_size_ratio are set. In this case, we should not set it to 0,
but rather should skip the command to set the target size ratio.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2025-10-15 11:58:36 -06:00
Travis Nielsen c069e73c91 Merge pull request #16520 from parth-gr/fix-rn-status
rbdmirror: fix mirroring monitoring settings for rn
2025-09-26 14:48:01 -05:00
parth-gr 49c26dbfb0 rbdmirror: fix mirroring monitoring settings for rn
currently if we disable the monitoring for rn,
it doesnt reset the status

Signed-off-by: parth-gr <partharora1010@gmail.com>
2025-09-25 19:26:52 +05:30
Travis Nielsen 66ca9716b8 Merge pull request #16532 from Madhu-1/fix-16480
namespace: blocklist ip:nonce in cleanup job
2025-09-24 11:57:28 -05:00
Madhu Rajanna 5ae49cf7a0 namespace: blocklist ip:nonce in cleanup job
blocklisting IP can cause problems when the cleanup
job pod runs on the same host or gets the same ip
as that of the rbd client ip that is present in
the rbd status/watchers. instead of blocklisting
the whole ip of the node or the client blocklist
only the unique ip:nonce to allow the node to not
have any effect because of the cleanup job.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2025-09-24 12:47:48 +02:00
Travis Nielsen cbbe9b07b0 Merge pull request #16488 from sp98/fix-forceful-encrypted-osd-creation
osd: clean encrypted disks from other clusters
2025-09-23 15:02:39 -05:00
Santosh Pillai ec271bdde3 osd: clean encrypted disks from other clusters
Clean encrypted disks from other clusters by checking the cephFSID in
the luks header.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2025-09-23 11:29:09 +05:30
Travis Nielsen df49ca1247 pool: allow enablecrushupdates to be nil
Enabling crush updates is false by default, and can be enabled
if set to true. The setting needs to be nullable in case
we need to differentiate between the value being set
to false or just not set, to know if the default should be
different. This is necessary for rook consumers who are
refererencing the pool struct and want to change the default,
rather than using rook's default value of false.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2025-09-11 16:40:37 -06:00
parth-gr 794a232835 osd: remove the osd bootstrap keyring
when the osd is created there is no need for
osd bootstrap keyring, so remove the keyring
and keyring file,

New keyring will be created if
new osd need to be provisoned

Signed-off-by: parth-gr <partharora1010@gmail.com>
2025-09-03 21:41:52 +05:30
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
Denis Egorenko c9e0f89a8b pool: fix cephblockpool remove when related pool is already removed from cluster
When removeing CephBlockPool check first that related ceph pool is exist in cluster,
since it may be manually removed by mistake.

Related-Issue: #16328
Signed-off-by: Denis Egorenko <degorenko@mirantis.com>
2025-08-15 22:59:34 +04:00
subham rai 70f465745b Merge pull request #16272 from Madhu-1/fix-filepath
core: use filepath.Join instead of path.Json and add unit testing for cleanup functions
2025-08-12 14:59:40 +05:30
Blaine Gardner 59ca78229d Merge pull request #16075 from sp98/mirror-key-rotation
rbd mirror peer key rotation
2025-08-11 10:54:20 -06:00
Santosh Pillai ee0b137d75 core: rotate rbd mirror peer key
rotate the client.rbd-mirror-peer key based on the cephxconfig.
Also update the cephxStatus in the cephcluster as well as the
mirrored cephblockpool.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2025-08-11 21:53:14 +05:30
Madhu Rajanna 878603ba25 core: add unit testing for cleanup
Adding unit testing for cleanup
functions.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2025-08-08 12:55:23 +02:00
Madhu Rajanna 4501c86d9f core: use filepath instead of path
using filepath instead of path to
join the filepath as path is usually
used for URL not for files.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2025-08-08 12:46:25 +02:00
Oded Viner 87165cc6d1 core: cleanup csi-related folders from /var/lib/rook during uninstall
delete csi-related directories from /var/lib/rook that
match the suffix `.csi.ceph.com`.
these folders were used in earlier versions when rook managed
cephcsi directly. in later versions, logs and data are redirected
to /var/lib/cephcsi, but legacy paths may still exist and require
cleanup during uninstall.
this change improves cleanup completeness for odf 4.18 and earlier.

example of directories removed:
- /var/lib/rook/openshift-storage.cephfs.csi.ceph.com
- /var/lib/rook/openshift-storage.rbd.csi.ceph.com

Signed-off-by: Oded Viner <oviner@redhat.com>
2025-08-07 18:54:54 +03:00
Benoît Knecht d7f08693ed core: set erasure-code-profile plugin based on pool algorithm
When a `CephBlockPool` defines `spec.erasureCoded.algorithm`, use it as
the erasure-code-profile plugin.

Until now, that parameter would have been ignored completely, and every
erasure-coded pool would use the same plugin as the `default`
erasure-code-profile (i.e. `jerasure`).

Note that using any algorithm other than `jerasure` or `isa` is likely
to fail given the current implementation, as different algorithm require
different sets of parameters, and those cannot be supplied by the
user.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
2025-08-04 15:59:24 -06:00
Oded Viner 5992415b36 core: improve cleanup of /var/lib/rook during cluster teardown
extend StartHostPathCleanup to remove additional directories
under /var/lib/rook

Signed-off-by: Oded Viner <oviner@redhat.com>
2025-07-31 19:14:24 +03:00
Travis Nielsen 79a7a3c01f rgw: increase timeout for admin user creation
Creating the rgw admin user is taking on the order of two
minutes instead of the expected seconds, thus the command
was timing out and cause the object store user creation
to fail. The increased timeout allows the admin user creation
to complete, and other users to be created as well.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2025-07-30 12:22:07 -06:00
Santosh Pillai c615967fa8 Merge pull request #16040 from subhamkrai/rotate-csi-keyrings
csi: automate CSI cephx key rotation
2025-07-29 11:09:50 +05:30
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
subhamkraiandMadhu Rajanna fb1047eb10 rbdmirror: with multus gen file on remote container
In case of RDR with multus, the file which contains peer
connection details need to generated on mgr proxy remote
since rbd commands in multus, commands are run via mgr
proxy container and not the rook operator pod.

Co-Authored-by: Madhu Rajanna <madhupr007@gmail.com>
Signed-off-by: subhamkrai <srai@redhat.com>
2025-07-24 12:27:52 +05:30
Travis Nielsen 009e8eb254 Merge pull request #15666 from puskunalis/cleanup-fix-disk-shredding
osd: fix cleanup job disk shredding
2025-07-10 10:28:46 -06:00
subhamkrai 2742a707cc operator: add missing udev env to discover pod
currently, we're setting the env `DISCOVER_DAEMON_UDEV_BLACKLIST`
in operator.yaml but we're not reading from the operator env and
setting the value to discover pod env.

Signed-off-by: subhamkrai <srai@redhat.com>
2025-07-08 17:13:01 +05:30
Vilius Puškunalis 27010f96f3 osd: fix cleanup job disk shredding
Fixes quick disk shredding by using dd to shred data at additional offsets where ceph metadata is duplicated. For full shred, the shred utility remains in use.

Signed-off-by: Vilius Puškunalis <47086537+puskunalis@users.noreply.github.com>
2025-06-23 21:46:41 +03:00
Kyori Sakao 015e4f4ecf osd: remove redundant err check
remove redundant nested `if err != nil` checks

Signed-off-by: Kyori Sakao <system.222.down@gmail.com>
2025-06-19 10:08:33 +09:00
Travis Nielsen c8e40d4da2 Merge pull request #16009 from sp98/fix-rns-deletion
rbd: blocklist rns image watchers
2025-06-17 11:35:55 -06:00