Commit Graph
858 Commits
Author SHA1 Message Date
Travis Nielsen 433a16c090 Merge pull request #15951 from OdedViner/target_size_ratio_negative
pool: support targetSizeRatio=0 and default compressionMode=""
2025-06-11 07:35:24 -06:00
Oded Viner dd65dc15d8 pool: support targetSizeRatio=0 and default compressionMode=""
allow targetSizeRatio == 0
enforce targetSizeRatio >= 0 via +kubebuilder:validation
set targetSizeRatio and compressionMode="" if unset
remove IsTargetRatioEnabled() and IsCompressionEnabled()

Signed-off-by: Oded Viner <oviner@redhat.com>
2025-06-11 12:36:19 +03:00
Blaine Gardner 029c345372 Merge pull request #15813 from BlaineEXE/auth-rotate
object: automate RGW cephx key rotation
2025-06-10 12:51:50 -06:00
Travis Nielsen 15ed0479a7 Merge pull request #15989 from parth-gr/fix-mirroring
rbdmirror: fix the nil point error check during status updates
2025-06-10 10:16:44 -06:00
Blaine Gardner 5f50e85a25 object: implement cephx key rotation for rgw keys
This is the first implementation of CephX key rotation in Rook.
Adds key rotation API from design PR 15915.

Also add helper methods for rotating keys, determining when keys
need to be rotated, and for generating CephX key statuses. These will be
reusable for other Rook reconciles beyond object/RGW.

Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
2025-06-10 09:06:58 -06:00
parth-gr 0b4f89873c rbdmirror: fix the nil point error check during status updates
the status  was still reading from the nil state,
updated the code to dont read from  nil object

Signed-off-by: parth-gr <partharora1010@gmail.com>
2025-06-10 20:24:53 +05:30
Santosh Pillai 2c1bb7443a Merge pull request #15796 from sp98/clean-osd-disks-from-old-clusters
osd: clean osd disks before reinstalling cluster
2025-06-09 14:03:49 +05:30
Santosh Pillai 2bcf196b15 osd: clean osd disks before reinstalling cluster
Allow force creation of OSD on a device previously configured in a different ceph cluster.
The OSD prepare pod job will zap the OSD disk using ceph-volume lvm zap
if that disk has metadata from a different ceph cluster.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2025-06-06 16:32:18 +05:30
Blaine Gardner d5c4eca3fb core: ensure consistent LeastUptodateDaemonVersion
LeastUptodateDaemonVersion() unmarshals Ceph's daemon versions JSON
output into `map[string]<type>` maps which are not guaranteed to iterate
in the same order as output by Ceph. Fix this method to no longer assume
iteration order is the same order as Ceph's output.

Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
2025-06-03 09:10:18 -06:00
subhamkrai d86aa28f30 osd: don't set dmcrypt env in prepare pod job spec
this commit remove the code which sets the dmcrypt encryption
key from secret as environment variable in the prepare pod job
spec. Now, the env will be set under function `setKEKinEnv`, which
tries to reads secret from k8s first method `c.IsK8s()`under
`GetSecret` and then check for KMS to ready and apply env directly.

Signed-off-by: subhamkrai <srai@redhat.com>
2025-05-29 14:31:33 +05:30
Carlos Barria c63ebbe0e3 core: fix golangci-lint check ST1019
This change cleans up and standardizes import statements across the Ceph operator code. It removes redundant or duplicate imports and reorganizes alias names for improved clarity and consistency. Additionally, the ST1019 exception was removed from .golangci.yaml now that the code complies with the rule.

Signed-off-by: Carlos Barria <cbarria@yahoo.com>
2025-05-27 17:38:22 -04:00
Carlos Barria 030ada45b0 core: fix golangci-lint check QF1003 QF1002
Refactored multiple conditional if-else blocks into switch statements to improve readability and maintainability. Also removed outdated staticcheck rule comments (QF1002, QF1003) from .golangci.yaml.

Signed-off-by: Carlos Barria <cbarria@yahoo.com>
2025-05-27 13:49:49 -04:00
Carlos Barria 8afc4ee548 core: fix golangci-lint check QF1004
Signed-off-by: Carlos Barria <cbarria@yahoo.com>
2025-05-22 11:21:45 -04:00
Carlos Barria 61494d1baf core: fix golangci-lint check ST1005
Signed-off-by: Carlos Barria <cbarria@yahoo.com>
2025-05-19 17:52:22 -04:00
parth-gr aa326a9419 rbdmirror: fix mirroring status on pool and rn
there is a change  from ceph on how the status
of the mirroring will look like,
Adopting with new fields so the status is correctly synced,
And other components might rely on the status too

