Commit Graph
5036 Commits
Author SHA1 Message Date
Travis Nielsen aa61ddb57e mon: failover with host network must use different node
When a mon is failed over, the old mon is left in mon quorum
until the new quorum is confirmed in quorum. When host networking
is enabled, this may result in two mons being in quorum with the
same ip, if the new mon is scheduled on the same node as the
down mon. This results in daemon crashes in the cluster since
they are confused by multiple of the same ip in the mon map.

The solution is to avoid scaling down the bad mon when host networking
is enabled. This will ensure the new mon is not scheduled on the
same node as the previous mon. With host networking, either another
node is necessary or the original mon must come back online to
restore quorum.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2025-07-10 10:13:17 -06:00
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
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
Travis Nielsen a00c6fba64 Merge pull request #15846 from patrostkowski/fix/mon-run-as-root-15564
mon: allow running mon pods as root
2025-07-07 16:08:48 -06:00
Santosh Pillai 9b742c781a object: fail if keys didn't rotate
Fail the reconcile if rgw key rotation fails. Currnetly we are just
logging it.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2025-07-04 12:21:45 +05:30
Elias Carter 5f2d6c01d7 osd: treat non existing OSD nodes as drained
If the node for an OSD does not exist within kubernetes, the PDB
reconciliation logic will fail to make progress. This can be problematic
as new OSDs added to the cluster may not be protected by OSD PDBs after
they are added since the PDB reconcilation logic is failing.

The solution is to treat non existing OSD nodes as drained which is
logically consistent with treating unschedulable OSD nodes as drained as
you cannot schedule a pod onto a node which does not exist.

Fixes: #16086

Signed-off-by: Elias Carter <elias@dropbox.com>
2025-07-02 18:41:24 +00:00
raaizik 1b3f36ff5c core: fix CephObjectRealm controller generated generated AccessKey invalid chars
Suggested fix for issue https://github.com/rook/rook/issues/16072
Adds key type differentiation to exclude invalid characters from AccessKey

Signed-off-by: raaizik <132667934+raaizik@users.noreply.github.com>
2025-07-01 18:32:48 +03:00
Madhu Rajanna 5094b1f5e6 csi: provide a flag to manage csi users
Added a flag in cephcluster CR CSI section
whether the user wants the Rook to manage
the csi users and secrets or create them on own.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2025-06-27 20:03:04 +00:00
Blaine Gardner 936aa05584 Merge pull request #16059 from Madhu-1/skip-csi-user-creation
ceph: Provide an option to specify the secretName in the cephClient CR
2025-06-27 13:49:30 -06:00
Madhu Rajanna d37297475e core: update secret handling for cephclient
If RemoveSecret is set remove the secret.
if not set, do below
check if the current cephClient is owner if
secret is present, if not return as its owned
by other controller, if its not present create
or update the secret.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2025-06-27 21:25:48 +02:00
Madhu Rajanna d6d2e604fc core: provide option to specify secret name
When cephClient CR is created by User, the Rook
is creating an User and creating an secret with
its own predefined name + CR name, With this we
are allowing user to specify the secretName

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2025-06-27 16:44:23 +02:00
Travis Nielsen d6ebc96be9 Merge pull request #16025 from Nordix/add-host-network-cephexporter/adil
exporter: Add Hostnetwork bool to ceph-exporter
2025-06-24 14:49:36 -06:00
Muhammad Adil Ghaffar 5ea7a177b7 exporter: add hostnetwork bool to cephexporter
Signed-off-by: Muhammad Adil Ghaffar <muhammad.adil.ghaffar@est.tech>
2025-06-24 23:17:51 +03:00
Travis Nielsen f69f704d32 Merge pull request #16050 from Madhu-1/csi-3.14.1
csi: update csi version to 3.14.1
2025-06-24 10:39:42 -06:00
subham rai eaa71a6003 Merge pull request #16042 from subhamkrai/skip-updating-csi-config-cm
csi: test skip updating rook-ceph-csi-config cm
2025-06-24 15:58:38 +05:30
Madhu Rajanna aa8fd61986 csi: update csi version to 3.14.1
Updating the cephcsi version to v3.14.1
release.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2025-06-24 11:46:14 +02:00
subhamkrai b4e7fd3926 csi: test skip updating rook-ceph-csi-config cm
When the csi-operator is enabled no need to update
the cm rook-ceph-csi-config configmap.
Otherwise operator will complain about the error
```yaml
ceph-cluster-controller: failed to reconcile CephCluster "rook-ceph/rook-ceph". failed to reconcile cluster "rook-ceph": failed to configure local ceph cluster: failed to create cluster: failed to start ceph monitors: failed to initialize ceph cluster info: failed to save mons: failed to update csi cluster config: waiting for CSI config map to be created: configmaps "rook-ceph-csi-config" not found
```

Signed-off-by: subhamkrai <srai@redhat.com>
2025-06-24 15:09:16 +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
Oded Viner 8249a28145 object: allow deletion of CephObjectStoreUser even if secret is missing
skip key generation during reconcile if CephObjectStoreUser is
being deleted to allow cleanup when referenced secret is missing

Signed-off-by: Oded Viner <oviner@redhat.com>
2025-06-22 09:14:50 +03:00
Blaine Gardner c3ee142866 Merge pull request #16003 from BlaineEXE/osd-allow-manual-rotation
osd: load latest cephx key during osd pod init
2025-06-19 13:57:36 -06: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
Blaine Gardner 2c7a5f156b osd: load latest cephx key during osd pod init
Create a new OSD pod init container that loads the latest CephX key for
the OSD. The init container must be run after OSD activation, due to
keyfile reset behavior of ceph-bluestore-tool, used during activation.

