Commit Graph
648 Commits
Author SHA1 Message Date
Blaine Gardner 50ff29140a Merge pull request #17052 from BlaineEXE/osd-cephx-key-init-fix
osd: in cephx key init, don't overwrite key on failure
2026-02-09 12:21:54 -07:00
Blaine Gardner d69ffdfd2c osd: in cephx key init, don't overwrite key on failure
Previously, if the OSD cephx-keyring-update init container couldn't
contact the mons, the output redirect would overwrite the on-disk
keyring file with no text, removing the on-disk keyring.

Modify the init container to only overwrite the keyring file when the
ceph command to get the latest key suceeds, to avoid removing the
on-disk key.

Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
2026-02-09 10:06:27 -07:00
Jan Breitkopf 1ff6f70311 operator: fix OSD info
This fixes OSD info being incomplete when a sidecar container is first
in the .spec.Template.Spec.Containers list.
I added a small helper function to find a container named "osd" instead
of always assuming the first one.

Signed-off-by: Jan Breitkopf <jan.breitkopf@prorocketeers.com>
2026-01-27 11:20:41 +01: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
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 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 c7dc2439f8 Merge pull request #16505 from elias-dbx/cleanup_preprovision_jobs
osd: cleanup orphaned osd provision jobs
2025-11-13 09:44:59 -07:00
Elias Carter 82a7edc268 osd: cleanup orphaned osd provision jobs
In a running cluster, I noticed that a node which was provisioning was removed from k8s
and the following log was emitted by the rook operator:
```
op-osd: cleaning up dangling OSD prepare status configmap "rook-ceph-osd-xxx-status"
```

But the osd provisioning job was still trying to run on the removed node:
```
rook-ceph-osd-prepare-xxx         Running    0/1           4d22h      4d22h
```

This PR implements a mechanism to remove any osd provision jobs which are bound to a
node which no longer exists within kubernetes. I added a test for this cleanup as
there wasn't a pre-existing test.

Signed-off-by: Elias Carter <elias@dropbox.com>
2025-11-12 12:35:49 -08:00
Travis Nielsen 23fd211544 Merge pull request #16675 from parth-gr/deviceclass-prepare
osd: add device class label to the osd prepare pods
2025-11-12 11:16:08 -07:00
subham rai ca440a6d1b Merge pull request #16679 from huyejia/master
osd: replace Split in loops with more efficient SplitSeq
2025-11-12 15:37:26 +05:30
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
parth-gr 4fcdfaad1f osd: add device class label to the osd prepare pods
currently the device class label was added to the osd pod,
we need the device class label on prepare pod,
so to spread across prpeare pods evenly among the faiure domains
per device class

Signed-off-by: parth-gr <partharora1010@gmail.com>
2025-11-10 17:10:05 +05:30
Travis Nielsen d34eeee786 Merge pull request #16669 from YiteGu/use-sync-map-for-monitoringRoutines
core: use sync.Map for cluster.monitoringRoutines
2025-11-06 11:18:35 -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
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 NielsenandMatthias Osthues d3c0bacd88 osd: set osd resources for specific device class
The OSDs may require different resources based on their device
class. The overall osd resources were only being used, rather
than properly looking up the specific device class resources.
Now the expected resources will take affect per device class.

Co-authored-by: Matthias Osthues <osthues.matthias@gmail.com>
Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2025-10-22 10:21:40 -06:00
Parth Arora 9277c4f13b Merge pull request #16594 from parth-gr/fix-osd-create-upgrade-loops
osd: add a timeout for osd create and update process
2025-10-15 14:52:20 +05:30
Blaine Gardner d9d31fe527 osd: allow OSD init keyring update to be best-effort
When OSDs start, init containers attempt to get the latest CephX key for
the OSD to allow OSDs to potentially continue working after key rotation.

However, in Ceph corner cases, mons could be unavailable while OSDs
could still be viable with existing on-disk keys. Since key rotation is
a rare event, it's likely that the on-disk keys are still good.