Signed-off-by: parth-gr <partharora1010@gmail.com>
2025-05-14 13:07:24 +05:30
Travis Nielsen 530223c5b4 namespace: add conditions blocking deletion for rados namespace
When a rados namespace is deleted, it cannot be purged
until its images and snapshots are deleted. Now a condition
is being added to the rados namespace CR status so the user
does not need to read the operator log to discover the cause.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2025-05-07 15:42:17 -06:00
Travis Nielsen 0a3a599580 block: add condition for deletion blocked with images
When the blockpool is deleted and there are images or
snapshots in the pool, the deletion is blocked by the
finalizer until they are all removed. The condition added
to the cephblockpool status only indicated if there were
radosnamespace dependencies. A new condition is now added
to describe if there are images or snapshots.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2025-05-07 15:42:17 -06:00
Santosh Pillai b9b34e56df Merge pull request #15761 from sp98/fix-mpath-osd-destroy
osd: fix osd disk cleanup for mpath setups
2025-04-28 13:45:52 +05:30
Santosh Pillai 1e9da0766e osd: fix osd disk cleanup for mpath setups
ceph-volume raw list will return the main disk instead of the mpath
setup. `ceph-volume lvm zap` on the main disks fails. This PR uses
`lsblk /mnt/<diskreference> ` to fetch the actual mapath disk and use it
for cleaning

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2025-04-22 12:40:08 +05:30
Blaine Gardner 5b27189ac4 core: update cephstatus fsmap gid type to uint64
Ceph uses uint64 (unsigned long) type for CephFS GID. Rook was using
int, which was causing failures when the GID overflowed Rook's type.
Update Rook's type to match Ceph's.

Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
2025-04-10 12:28:23 -06:00
parth-gr 0c5d3ee3a5 rbdmirror: fix the rados namespace health checkup
there was very edge case,a nd that result in nil
point exception
During osd upgrades if mirror health check is called
the mirror status cmd doesnt respond
So its important to check if the value exist
before getting its summary

Signed-off-by: parth-gr <partharora1010@gmail.com>
2025-04-09 14:57:55 +05:30
subham rai 3e1302a472 Merge pull request #15610 from alingse/patch-1
fix call errors.Wrapf with a nil value error after check another err
2025-04-02 20:32:07 +05:30
Blaine Gardner 2348ff689c Merge pull request #15459 from subhamkrai/implicit-ns
rbdmirror: mirroring b/w implicit and defined ns
2025-04-01 12:56:06 -06:00
subhamkrai 420178fe3e rbdmirror: mirroring b/w implicit and defined ns
this commit add support for mirroring b/w implicit rados namespace and
defined rados namespace. To support this, rook will treat `<implicit>`
name on cephblockpool as `""` empty string. This will allow mirroring
b/w implicit and defined radosnamespace.

Signed-off-by: subhamkrai <srai@redhat.com>
2025-04-01 10:46:06 +05:30
alingse fe225bdcae cephfsmirror: fix use wrong err
Signed-off-by: alingse <alingse@foxmail.com>
2025-03-30 05:01:37 +00:00
Joshua Hoblitt b721c30dd1 core: fix golangci-lint warn caused by comment in nolint directive
Resolves this warning:

    WARN [runner/nolint_filter] Found unknown linters in //nolint directives: just configuration keys., value not credential

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2025-03-27 09:43:16 -07:00
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
Santosh Pillai a816b4a971 osd: allow one healthy OSD to be drained
One ore more OSDs can be down and PGs can still be active+clean (data
was rebalanced to other available OSDs). This PR sets
maxunavailable=1+downOSDs to allow one healthy to be drained.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2025-03-26 10:40:46 +05:30
Madhu Rajanna 9eb218f848 core: dont overwrite err incase of stderr
dont overwrite err incase of stderr

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2025-03-13 15:33:33 +01:00
Artem Torubarov 0b2e830111 mon: support external mons in local rook cluster
Implements #14733. Allows to set IDs of external mons to
Cluster CRD. Rook will not remove external mons from quorum
and will add external mon addresses to mon endpoints.
Use-case for external mon is to maintain quorum for 2-AZ
k8s cluster in case of zone outage.

Signed-off-by: Artem Torubarov <artem.torubarov@clyso.com>
2025-03-03 14:49:39 +01:00
Travis Nielsen e068e156ce osd: enable osd ok-to-stop checks on single node for three osds
If there are at least three OSDs on a single node, we should
treat it as a potential production cluster and perform
the ok-to-stop checks during reconcile. Otherwise,
it may cause instability during upgrades on
single-node clusters.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2025-02-05 12:08:48 -07:00
Travis Nielsen 16daa7dc44 Merge pull request #15184 from OdedViner/err_msg_ok_to_stop
operator: improve operator error logging for ok-to-stop failures
2025-01-24 08:13:20 -07:00
Eng Zer Jun e68a7ea561 build: replace golang.org/x/exp/slices with stdlib slices
The experimental functions in `golang.org/x/exp/slices` are now
available in the standard library in Go 1.21.

Reference: https://go.dev/doc/go1.21#slices
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2025-01-21 15:02:35 +08:00
Oded Viner 3d7f5cff65 operator: improve operator error logging for ok-to-stop failures
this PR improves the error logging when ok-to-stop requests fail
in the Rook operator. Instead of only showing a generic exit status

