Commit Graph
930 Commits
Author SHA1 Message Date
Prabhala Tara Aasrita ebf90170bc pool: support CRUSH MSR rules for EC pools
Added failureDomains and osdsPerDomain fields to the
ErasureCodedSpec, which maps to the crush-num-failure-domains and
crush-osds-per-failure-domain Ceph EC profile parameters. This enables
creating EC pools that distribute chunks across fewer, larger hosts
without needing one host per data chunk.

Signed-off-by: Prabhala Tara Aasrita <taraprabhala@Prabhalas-MacBook-Pro.local>
(cherry picked from commit 715f38de91)
2026-07-28 19:46:04 +00:00
Joshua Hoblitt ac686a02c8 docs: fix typos and grammar in code comments
Fix duplicate words, incorrect articles (a/an), it's/its, and other small
grammar mistakes in Go comments and user-facing messages across pkg/, cmd/,
and tests/.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
(cherry picked from commit c0eb360041)
2026-07-01 09:23:27 -07:00
Joshua Hoblitt dcd4dfb2bd docs: fix function comments to match their declaration names
Several godoc comments led with a stale or incorrect identifier, left
over from renames, exported/unexported changes, copy-paste between
sibling declarations, or plain typos. As a result the documented name no
longer matched the function, method, type, or var it describes. Correct
each leading word to the name of the declaration it documents.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
(cherry picked from commit 49612461a4)
2026-06-29 19:04:45 +00:00
subhamkrai 87e7082d48 core: implement ceph health warning mute
this commit implement api to configure
ceph health warning mute/unmute.

Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit 9a6c5842bc)
2026-06-29 15:50:37 +00:00
Joshua Hoblitt c6329d6e7c core: remove unused OSDPerfStats type
The OSDPerfStats struct had no references anywhere in the repo (verified
with repo-wide grep and an exported-symbol audit); the code that consumed
this unmarshal target was removed long ago.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
(cherry picked from commit ef9761d4df)
2026-06-12 16:04:39 +00:00
Joshua Hoblitt 787c06701a multus: remove unused validation test config constructor
NewSharedStorageAndWorkerNodesValidationTestConfig was a wrapper that
simply returned NewDefaultValidationTestConfig() and had no callers
anywhere in the repo (verified with deadcode and repo-wide grep, tests
included). The sibling constructors are all referenced by the multus
validation CLI and remain.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
(cherry picked from commit 2433565238)
2026-06-12 16:04:39 +00:00
Joshua Hoblitt ecd4c4b742 core: remove unused ceph client helper functions
Remove four dead functions from pkg/daemon/ceph/client; none had any
callers anywhere in the repo (verified with deadcode, staticcheck U1000,
and repo-wide grep, tests included):

- auth.go: AuthGetOrCreate
- command.go: ExecuteRBDCommandWithTimeout
- filesystem.go: MarkFilesystemAsDown
- status.go: IsClusterCleanError (IsClusterClean itself remains in use)

No imports become unused by these removals.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
(cherry picked from commit 278453e10c)
2026-06-12 16:04:38 +00:00
Santosh c64524b96d osd: allow LVM logical volumes as OSD data devices
remov restrictions that prevented LVM logical volume from being
provisioned as OSDs. LV devices with a metadatadevice were rejected at
the filtering stage. LV devices without one were incorrectly being
routed to ceph-volume raw mode which was resuting in error. This PR:

- removes metadatadevice restriction on LV devices.
- Adds LVM time check to isSafeToUseRAWMode to prevent raw mode on lvm

Signed-off-by: Santosh <sapillai@redhat.com>
(cherry picked from commit c6d48178dd)
2026-05-26 15:47:16 +00:00
Joshua Hoblitt 1efea0123c core: rm unused consts
Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
(cherry picked from commit 9eec9c730e)
2026-05-20 15:03:03 +00:00
Sunnatillo a9c1805ae3 build: fix gosec and go vet lint errors for Go 1.26
Signed-off-by: Sunnatillo <sunnat.samadov@est.tech>
(cherry picked from commit 0bd299aa60)
2026-05-15 19:26:04 +00:00
Santosh 5916722cff pool: skip base rule creation of pools exit
createREplicatedPoolForApp creates a base Crush rule (named after the
pool) on every reconcile, even if the pool already exists and uses a
suffixed rule ( eg pool_host_ssd). This causes orphaned rules to
reappear after every operator restart, immediately after
CleanupUnusedCrushRules deletes them.

This PR ensures that the base rule is created only if the pool does not
exist yet.

Signed-off-by: Santosh <sapillai@redhat.com>
(cherry picked from commit df0f4e6c99)
2026-05-15 14:14:36 +00:00
Artem Torubarov 3872e1d0b7 osd: honor per-device deviceClass in raw-mode prepare and reconcile
Fixes #16834 and #17384. Per-OSD CR deviceClass was ignored in
osd prepare job when reporting the osd config back to the operator,
and in the operator's reconcile override.
Fixed by resolving the per-device class from the CR devices list
in GetCephVolumeRawOSDs and in makeDeployment.

Signed-off-by: Artem Torubarov <artem.torubarov@sap.com>
(cherry picked from commit b41d63788d)
2026-05-14 18:05:09 +00:00
subhamkrai 536909a58b pool: add stripe_unit with erasure-code-profile set
this commit adds flag stripe_unit for the command
ceph osd erasure-code-profile set [flags]. This key
increase perfomance for ec pool. The default value
is 4kib/4096 bytes.

Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit 9fb0582dd6)
2026-05-14 16:38:55 +00:00
mergify[bot] 3504b2b827 Merge pull request #17514 from rook/mergify/bp/release-1.20/pr-17502
core: skip crush rule cleanup if no pools exist yet (backport #17502)
2026-05-12 23:39:45 +00:00
immanuwell 551d62a2a2 docs: fix duplicated words in docs and comments
Clean up duplicated words and a typo in object storage docs, comments, and user-facing messages.

Signed-off-by: immanuwell <pchpr.00@list.ru>
(cherry picked from commit c3a9f5fdd9)
2026-05-12 22:41:48 +00:00
Santosh f09555f1a8 core: skip crush rule cleanup if no pools exist yet
During the initial cluster setup, CleanUnusedCrushRules() runs after MGR
startup but before any pools are created (if user does not create the
.mgr pool along with the cephCluster manifest). It deletes the default
replicated_pool since no pool references it.

This leaves the cluster in a state if Zero crush rules. When the MGR
tries to start the device_health_metris during this window, thne it
fails to find the crush rule and crashes.

Skip the cleanup when no pools exists yet, since there is nothing
meaninful to cleanup.

Signed-off-by: Santosh <sapillai@redhat.com>
(cherry picked from commit 1c1d6cf261)
2026-05-12 14:24:23 +00:00
Asish Kumar 0b3605dd84 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>
(cherry picked from commit 24a35e4e74)
2026-04-24 22:32:15 +00:00
Prabhala Tara Aasrita f1be5f1a1c 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>
(cherry picked from commit 85ee8631cf)
2026-04-24 08:39:55 +00:00
Denis Egorenko f06748de33 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>
(cherry picked from commit b3ffac9e0d)
2026-04-20 20:16:24 +00:00
Prabhala Tara Aasrita 952d86e27b 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>
(cherry picked from commit eccc8128af)
2026-04-17 16:25:30 +00:00
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