The worst case scenario is that key updates were needed but didn't
succeed in init containers. In this case, instead of the init container
failing, the OSD startup will fail instead. Thus, this should introduce
no extra risk but merely shift the failure to a different container.

Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
2025-10-14 10:19:21 -06:00
parth-gr 4377823675 osd: add a timeout for osd create and update process
if there a bit long to update osds in parallel,
we need to timeout and abort the synchronous loop
and start the cluster reconcile again from the beginning

Signed-off-by: parth-gr <partharora1010@gmail.com>
2025-10-13 20:08:14 +05:30
Oded Viner 11d7eacdcb osd: add detailed debug logs to checktopologyconflicts
added comprehensive debug logs throughout CheckTopologyConflicts

Signed-off-by: Oded Viner <oviner@redhat.com>
2025-10-05 22:10:19 +03:00
Blaine Gardner f90fa269f0 Merge pull request #16421 from parth-gr/cephx-osd-bootstrap
osd: remove the osd bootstrap keyring
2025-09-04 09:41:42 -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
Santosh Pillai b4e1c1720d osd: rotate lockbox keys for encrypted osd
ceph-volume creates osd-lockbox keys for the encryted osds. This PR
rotates those keys along with the OSD keys.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2025-09-01 08:44:14 +05:30
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
Oded Viner 973f8a3a35 osd: validate node topology to prevent invalid crush map hierarchy
add a validation check to fail osd deployment when topology labels
like rack or chassis are duplicated across parent domains
(e.g., zones). this prevents invalid crush map hierarchies
(dfbugs-2610).

Signed-off-by: Oded Viner <oviner@redhat.com>
2025-08-05 12:47:11 +03: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
chentao.2022 62631d2614 osd: exclude labels with a value of null from the topology string
Avoid the OSD startup failing to parse crush_location when
the topology label is empty.

Signed-off-by: chentao.2022 <chentao.2022@bytedance.com>
2025-07-30 16:07:13 -06:00
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
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
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
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
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
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
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
Travis Nielsen 57585ba151 osd: debug log for long image names in label
Labels cannot be longer than 64 characters, and if the image name
is too long we log a verbose message about the label that we can
just log now as debug level.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2025-05-21 15:21:30 -06:00
parth-gr 94450c0db7 osd: osd should watch for pvc resize
With a osd resize operation, currently pvc and pv may
takes more time then expected.
And so the osd dont get resized and need manual re-start
as currently we don't have a watch on osd's
controller that watches pv and get it resized.

add a wait time till pvc is not resized

Signed-off-by: parth-gr <partharora1010@gmail.com>
2025-05-15 12:42:04 +05:30
Artem Torubarov c1fd2f2ee8 rgw: use pod name in ops log filename
Signed-off-by: Artem Torubarov <artem.torubarov@sap.com>
2025-04-29 09:43:35 +02:00
Santosh Pillai e0d2275c8b core: fix logs to print correct OSD ID
use %d to print integer osd.ID

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2025-04-16 12:42:05 +05:30
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
Travis Nielsen 612979b6f0 Merge pull request #15293 from travisn/node-ceph-conf-override
osd: Enable node specific ceph conf overrides
2025-02-25 14:13:54 -07:00
Steven Fackler bbe600aa20 osd: avoid lvm device scan deadlock in activate
If a locally mounted volume is blocked on reads because this OSD is
down, lvs will deadlock trying to read from it. To avoid this, tell LVM
to filter out RBD volumes from its scanning process.

Signed-off-by: Steven Fackler <sfackler@gmail.com>
2025-02-08 13:39:16 -05:00
Artem Torubarov 25ee6b4f59 operator: custom hostname topology label
Signed-off-by: Artem Torubarov <artem.torubarov@clyso.com>
2025-01-24 15:59:07 +01:00
Travis Nielsen b0aefed8e5 osd: enable node specific ceph conf overrides
Some ceph.conf settings need to be unique per node
depending on the hardware. The ceph.conf overrides
can now be customized per-node by creating a node-specific
configmap that will be loaded for all OSDs and OSD prepare
jobs on that node, instead of the default ceph.conf
that is loaded from the rook-config-override configmap.

The node-specific configmaps must have the label
node.config.rook.io/osd, and be named as:
rook-config-override-<hostname>

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2025-01-17 15:57:48 -07:00