Commit Graph
3111 Commits
Author SHA1 Message Date
Travis Nielsen fe98e65d44 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>
(cherry picked from commit aa61ddb57e)
2025-07-10 16:51:31 +00:00
Patryk Rostkowski 9632438413 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>
(cherry picked from commit 7f3e6bd7fa)
2025-07-07 16:17:14 -06:00
raaizik 016db5500b 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>
(cherry picked from commit 1b3f36ff5c)
2025-07-02 15:05:38 +00:00
Madhu Rajanna 47e9442638 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>
(cherry picked from commit 5094b1f5e6)
2025-06-27 20:59:57 +00:00
Madhu Rajanna 9f28101cc3 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>
(cherry picked from commit d37297475e)
2025-06-27 20:27:00 +00:00
Madhu Rajanna 0e992a9e3f 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>
(cherry picked from commit d6d2e604fc)
2025-06-27 20:26:59 +00:00
Travis Nielsen 6f833fc107 Merge pull request #16051 from rook/mergify/bp/release-1.17/pr-16050
csi: update csi version to 3.14.1 (backport #16050)
2025-06-25 07:29:22 -06:00
Muhammad Adil Ghaffar 2c89453f44 exporter: add hostnetwork bool to cephexporter
Signed-off-by: Muhammad Adil Ghaffar <muhammad.adil.ghaffar@est.tech>
(cherry picked from commit 5ea7a177b7)
2025-06-24 20:50:19 +00:00
Madhu Rajanna 2a6e00d501 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>
(cherry picked from commit aa8fd61986)
2025-06-24 16:40:30 +00:00
Oded Viner 02323205b8 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>
(cherry picked from commit 8249a28145)
2025-06-23 16:52:01 +00:00
Travis Nielsen 47eb07305d 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>
(cherry picked from commit b47f297608)
2025-06-17 04:31:58 +00:00
mergify[bot] 993ae032a8 Merge pull request #16001 from rook/mergify/bp/release-1.17/pr-15951
pool: support targetSizeRatio=0 and default compressionMode="" (backport #15951)
2025-06-11 15:42:16 +00:00
Oded Viner a337dd41f5 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>
(cherry picked from commit dd65dc15d8)
2025-06-11 13:37:07 +00:00
Oded Viner 16b8bfb123 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>
(cherry picked from commit 41d6baf0e1)
2025-06-11 12:09:16 +00:00
Santosh Pillai 1880856e8e 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>
(cherry picked from commit 2bcf196b15)
2025-06-09 08:34:33 +00:00
Praveen Hosamani f0278e23e7 build: make imagePullPolicy dynamic
Signed-off-by: Praveen Hosamani <praveen.h119@gmail.com>
(cherry picked from commit 0c0e94e43c)
2025-06-06 14:54:42 +00:00
parth-gr d6178cf04e 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>
(cherry picked from commit 58eb75b13b)
2025-06-03 16:04:34 +00:00
Travis Nielsen 01e0134be7 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>
(cherry picked from commit 57585ba151)
2025-05-30 19:35:11 +00:00
Travis Nielsen 8258304851 Merge pull request #15874 from rook/mergify/bp/release-1.17/pr-15853
core: delete old svg/rns cr with same svg/rns  name (backport #15853)
2025-05-30 12:40:05 -06:00
parth-gr 88c28d2ade nfs: fix the skip reconcile call
currently nfs is used as the unique selector
for daemon id, which returns  nfs: ocs-storagecluster-cephnfs-a

Updating the has() to function to check the same label value
(n.Name + "-" + id)

Signed-off-by: parth-gr <partharora1010@gmail.com>
(cherry picked from commit 79f44a4660)
2025-05-30 17:12:40 +00:00
subhamkrai c5466a310f 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>
(cherry picked from commit d86aa28f30)
2025-05-29 15:11:25 +00:00
Patryk Rostkowski d09776483c nfs: skip NFS daemon reconciliation when labeled with skip-reconcile
This change adds support for skipping reconciliation of CephNFS daemons
that are labeled with `ceph.rook.io/skip-reconcile=true`.
Similar to MDS, MGR, and RGW components, this allows cluster operators
to prevent Rook from modifying specific NFS daemon deployments.

Signed-off-by: Patryk Rostkowski <patrostkowski@gmail.com>
(cherry picked from commit 612e54e1ae)
2025-05-27 22:12:37 +00:00
Oded Viner 1c85ddd327 core: improve reporting for reconcile requeue cases
when a reconcile returns a requeue result without an error
(e.g. due to a missing cephcluster), the previous logic reported
it as a successful reconcile. this was misleading and made it
hard to understand the actual controller behavior this
change adds a new condition to log and emit a "requeuing" event
when reconcileResponse.Requeue is true and err is nil.
this ensures more accurate event reporting and improves observability across
all controllers using reportreconcileresult.

Signed-off-by: Oded Viner <oviner@redhat.com>
(cherry picked from commit 83ce9a6a63)
2025-05-21 13:45:39 +00:00
Travis Nielsen 584b1196ff Merge pull request #15881 from rook/mergify/bp/release-1.17/pr-15867
csi: enable CSI Metadata Injection by Default (backport #15867)
2025-05-20 11:20:09 -06:00
Oded Viner b0beb387b8 csi: enable CSI Metadata Injection by Default
This PR sets CSI_ENABLE_METADATA to true by default in the
Rook configuration, ensuring that the --setmetadata=true
flag is added to CSI nodeplugin pods

Signed-off-by: Oded Viner <oviner@redhat.com>
(cherry picked from commit ce59c72eb1)
2025-05-20 16:47:59 +00:00
Niels de Vos 0d57154457 csi: update Kubernetes CSI sidecar images to current versions
The Kubernetes CSI sidecars have had several releases that were not
included in deployments by Rook yet, update them to the versions that
are available today:

- csi-attacher:v4.8.1
- csi-provisioner:v5.2.0
- csi-resizer:v1.13.2
- csi-snapshotter:v8.2.1

This change is important, because Ceph-CSI will implement the new
Controller.GetSnapshot CSI procedure. A bug in csi-lib-utils causes a
panic when a ControllerCapability is provided, but not (yet) known to
the CSI sidecars. The updated sidecars consume a version of
csi-lib-utils with a fix for that panic.

See-also: kubernetes-csi/csi-lib-utils#188
Signed-off-by: Niels de Vos <ndevos@ibm.com>
(cherry picked from commit a168c40008)
2025-05-20 16:29:51 +00:00
Carlos Barria 0889541d29 core: fix golangci-lint check ST1005
Signed-off-by: Carlos Barria <cbarria@yahoo.com>
(cherry picked from commit 61494d1baf)
2025-05-20 07:25:13 +00:00
subhamkrai 012576ff18 namespace: delete old rns cr with same block pool name
there can be a scenario where a new RNS CR is created with
the same spec.blockPoolName and spec.name, in that case we want to delete
the old RNS CR without checking dependent child resources.

Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit ebc1671ab7)
2025-05-19 16:03:02 +00:00
subhamkrai 76df880480 subvolumegroup: delete old svg cr with same svg fs name
there can be a scenario where a new svg cr is created with
the same svg.filesystem and svg.spec.name, in that case we want to delete
the old svg CR without checking dependent child resources.

Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit 1ef660f749)
2025-05-19 16:03:02 +00:00
Travis Nielsen 3e3a76976b mgr: continue reconcile if prometheus not installed
When monitoring is enabled, if the service monitor fails
creation, the reconcile will fail and rook will never
create the OSDs. A number of users have been blocked during
install due to this issue. Let's allow reconcile of the
full cluster even in this error case. After they install
prometheus, they would then need to trigger a reconcile again
perhaps by restarting the rook operator to enable
the service monitor.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit ca12916438)
2025-05-16 16:30:30 +00:00
parth-gr 88067c4aab 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>
(cherry picked from commit 94450c0db7)
2025-05-15 20:12:59 +00:00
Joshua Hoblitt 00503b8da0 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>
(cherry picked from commit f1fad531eb)
2025-05-08 17:03:37 +00:00
Travis Nielsen 44994bbd22 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>
(cherry picked from commit 530223c5b4)
2025-05-07 22:20:53 +00:00
Travis Nielsen f749590a71 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>
(cherry picked from commit 0a3a599580)
2025-05-07 22:20:52 +00:00
Travis Nielsen f7d3ae0544 Merge pull request #15806 from rook/mergify/bp/release-1.17/pr-15793
ceph: Update caps to include executable permission (backport #15793)
2025-04-30 12:42:12 -06:00
Artem Torubarov 4299ccdd22 rgw: cleanup prev ops log config from mon db
Signed-off-by: Artem Torubarov <artem.torubarov@sap.com>
(cherry picked from commit d5e4df2186)
2025-04-30 15:42:44 +00:00
Artem Torubarov cb95837409 rgw: use pod name in ops log filename
Signed-off-by: Artem Torubarov <artem.torubarov@sap.com>
(cherry picked from commit c1fd2f2ee8)
2025-04-30 15:42:44 +00:00
Felix Prasse 3a3f75fc5d csi: update caps to include executable permission
ceph-csi uses an exclusive lock for cryptfs operations. This needs the x capability on the metadata pool.

Fixes #15283

Signed-off-by: Felix Prasse <1330854+flx5@users.noreply.github.com>
(cherry picked from commit 8f53522162)
2025-04-30 14:55:20 +00:00
Justin Cichra 0f310c8c59 exporter: add name to containerPort
Named containerPort is a useful feature when generating dynamic scrape
targets with prometheus.

This makes it clear that the containerPort is intended for metrics
scraping.

The name matches that which is on the mgr deployment.

Signed-off-by: Justin Cichra <jcichra@cloudflare.com>
(cherry picked from commit 12c36e9472)
2025-04-29 19:15:14 +00:00
subhamkrai c29bb19051 rbdmirror: logs message should not end with period
improving logging to include name and namespace of resource
and also namespace should not end with period.

Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit fe776fd4fe)
2025-04-29 15:45:08 +00:00
Patryk Rostkowski f88622ef7c operator: specify ceph config via secret
Adds .spec.cephConfigFromSecret to CephCluster for loading
Ceph config parameters from a Kubernetes Secret.

Signed-off-by: Patryk Rostkowski <patrostkowski@gmail.com>
(cherry picked from commit 45b0ef2104)
2025-04-23 17:54:42 +00:00
Blaine Gardner ace9597404 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>
(cherry picked from commit 08233d5b6d)
2025-04-22 16:55:29 +00:00
Travis Nielsen 5be41e2b8a 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>
(cherry picked from commit 95a5920bef)
2025-04-21 16:14:45 +00:00
Joshua Hoblitt 76f4877ed9 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>
(cherry picked from commit 7887f03c5c)
2025-04-16 18:25:48 +00:00
Santosh Pillai c6704a241e mon: always delete mon canary pods
In case of multicluster service, we need to always delete the mon-canary
pods even if there is any failure while exporting the service, else
multiple mon canary pods will get created.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
(cherry picked from commit 75c6bb8cd2)
2025-04-16 14:34:47 +00:00
Santosh Pillai 906dde225d core: fix logs to print correct OSD ID
use %d to print integer osd.ID

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
(cherry picked from commit e0d2275c8b)
2025-04-16 13:39:48 +00:00
Rakshith R cbbee37fb1 csi: update cephcsi to latest release
This commit updates cephcsi version to 3.14.0
in rook.

Signed-off-by: Rakshith R <rar@redhat.com>
(cherry picked from commit a555885a5f)
2025-04-14 14:23:58 +00:00
Peter Razumovsky 5949c189af pool: retry status update on fail
In some cases, for example, kube-api nods, CephBlockPool's status
could be failed to update. In that case, rook-operator does not
tries to update status again. This fix requests for requeue if pool's
status update is failed.

Signed-off-by: Peter Razumovsky <prazumovsky@mirantis.com>
(cherry picked from commit d7c67fecee)
2025-04-09 17:15:26 +00:00
Travis Nielsen ede1d63931 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>
(cherry picked from commit f7fb1bc0f2)
2025-04-09 16:41:41 +00:00
mergify[bot] 817756eaf7 Merge pull request #15665 from rook/mergify/bp/release-1.17/pr-15660
csi: remove dummy code in csi driver creation (backport #15660)
2025-04-07 17:32:36 +00:00