Commit Graph
44 Commits
Author SHA1 Message Date
subhamkrai 20f350a71a csi: remove automated node fencing code
since node fencing is disabled in rook for sometime
and this feature is implemented in csi. So, this
commits remove obsolete code related to node loss

Signed-off-by: subhamkrai <srai@redhat.com>
2026-01-22 15:19:12 +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 3cb343f62a core: run gofumpt on all files
Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
2025-03-26 10:41:48 -07:00
Travis NielsenandDmitry Mishin d109dc9029 core: implement operator settings as env vars
The operator settings loaded from the configmap have proven
inefficient for load time and frequently checking the configmap.
To avoid this ineffenciency, the configmap is only loaded once
each time it is created or updated. The values in the configmap
are applied as environment variables, which then are very efficient
to query throughout the various controllers, without needing
to be concerned about loading the configmap again.

Co-authored-by: Dmitry Mishin <dmitry.mishin@gmail.com>
Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2025-02-24 12:12:45 -07: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 7fbe4e7db5 osd: allow scheduling on unschedulable nodes
For nodes that are explicitly requested for deploying
OSDs, they will be skipped temporarily if not
schedulable or not ready. A future reconcile is
expected to schedule them. Allow the OSDs to be
scheduled even on these nodes that are temporarily
down, even if it blocks the reconcile from completing.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2024-10-31 14:05:36 -06:00
Madhu Rajanna 1d1ed5e962 csi: disable fencing in Rook
Disabling the RBD and CephFS fencing
in Rook for now as its having bugs where
Rook is blocklisting wrong IP address
due to timing issues.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2024-10-10 19:28:15 +02:00
Madhu Rajanna 123025f22c csi: update csi-addons to v0.9.0
As we have new csi-addons v0.9.0
updating the same here as well.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2024-08-16 07:57:16 +02:00
subhamkrai 9f1b64be54 mds: block of active mds ip only
currently, it was blocking both the mds ip
instead its should block ip of of mds which is in
the same node which is down.

Signed-off-by: subhamkrai <srai@redhat.com>
2024-07-17 13:30:35 +05:30
subhamkrai efe6ef4e45 csi: revert remove cephFs networkFence code temporarily
This reverts commit bd4250f56e.

Signed-off-by: subhamkrai <srai@redhat.com>
2024-07-17 11:36:15 +05:30
subhamkrai 4be450ae4b csi: skip creating networkFence when csi disabled
skip creating networkFence when 'ROOK_CSI_DISABLE_DRIVER' is set to
'false'.

Signed-off-by: subhamkrai <srai@redhat.com>
2024-06-04 18:17:38 +05:30
momantech 496afdbad3 docs: delete duplicate words and revise the names of some methods
delete duplicate words and revise the names of some methods

Signed-off-by: momantech <cuimoman@qq.com>
2024-04-25 15:43:40 +08:00
subhamkrai bd4250f56e csi: remove cephFs networkFence code temporarily
cephFs fencing needs more testing and bug fixes to make
it in production. We tried multiple fixes but still it need
more work. So, removing the cephfs networkFence realted code
will rever this commit when we start working on this again.

Signed-off-by: subhamkrai <srai@redhat.com>
2024-02-21 21:56:37 +05:30
subhamkrai 0ace7cf8cf csi: check networkFence status before deleting
earlier, we were only checking the specs of networkFence to see if
unfencing is done before proceeding with deletion but we should also
check the status of networkFence before proceeding with deletion.

Signed-off-by: subhamkrai <srai@redhat.com>
2024-02-21 21:52:55 +05:30
Madhu Rajanna ca21bd9715 core: retry other pvc if active client not found
retry other cephfs/rbd pvc if there
are no active clients found on ceph cluster.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2024-02-14 19:01:46 +01:00
Madhu Rajanna eb97390df2 core: use error wraping in fenceCephFSVolume
to keep the code consistent and to propogate
more details about error rook uses error wraping.
updating current code whereever its required to
wrap the details.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2024-02-14 11:04:50 +01:00
Madhu Rajanna 0e115c44bf core: fix cephfs pvc network fencing
The cephfs PVC might exist on the kubernetes
node object but due to some timing issues the
ip might not be visible on the ceph cluster or
the client might already got evicted or disconnected
from ceph cluster. In this case we will not be
able to get IP details for the subvolume and we dont
have any check for empty ip's in the code and rook
tries to create NetworkFence CR with empty Ip's
and the NetworkFence will get moved to the Failed state.
This PR adds the necessary check and logging to prevent
this one.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2024-02-14 11:04:43 +01:00
subhamkrai 5bff860380 core: remove namespace/ownerRef from networkFence
since networkFence is a cluster-based resource so that we don't need
the namespace and ownerReferences as it cause garbage-collector errors.
Also, now we create the networkFence with clusteUID label so when doing
cleanup we match the cephCluster uid and networkFence label clusterUID.