Signed-off-by: Oded Viner <oviner@redhat.com>
2025-01-19 14:46:57 +02:00
Michael Adam 26b4fb06d5 core: add function roundupSizeMiB
This change  refactors inline roundup code to a function
roundup_size_MiB that takes a size(in bytes) as argument and returns
the smallest number of Mibibytes larger than or equal to the given size.

Signed-off-by: Michael Adam <obnox@samba.org>
2024-12-16 15:30:47 +01:00
df511fb58f ci: update golangci-lint to the latest version (v1.62)
The ci was using a pretty old version og golangci-lint.
This updates to the latest version.

Additionally, it  silences some
gosec integer conversion overflow false positves
and fixes some real errors of this category
 and string format errors found by golangci-lint, while at it.

Co-authored-by: Blaine Gardner <b.blaine.gardner@gmail.com>
Co-authored-by: Travis Nielsen <tnielsen@redhat.com>
Signed-off-by: Michael Adam <obnox@samba.org>
2024-12-14 14:47:30 +01:00
Santosh Pillai 85c81946ce osd: enable encryption as day-2 operation
Migrate OSDs to enable encryption as day-2 operation.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2024-12-06 09:33:03 +05:30
Travis Nielsen 324df99be8 Merge pull request #15066 from parth-gr/fix-osd-deviceclass
osd: fix device class label on osd pod
2024-12-05 16:20:47 -07:00
parth-gr 01456e8683 osd: add a new devicetype label for osds
currently device class and device type
labels were clubbed with eachother
create a seperate label, as these two labels
can be seperate

Signed-off-by: parth-gr <partharora1010@gmail.com>
2024-12-05 16:56:04 +05:30
parth-gr 7413b49a86 osd: fix device class label on osd pod
we were adding the device class as the
disk rotational type, but device class
can be user defined, so if user has
added the device class, use that value

Signed-off-by: parth-gr <partharora1010@gmail.com>
2024-12-04 18:08:00 +05:30
parth-gr 996a88f902 rbdmirror: rbd import cmd stuck forever
if the import from the peer cluster doesnt
work, because of some reasons like
cluster health, network, etc

the import cmd stuck forever and which
forever stucks the blockppol reconcile

Signed-off-by: parth-gr <partharora1010@gmail.com>
2024-11-25 17:04:11 +05:30
parth-gr ed5013e9c6 rbdmirror: add disable check for status check
enable and disable the status of rados namespace
mirroring by looking at statusCheck spec of blockpool

Signed-off-by: parth-gr <partharora1010@gmail.com>
2024-11-06 22:42:46 +05:30
Travis Nielsen 7692cae359 Merge pull request #14896 from parth-gr/rbd-mirror-rados-monitor
rbd: enable periodic monitoring for rados namespace mirroring
2024-11-05 09:15:32 -07:00
parth-gr 9785ef5c8d rbdmirror: enable periodic monitoring for rados namespace
enable monitoring for rados namespace

Signed-off-by: parth-gr <partharora1010@gmail.com>
2024-11-05 13:45:02 +05:30
Travis Nielsen 99d60c5bba mds: wait for mds standby upgrade for same fs
The upgrade of the mds daemons pauses to wait for the
stopping of standby daemons before the filesystem upgrade
is completed. If there are multiple filesystems, there
could be standbys for other filesystems that will not be
stopped at the time of the upgrade of another filesystem.
Thus, the standbys may not upgrade and be stuck on the
previous version. Now, the standby upgrade will only wait
for standbys for the same filesystem.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2024-11-01 14:03:13 -06:00
Travis Nielsen 3b94c50d8b Merge pull request #14818 from iPraveenParihar/kms/vault-keyrotation
kms: key rotation support for vault kms
2024-10-24 11:38:33 -06:00
Madhu Rajanna 4e29717317 core: cleanup blockpool with annotation
This is similar to #14052 we did for radosnamespace
and this is an extension to support cleanup
at the blockpool level to cleanup the images
and the snapshots in a pool.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2024-10-23 12:20:31 +02:00
Praveen M d8c0242c29 security: key rotation support for vault kms
Signed-off-by: Praveen M <m.praveen@ibm.com>
2024-10-23 11:43:49 +05:30
Travis Nielsen 0fa21969df Merge pull request #14701 from parth-gr/rbd-mirror-rados
rbdmirror: enable rbd rados namespace mirroring
2024-10-10 09:35:22 -06:00
parth-gr 2cef47a9b7 rbdmirror: enable rbd rados namespace mirroring
Modify the CR to allow mirroring of an rados namespace
to a differently named namespace on the remote cluster

1) enable rados namesapce mirroring only
if the blockpool mirrroing is enabled

2) disable blockpool mirroing only if
all the namesapce mirroing is disabled

if the rbd mirroring fails and ceph version is not supported
provide a error message with supported version details
and reason of failing

Signed-off-by: parth-gr <partharora1010@gmail.com>
2024-10-10 14:23:11 +05:30