Commit Graph
694 Commits
Author SHA1 Message Date
Parth Arora c1247b19d7 Merge pull request #16792 from parth-gr/fix-mgr-external
external: fix endpoint slice type for ipv6 clusters
2025-12-08 16:29:06 +05:30
parth-gr 0a3d9b8517 external: fix endpoint slice type for ipv6 clusters
in endpoint slice for the mgr and rgw service
it was harcoded to use the ipv4,
now dynamically assign the type based on the endpoint
ip adrress type

Signed-off-by: parth-gr <partharora1010@gmail.com>
2025-12-08 15:52:50 +05:30
Travis Nielsen 023608e6fd core: enhance logging with namespaced names
For all of the controllers besides the cluster controller,
the logging now includes the namespaced name of the resource
that is being reconciled. This will help with log troubleshooting
to help analyze logs consistently for the resource being
reconciled.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2025-12-04 12:00:42 -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 ac1fa3a4c3 core: shorten the logger names
The logger names are seen on each line of logging. As
long as they are unique, they really don't need to be
long and descriptive, so let's make them a bit more
concise, and independent from controller names.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2025-11-21 13:12:56 -07:00
Joshua Hoblitt 61cbe4fc23 object: fix user quotas being overwritten when obc bucketOwner is set
Resolves https://github.com/rook/rook/issues/16417

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2025-11-06 16:31:12 -07:00
Blaine Gardner c08a7742b0 Merge pull request #14821 from sp98/rgw-hpa
rgw: add scale subresource to CephObjectStore CR
2025-10-27 09:54:11 -06:00
SantoshPillai 67b44b47df rgw: make hpa update rgw resource
Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2025-09-19 12:22:30 +05:30
Joshua Hoblitt 864c349c1f object: add status.{phase,observedGeneration} to cephbn
Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2025-09-16 12:19:20 -07:00
cuiweixie 20b3b9deef operator: refactor to use reflect.TypeFor
Signed-off-by: cuiweixie <cuiweixie@gmail.com>
2025-08-28 23:02:19 +08:00
Blaine Gardner 9be45d949b Merge pull request #16069 from OdedViner/default_realm
object: mark realm as default to avoid zone creation
2025-08-07 10:33:11 -06:00
Oded Viner 182cd211ca object: mark realm as default to avoid zone creation
add defaultRealm field to cephobjectstore to allow rook to mark the
created realm as default. this prevents ceph from auto-creating a
"default" zonegroup and zone when the default is not explicitly set.
affects only non-multisite setups.

Signed-off-by: Oded Viner <oviner@redhat.com>
2025-08-07 14:48:21 +03:00
Travis Nielsen 6c867120c4 Merge pull request #16052 from jhoblitt/maint/simplify-cephobjectstoreuser-deletion-logic
object: simplify CephObjectStoreUser deletion logic
2025-08-04 12:14:05 -06:00
Joshua Hoblitt 80da084732 object: simplify obc storageclass lookup
obc was using an internal exponential backup for the lookup of the sc.
This is somewhat of an anti-pattern when using controller-runtime as it
implements retrying logic. If the sc doesn't exist, the reconcile
attempt should fail immediately and controller-runtime will handle the
back-off policy.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2025-08-01 13:20:38 -07:00
Joshua Hoblitt 1163133aec object: simplify CephObjectStoreUser deletion logic
Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2025-08-01 12:41:10 -07:00
Joshua Hoblitt fbc60608ed object: fix bucket policy in sync detection
A typo was causing the operator to attempt to sync bucket policy when
the state was already in sync. This resulted in the operator carrying
out unnecessary work and logging activity with no user visible change
resulting.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2025-08-01 11:18:08 -07: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
Travis Nielsen 7b2dfdba17 Merge pull request #16150 from OdedViner/log_panics_controller
core: log panics in controller reconcile functions
2025-07-29 09:59:27 -06:00
Oded Viner cf13deee6f core: log panics in controller reconcile functions
add RecoverAndLogException() helper to log panics with stack trace.
added defer call in all rook controller Reconcile() methods for
better error visibility in operator logs

Signed-off-by: Oded Viner <oviner@redhat.com>
2025-07-29 13:20:38 +03:00
subhamkrai 1bde614eb5 core: migrate from v1.Endpoints to discoveryv1.EndpointSlice
This change updates the codebase to replace the deprecated
v1.Endpoints API with discoveryv1.EndpointSlice.
The v1.Endpoints API has been deprecated in Kubernetes v1.33+

Signed-off-by: subhamkrai <srai@redhat.com>
2025-07-23 21:02:02 +05:30
Blaine Gardner e4da184ce3 Merge pull request #16132 from parth-gr/fix-rgwstatus-err
rgw: fail reconcile on status update error
2025-07-16 14:51:36 -06:00
parth-gr b8517eb54f rgw: fail reconcile on status update error
if the status update is failed, return an error
and do a new reconcile for the rgw controller