Signed-off-by: subhamkrai <srai@redhat.com>
2024-02-13 21:47:04 +05:30
Travis Nielsen ebcb0a424f Merge pull request #13728 from subhamkrai/remove-ownerRef-nf
core: remove ownerRef from networkFence
2024-02-08 11:26:16 -07:00
subhamkrai 2ac418a3b2 core: remove ownerRef from networkFence
since networkFence is a cluster-based resource so that we don't need
the namespace and ownerReferences as it cause garbage-collector errors.

Signed-off-by: subhamkrai <srai@redhat.com>
2024-02-08 23:12:39 +05:30
Riya Singhal c2e3cf367c csi: update network fence CR name
this commit updates the name of network fence CR to
node name + driver name, which will allow the creation of
multiple network fence per drivers on the same node, and
modifies the unit test and deletion procedure for the
same.

Signed-off-by: Riya Singhal <rsinghal@redhat.com>
2024-01-26 00:18:00 +05:30
Riya Singhal 9202e20829 csi: implement network fencing for cephFS
Signed-off-by: Riya Singhal <rsinghal@redhat.com>
2023-12-18 21:44:47 +05:30
subhamkrai ef4dd76df1 pool: rbd cmd shouldn't use admin in external mode
when creating networkFence, rbd command was loading
admin config and hence running rbd command use client.admin
in case of external cluster also. With this commit instead
of client.admin user it will use what is being passed to
config.

Signed-off-by: subhamkrai <srai@redhat.com>
2023-10-27 14:45:01 +05:30
guoguangwu 235ac293ff core: import packages only once
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
2023-09-16 13:40:17 +08:00
Madhu Rajanna eb304a5073 core: return valid CIDR ip
we need to return a valid CIDR IP
to get it fenced properly, the previously
returned one was like `10.63.0.5:0/32` which
is not a valid CIDR, removing `:0` to look like
proper IP CIDR.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2023-08-28 10:58:16 +02:00
subhamkrai 72386eb1d0 core: node fencing, skip pv when pv is not backed by csi
when node fencing is triggered and a negative case where
one deployment pod consuming pv not provisioned by csi
and another deployment pod with rbd rwo are on the same
node and node fencing is triggered.

In this case rook operator panics since it is trigger to get
field `pv.Spec.CSI.Driver` which will be nil.

Also, skip static pv as there is no `imageName` in the spec
rbd status command will fail.

Signed-off-by: subhamkrai <srai@redhat.com>
2023-07-26 14:35:41 +05:30
Rakshith R 12e2cd550f core: add check for pv access modes' multinode support
During faster node loss recovery,
Rook needs to check and blocklist only rbd pvs
that do not support multinode access modes such as
ReadOnlyMany(ROX) and ReadWriteMany(RWX).
This commit adds check for the same.

Signed-off-by: Rakshith R <rar@redhat.com>
2023-07-10 16:12:13 +05:30
subhamkrai 39b5c057ce core: faster recovery from rbd rwo node loss
in the existing node watcher, we'll check for node update
event and see if there are `out-of-service` taints are applied
and `ROOK_WATCH_FOR_NODE_FAILURE` is enabled in rook-ceph-operator-configmap,
if then we'll create the networkFence cr and delete the cr if nodes come back.
And, added the unit test too.

Signed-off-by: subhamkrai <srai@redhat.com>
2023-07-07 21:16:25 +05:30
parth-grandBlaine Gardner 69ae9569cd build: update k8s version to 1.26.1
Update the Kubernetes API version used to 1.26.1, and start testing
against Kubernetes version 1.26.1 in CI.

Co-authored-by: parth-gr <paarora@redhat.com>
Co-authored-by: Blaine Gardner <blaine.gardner@redhat.com>

Signed-off-by: parth-gr <paarora@redhat.com>
Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2023-02-23 20:18:47 -07:00
Josh Soref 6e7b8767f3 core: fix spelling
* another
* are
* availability
* available
* bootstrap
* boundaries
* ceph
* certificate
* class
* codifies
* consuming
* corrupted
* createor
* csi
* deployments
* exceeded
* execute
* filesystem
* healthiness
* heuristics
* immediately
* insecure
* installed
* isolated
* maintained
* maximum
* minute
* monitor
* new
* nginx
* nonexistent
* not
* occurs
* omitempty
* operator
* orchestration
* persistentvolumes
* placement
* preexisting
* prometheus
* protecting
* provisioner
* purposes
* reconcile
* regex
* related
* requests
* returns
* rubbish
* running
* schedulable
* schedule
* serviceaccount
* simulating
* snapshots
* statement
* static
* tenants
* the
* unavailable
* volumeattachment
* waiting
* with
* wrapper
* zonegroup

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-07-07 18:10:47 -04:00
Divyansh Kamboj 9008409f87 core: add context parameter to functions
This commit adds context parameter to various functions, and remove the
usage of context.TODO.