The primary purpose of this work is to allow OSDs to start and run
correctly after key rotation, whether done manually by users or
automatically by future Rook work.

This work makes redundant prior code changes done in #14826. The CI test
added in the prior work is kept to ensure no regression.

Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
2025-06-18 10:49:19 -06: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
Santosh Pillai 98475e847e pool: blocklist rns image watchers
When force-deletion annotation is added to CephRadosNamespace CR, then
blocklist any watchers on the Namespace images in order to remove the
image from the trash

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2025-06-17 21:21:33 +05:30
Travis Nielsen 55c3e4d249 Merge pull request #15997 from subhamkrai/fix-code-syntax
osd: code cleanup in getSecret method
2025-06-17 07:39:31 -06:00
subhamkrai 0123ab0ab3 osd: code cleanup in getSecret method
This change refactors the getSecret method somewhat toward cleaner code.
The only additional change in behavior is the introduction of a switch instead
of multiple if's and error treatment of the case of an empty secret.

Signed-off-by: subhamkrai <srai@redhat.com>
2025-06-17 17:16:48 +05:30
subham rai 3bca305a64 Merge pull request #16013 from travisn/contains-images
namespace: Report empty condition for rados namespace
2025-06-17 10:01:41 +05:30
Patryk Rostkowski 7f3e6bd7fa mon: allow running mon pods as root
This change addresses a permission issue where mon pods crashloop
on some Kubernetes setups with SELinux enabled, even when
ROOK_HOSTPATH_REQUIRES_PRIVILEGED is set.

To resolve this, a new function makeMonSecurityContext() was introduced
to explicitly set runAsUser: 0 at the pod level for mon pods
when the environment variable ROOK_CEPH_MON_RUN_AS_ROOT is set to true.

Additionally, the function previously named PodSecurityContext() was renamed
to DefaultContainerSecurityContext() to avoid confusion between
container-level and pod-level security context configuration. All container
SecurityContext usages across Ceph daemons were updated to reflect this change.

This ensures the root user configuration is applied
automatically and consistently in environments where it is required
for mon pod startup, while preserving clear separation of container
and pod-level security logic.

Signed-off-by: Patryk Rostkowski <patrostkowski@gmail.com>
2025-06-16 18:29:31 +02:00
Travis Nielsen d7d399819d Merge pull request #16000 from OdedViner/delete-csi-cm
csi: delete rook-ceph-csi-config if csi operator is enabled
2025-06-16 10:27:53 -06:00
Oded Viner 0a9100be83 csi: delete rook-ceph-csi-config if csi operator is enabled
removes the rook-ceph-csi-config configmap when
switching to external csi operator

Signed-off-by: Oded Viner <oviner@redhat.com>
2025-06-15 12:48:24 +03:00
Travis Nielsen b47f297608 namespace: report empty condition for rados namespace
The rados namespace status was not reporting if the namespace
was empty. Now the condition will be properly updated if
it is empty.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2025-06-13 10:06:37 -06:00
Madhu Rajanna 4da69e6801 core: remove dead code
There are image create,delete,map
and unmap functions added very long back
when Rook was supporting flex driver. As
we dont have support for it and Rook doesnt
create or map rbd images. Moving the dead
code from the repo.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2025-06-13 15:10:57 +02:00
Santosh Pillai 03fa5a6b9d Merge pull request #15972 from sp98/clean-encrypted-osd-disks-from-other-clusters
osd: wipe encryted osd disk from other cluster
2025-06-12 09:13:06 +05:30
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 41d6baf0e1 core: fix radosnamespace log message
change logger.info to logger.infof to correctly print
radosnamespace name and namespace

Signed-off-by: Oded Viner <oviner@redhat.com>
2025-06-11 14:29:28 +03:00
Santosh Pillai 71bcdb533e osd: wipe encryted osd disk from other cluster
During the OSD preparation step, if the encrypted OSD disk belongs to a
different cluster, then clean the disk if `wipeDeviceFromOtherClusters`
is set to true.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2025-06-11 15:22:28 +05:30
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
Praveen Hosamani 0c0e94e43c build: make imagePullPolicy dynamic
Signed-off-by: Praveen Hosamani <praveen.h119@gmail.com>
2025-06-06 12:51:03 +02:00
Blaine Gardner 15bab1fa78 Merge pull request #15931 from BlaineEXE/fix-leastuptodatedaemonversion
core: ensure consistent LeastUptodateDaemonVersion
2025-06-03 12:25:15 -06:00
Travis Nielsen 832813d9df Merge pull request #15934 from parth-gr/fix-nfs-config-whitespace
nfs: use tabs instead of spaces in nfs rgw config
2025-06-03 10:03:22 -06:00
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
parth-gr 58eb75b13b nfs: use tabs instead of spaces in nfs rgw config
currently it was using two tabs, but
others config are using one tab
So update the config to use one tag

Signed-off-by: parth-gr <partharora1010@gmail.com>
2025-06-03 19:44:53 +05:30
parth-gr 9a0490982e nfs: fix nfs short name
nfs short name and crd name was same
which was conflicting,
remove the short name cephnfs as it can
be already called by the crd name

Signed-off-by: parth-gr <partharora1010@gmail.com>
2025-06-02 13:27:24 +05:30
Travis Nielsen a44940d924 Merge pull request #15887 from travisn/debug-log-label
osd: Debug log for long image names in label
2025-05-30 13:34:25 -06:00