Signed-off-by: parth-gr <partharora1010@gmail.com>
2025-07-16 14:37:03 +05:30
Artem Torubarov c88e6ea952 multus: support copy file to cmd-proxy container for rgw zone set commands
Signed-off-by: Artem Torubarov <artem.torubarov@sap.com>
2025-07-16 10:45:42 +02:00
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
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
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
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
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
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
Santosh Pillai fe77108e1e rgw: fix do-not-reconcile label
fix do-not-reconcile label to prevent RGW deployment reconcile if
`ceph.rook.io/do-not-reconcile:<storeName>` is applied.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2025-05-12 16:59:56 +05:30
Joshua Hoblitt f1fad531eb object: change CephObjectStore "foo" found log level to debug
When multiple `CephObjectStoreUser` CRs are present, the operator logs a
high volume of `CephObjectStore "foo" found` messages during reconcile.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2025-05-08 09:28:19 -07:00
Artem Torubarov d5e4df2186 rgw: cleanup prev ops log config from mon db
Signed-off-by: Artem Torubarov <artem.torubarov@sap.com>
2025-04-30 10:00:14 +02:00
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
Blaine Gardner 7a2e65f288 Merge pull request #15764 from BlaineEXE/notification-log-level-change
object: lower retry log verbosity in notification OBC controller
2025-04-22 10:54:00 -06:00
Blaine Gardner 08233d5b6d object: lower retry log verbosity in notification OBC controller
Lower the verbosity of a message in the notification controller's OBC
label watcher. If the OBC controller is having issues provisioning the
OBC, this log will spam every 10 seconds. Reduce the message verbosity
level to debug.

Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
2025-04-22 10:06:27 -06:00
Travis Nielsen 95a5920bef object: log all reconcile errors during object store creation
The object store controller was swallowing errors of the
type not found, assuming a certain category of errors
when ceph may still be initializing. But some of these
errors could be user error and they need to troubleshoot
the details of the error, so we need to log the specific
error instead of swallowing it.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2025-04-18 11:35:09 -06:00
Joshua Hoblitt 7887f03c5c object: add CephBucketTopic .spec.endpoint.kafka.{user,password}SecretRef
userSecretRef and passwordSecretRef fields are added to allow the Kafka
endpoint username and password to be supplied from a Kubernetes Secret,
rather than exposed as plaintext as part of the endpoint URI. If the
endpoint URI has HTTP basic auth user-id and user-pass components, they
are overridden by userSecretRef and passwordSecretRef.

Squid added bucket topic attributes for configuring the user-name and
password for pushing notifications to Kafka as an alternative to
encoding credentials into the URI. However, these attributes are not
supported under Reef. Thus, this initial implementation relies on URI
mangling for compatible with both Reef and Squid. Future work could
using Ceph version detection and switch to the new attributes to be used
with Squid and/or the implementation could be converted exclusively to
use the new attributes once Rook has dropped support for Reef.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2025-04-16 10:53:11 -07:00
Travis Nielsen f7fb1bc0f2 core: skip reconcile when adding the finalizers
When finalizers are added to the CRs, a follow-up reconcile
will be triggered due to the increased generation on the CR.
Therefore, abort the initial reconcile when adding the finalizer,
and allow the follow-up reconcile to complete the configuration.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2025-04-08 13:42:58 -06:00
Joshua Hoblitt 9f1ed201db core: typed watch handlers and predicates
All existing controller runtime watches are converted to use "typed"
handlers and predicates instead of operating on `client.Object`.  The
intent is to be bug for bug equivalent with the existing logic while
replacing run time type assertions and switch statements with compile
time type constraints and type casts. In several cases, functions using
assertions were split up such that each function only handles a single
Kind at a time. It is hoped that this will improve readability and
maintainability while facilitating future refactoring such as migrating
some watches to using IndexFields.

Of particular note is that the massive switch statement in
`WatchControllerPredicate()`  from
`pkg/operator/ceph/controller/predicate.go` has been replaced with
generics, reflection, and splitting the obc logic into its own predicate
function. There are still many helper functions operating on
`client.Object`. These were not updated unless required by the compiler
in order to limit the size of this change. The type safety of these
funcs should be improved as followup work.

 It is strongly suggested that going forward, handlers and predicates
 only handle a single Kind (generic or not) and that switches / type
 assertions are heavily discouraged or forbidden. This PR removed all
 but a single switch statement in a predicate, which should be addressed
 in future work.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2025-04-04 09:40:56 -07:00
Joshua Hoblitt 6b2c357871 object: add CephObjectStoreUser.spec.keys
Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2025-04-03 09:09:01 -07:00
Blaine Gardner 85440169dd Merge pull request #15554 from ragnard/kafka-topic-params
rgw: Support Kafka auth mechanism parameter
2025-04-01 10:44:36 -06:00
Blaine Gardner e783264652 Merge pull request #15588 from sp98/rgw-client-location
rgw: RGW read affinity for localized reads
2025-03-31 09:26:20 -06:00
Santosh Pillai deb010c32e rgw: support read affinty for localized reads
allows selecting Read Affinity policy from the ObjectStore API
aets `--crush-location=host` for RGW daemons.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2025-03-31 18:24:32 +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
Joshua Hoblitt dcf0a57d11 object: all CephBucketTopic reconcile errors set .status.phase
topic.reconcile() had a number of error triggered return statements
which did not update the CR's status to reflect a reconcile failure.

Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2025-03-25 09:52:37 -07:00