Closes: https://github.com/rook/rook/issues/8701
Signed-off-by: Divyansh Kamboj <dkamboj@redhat.com>
2022-03-22 08:19:07 +05:30
Travis Nielsen 4570204a1d osd: write log message when node is being skipped
When a node is being skipped for creation of OSDs, log a message
that indicates whether it was from the node being unschedulable,
the node is not ready, or the node does not meet the placement
criteria specified in the cluster CR.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-02-14 12:06:49 -07:00
Travis Nielsen 1afd322650 core: ensure cluster name is available on cluster info
The cluster info is important context for the cluster controller to
create the cluster, and all the fields must be properly set.
A test cluster name was being set temporarily, resulting in
mons incorrectly getting the wrong cluster CR name. There is no
known issue from the temporary value, it was just exposed by
https://github.com/rook/rook/pull/8678 setting the value to a label.

Now the functions are more clearly named so only unit and
integration tests should be using the test value for the cluster
name where it is not important.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-11-18 15:30:26 -07:00
Sébastien Han 072c8f43df ceph: do not reconcile if the op is not ready
When the op is initializing, the ceph config is not ready and thus we
should reconcile. This avoids a double reconcile.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-09-02 13:50:32 +02:00
parth-gr 1601ba1c1c core: convert util.NewSet() to sets.NewString()
Converting util.NewSet() instance to use sets.NewString() instance

Closes: https://github.com/rook/rook/issues/8479
Signed-off-by: parth-gr <paarora@redhat.com>
2021-08-20 18:56:25 +05:30
Travis Nielsen ce50eb2407 ceph: remove unused volumesource schema from cephcluster
The VolumeSource type was only used internally when loading
the storageClassDeviceSets. The volumeSource element is never
expected to be specified in the CephCluster CR, so it is now
removed from the schema. The VolumeSource type is renamed to
deviceSet for clarity.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-05-03 11:54:46 -06:00
parth-gr 80a9b26bfd ceph: operator loops forever over existing nodes
When the node get added to the cluster the operator always watches for node events and starts a reconcile when a node is ready.
Checking the Node if they already have OSDs present and stopping them from reconcile.

Closes: https://github.com/rook/rook/issues/7534
Signed-off-by: parth-gr <paarora@redhat.com>
2021-04-22 22:38:08 +05:30
parth-gr f6bd25ae01 ceph: update OSDs reconcile
OSDs not automatically started when adding nodes to existing cluster.
Call the helper NormalizeCrushName(name) to make sure the node name can match the name in the crush map before querying for the node in the crush map, and reconcile when new nodes get added.

Closes: https://github.com/rook/rook/issues/7462
Signed-off-by: parth-gr <partharora1010@gmail.com>
2021-04-22 20:40:14 +05:30
Mateusz Gozdek 8ba3762fa4 docs: fix bunch of typos
Found by running the following command:

codespell -S .git,*.png,*.jpg -L \
aks,keyserver,atleast,dne,ser,ist,files\',ba,dum,iam,te -f -H

Signed-off-by: Mateusz Gozdek <mgozdekof@gmail.com>
2020-11-06 10:01:04 +01:00
Thomas Bechtold ede4b9cb1a ceph: improve watcher debug message when node is not tolerable
When a node is not tolerable, also output the node name so it's clear
which not it is which is not tolerable.

Signed-off-by: Thomas Bechtold <tbechtold@suse.com>
2020-10-12 14:19:17 +02:00
subhamkrai 25c116a4bd ceph: handle golangci-lint linter gosimple
this commit handles all the errors  check for
golangci-lint linter gosimple.

Signed-off-by: subhamkrai <subhamkumarrai03@gmail.com>
2020-09-17 15:10:27 +05:30
Alexander Trost 94d5196439 ceph: operator should only "watch" OSD placement nodes
This change is the first part to improve the watch OSD nodes logic in
the Rook Ceph operator.
This commit changes the "is node valid check" to use the OSD placement
instead of the all placement. The OSD placement is "merged" with the
all placement already.

Second step will be to skip the first "iteration" of the "nodes added"
events and then start the actual watch logic.

Partially resolves #6111.

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2020-08-25 18:16:20 +02:00
Travis Nielsen e74c7eaef8 ceph: refactor context and clusterInfo passed to the ceph commands
To provide more context for executing commands in a ceph cluster,
the full clusterInfo is now passed to the ceph execution commands.
All information about the cluster will now be available throughout
all the areas of the operator. The namespace, ceph credentials,
mon endpoints, and other info is a core part of that cluster info.

Arguments passed through the controllers are also simplified for
mons, mgr, osds, and other daemons where the parameters had
become too complex.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-07-16 15:54:54 -06:00
Sébastien Han f27fd207ce ceph: convert the CephCluster controller to the controller-runtime
This is the final conversion to controller-runtime conversion. This time the
CephCluster CRD has been converted to use the controller-runtime
library.
The controller incorporates all the previous watchers too, so the Node
and hot-plug configmap are been watched too.
Only the operator setting configmap is not being watcher since it's not
related to the CephCluster CRD.
Not only the patch converts to controller-runtime but also tries to
re-organize the tree of the repo to actually make the code more
readable and have better functions/methods/tests separations.

Closes: https://github.com/rook/rook/issues/4939
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-04-28 09:40:35 +02:00