Commit Graph
3904 Commits
Author SHA1 Message Date
Travis Nielsen 3628e83892 osd: add cephcluster status for legacy osds to replace
LVM-based OSDs on PVCs are legacy and are not well tested.
Therefore, we add status to the cephcluster CR that at least
gives a clue that the OSDs should be replaced.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2024-05-10 16:00:41 -06:00
Redouane Kachach ee7c71c89e mgr: fix UpdateActiveMgrLabel to retry label update on failure
fix UpdateActiveMgrLabel to retry label update on failure. Previously,
the function always returned the current manager, even if update
failed, leading to inconsistent labels. This fix ensures retries on
failures.

Fixes: https://github.com/rook/rook/issues/13601

Signed-off-by: Redouane Kachach <rkachach@ibm.com>
2024-05-06 19:30:44 +02:00
Blaine Gardner 1af97d09a8 Merge pull request #14154 from BlaineEXE/csi-config-map-fix-empty-namespace
csi: fix missing namespace bug in csi cluster config map
2024-05-03 12:09:52 -06:00
Travis Nielsen 3364bd65bb Merge pull request #14134 from subhamkrai/add-validation-scds
osd: limit storageClassDeviceSets to 63 chars
2024-05-03 07:29:28 -06:00
subhamkrai 6f5cc9b01d osd: limit storageClassDeviceSets to 63 chars
there are some cases where storageClassDeviceSets length
are more 63 chars and osd provisioned failed due to this.
with error
```
 failed to run osd provisioning job for PVC "ocs-deviceset-*-local-volume-storageclass-0-data-*": Job.batch "rook-ceph-osd-prepare-*" is invalid: [spec.template.spec.volumes[10].name: Invalid value: "ocs-deviceset-*-local-volume-storageclass-0-data-*": must be no more than 63 characters, spec.template.spec.containers[0].volumeMounts[9].name: Not found: "ocs-deviceset-*-local-volume-storageclass-0-data-*",
```

Using x-validator to limit the maxLength to the deviceClassSet.Name to
40 chars and adding code check that overall pvc name should be less than
63 chars.

Signed-off-by: subhamkrai <srai@redhat.com>
2024-05-03 10:52:18 +05:30
Blaine Gardner 4ff881240f csi: fix missing namespace bug in csi cluster config map
Someone testing the Multus holder pod removal feature encountered an
issue where the migration process failed to lead to a system state where
PVCs could be created successfully.

The root cause was found to be a ceph csi config map wherein the primary
CephCluster entry was lacking a value for the "namespace" field.

I observed this once in my development on the holder pod removal
feature, but I was unable to reproduce and assumed it was my own error.
Since this has been seen in a user environment, it must be that the
error is a race condition, and I am unable to determine the exact source
of the bug.

I do not believe this bug would be present if the code that updates the
CSI configmap were properly idempotent, but it has many conditions based
on prior states, and I was unable to determine how to resolve this
underlying impelementation pattern issue.

Instead, I opted to separate the `clusterKey` parameter into two clear
parts:
1. `clusterID` for when `clusterKey` is used as an analogue for
   `clusterID`
2. `clusterNamespace` for when `clusterKey` is used as an analogue for
   `clusterNamespace`

I added unit tests to ensure that SaveClusterConfig() will be able to
detect when the namespace is currently missing, and using the new
`clusterNamespace` field, it should always know what value to use as
input when correcting the bug in already-installed systems.

I also verified that this update works when the function simultaneously
removes netNamespaceFilePath entries, and that those entries are removed
properly.

Finally, manual testing also verifies the change.

Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
2024-05-02 13:58:00 -06:00
Travis Nielsen 954b000ba6 mon: disable v1 port if msgr2 is required
The mon was listening on both v1 and v2 ports inside the daemon
even though the service endpoint would not redirect any traffic
to the v1 port. When msgr2 is required, disable the mon from
listening on the v1 port for reduced security footprint.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2024-05-01 15:07:10 -06:00
Travis Nielsen 25d36c4c75 mon: remove quincy check since quincy is min version
With the removal of Ceph Pacific support, no need to check if Quincy
is avaiable to support encryption on the wire.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2024-05-01 15:07:09 -06:00
Travis Nielsen 539543e211 Merge pull request #14106 from subhamkrai/fix-portable-mon-scaledwon
mon: fix mon scaledown when mons are portable
2024-04-25 10:39:52 -06:00
subhamkrai d23a8433ed mon: fix mon scaledown when mons are portable
in case of portable mons, mon scaledown was skipped
with below code
```
if mon.NodeName == "" {
			logger.Debugf("mon %q is not scheduled to a specific host", mon.DaemonName)
			continue
		}
```
which skips mon removal if mon nodeName is empty
but if mons are scale down in case of portable mons
in that case also we want to remove extra mons to match
the cephCluster configuration.

Signed-off-by: subhamkrai <srai@redhat.com>
2024-04-25 21:28:49 +05:30
Travis Nielsen 85b542faaf Merge pull request #14082 from momantech/master
docs: delete duplicate words and revise the names of some methods
2024-04-25 08:52:52 -06:00
Praveen M faf7837621 csi: update csi sidecars' image version
Below sidecars are updated with latest available versions

csi-node-driver-registrar: v2.10.1
csi-resizer: v1.10.1
csi-provisioner: v4.0.1
csi-attacher: v4.5.1
csi-snapshotter: v7.0.2

Signed-off-by: Praveen M <m.praveen@ibm.com>
2024-04-25 18:58:00 +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
Travis Nielsen 1bde2ed8b1 Merge pull request #14124 from findmyhappy/master
core: fix function names in comment
2024-04-24 11:19:34 -06:00
findmyhappy c43c7aaf98 core: fix function names in comment
Some function names in the comments do not match. This PR will fix such problems.

Signed-off-by: findmyhappy <findhappy@sohu.com>
2024-04-24 21:04:58 +08:00
parth-gr 47ed6a8632 csi: create csi configmap if csi controller is disabled
Creating a cluster never succeeds if CSI driver is disabled
So to fix that we need to always create the csi configmap

closes: https://github.com/rook/rook/issues/14123

Signed-off-by: parth-gr <partharora1010@gmail.com>
2024-04-24 18:06:09 +05:30
Steven Fackler 0c38dd81c2 operator: support custom dashboard service labels and annotations
Unlike other components, the Ceph dashboard Service object could not be
configured with custom labels and annotations. This can be useful when
integrating Rook into a cluster with custom controllers similarly to how
the RGW service is customized.

Signed-off-by: Steven Fackler <sfackler@gmail.com>
2024-04-23 15:28:19 -04:00
Travis Nielsen acd7b4faa0 osd: legacy osds on lvm pvcs crash on resize init container
OSDs on LVM-mode PVCs are failing to come up and crashing
in the expand-bluefs init container. To avoid the crash
and allow the OSDs to start, a workaround was found to
simply remove that init container. Now we disable the
OSD resize for this case to avoid others hitting this
during upgrade as well.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2024-04-19 16:26:45 -06:00
Blaine Gardner 605b9633ea csi: ensure correct csi config map owner during creation
In the primary CSI reconcile, ensure the CSI config map
(`rook-ceph-csi-config`) has the correct owner info.

This corrects any pre-existing config maps that might have incorrect
owner info, which has observed to include references to CephClusters.
The config map should only have a single reference, and it should refer
to the operator deployment.

If any existing Rook clusters have a CSI config map which has a
CephCluster as an owner, this change will ensure that the config map is
not deleted when the CephCluster is deleted. This is especially
important for any environments with multiple CephClusters installed.

Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
2024-04-18 12:53:48 -06:00
Blaine Gardner eb3278d575 csi: only create CSI config configmap in CSI reconciler
There have been some issues with non-CSI Rook controllers that are
creating the CSI config configmap (`rook-ceph-csi-config`). This causes
problems with the K8s OwnerReference. The primary CSI reconciler
(controller) creates the configmap with the correct owner reference,
which is supposed to be the operator deployment.

Other instances were creating the configmap with owner references set to
the CephCluster. This is a minor bug, but it can result in this
configmap being deleted along with the first CephCluster that initially
created it.

To fix this issue, remove all instances of `CreateCsiConfigMap()` except
the single usage which the CSI reconcile uses to initially create the
configmap. Other controllers that might have attempted to create this
configmap previously will return an error indicating that it is waiting
for the configmap to be created.

Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
2024-04-18 12:22:00 -06:00
Travis Nielsen a9fded2345 Merge pull request #14079 from BlaineEXE/load-cluster-owner-info-in-LoadClusterInfo
operator: load cluster owner info in LoadClusterInfo
2024-04-16 16:00:11 -06:00
Blaine Gardner bd9447ea4c operator: load cluster owner info in LoadClusterInfo
The CreateOrLoadClusterInfo (and therefore LoadClusterInfo) methods were
not loading the ClusterInfo.OwnerInfo. This should help future CRD
controllers get the full ClusterInfo struct without having missing
information. Current controllers that need ClusterInfo fill the field
themselves.

During testing, I observed one corner case where an upgraded cluster was
missing the `rook-ceph-csi-config` configmap. The cluster had a
CephFilesystemSubVolumeGroup resource created, and the reconcile for
that resource was attempting to create the missing CSI configmap and
failing with a nil pointer exception due to the missing OwnerInfo field
in ClusterInfo. This cluster condition hasn't been reproduced in healthy
environments, and it is unknown how the CSI configmap came to be
missing. However, the case did expose the missing loaded info as a
potential for causing nil pointer exceptions during corner cases when
code is otherwise correct.

Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
2024-04-16 13:09:39 -06:00
Travis Nielsen 61332caa4b Merge pull request #14049 from NymanRobin/crd-output-enhancements
operator: make CephBlockPoolRadosNamespace and CephFilesystemSubVolumeGroup get outputs more verbose
2024-04-16 12:00:15 -06:00
NymanRobin 70a7e61da5 operator: make crds outputs more verbose
The following printcolumns were added

CephBlockPoolRadosNamespace: Phase,
BlockPoolName, Age
CephFilesystemSubVolumeGroup: Phase,
FilesystemName, PinningConfig, Age

Also improved the error messages in
SubVolumeGroupClient

Signed-off-by: NymanRobin <nyman.robin@gmail.com>
2024-04-16 08:40:16 +03:00
Travis Nielsen 319a12fd18 Merge pull request #14042 from clonefetch/master
core: fix function names in comment
2024-04-15 11:35:33 -06:00
clonefetch 29ff8d9823 core: fix function names in comment
Signed-off-by: clonefetch <c0217@outlook.com>
2024-04-16 00:54:42 +08:00
Travis Nielsen 499a09ed72 Merge pull request #14052 from sp98/cleanup-radosnamespace
Cleanup RADOS namespace with forced deletion annotation
2024-04-12 11:11:47 -06:00
sp98 f6b1449faa core: cephblockpoolRadosNamespace cleanup
Clean up pool images and snapshots in the
radosnamespace

Signed-off-by: sp98 <sapillai@redhat.com>
2024-04-12 21:49:49 +05:30
Travis Nielsen a38b0b0f98 Merge pull request #14063 from microyahoo/nit
core: fix typos in reconcile cluster disruption
2024-04-12 07:34:25 -06:00
Travis Nielsen fed574b0a3 Merge pull request #14002 from travisn/device-set-dup
osd: Prevent osd reconcile when device set names duplicated
2024-04-12 07:26:40 -06:00
Liang Zheng 30bdd43e27 core: fix typos in reconcile cluster disruption
Signed-off-by: Liang Zheng <zhengliang0901@gmail.com>
2024-04-12 17:11:41 +08:00
Travis Nielsen 309b164c49 test: reduce wait time for mds standby test
The mds standby test was timing out after six seconds on
three different attempts, causing a single unit test to
take almost 20 seconds. Now we reduce the wait time to
a total of three seconds.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2024-04-11 16:19:39 -06:00
mmaoyu 6d4afe23e5 osd: add option upgradeOSDRequiresHealthyPGs
For check if cluster PGs are healthy before osd updates
Which helps gainning more confidence in the osd upgrades

Signed-off-by: mmaoyu <wupiaoyu61@gmail.com>
2024-04-11 10:30:27 +08:00
Madhu Rajanna f57a8b6bbe subvolumegroup: add support for size and datapool
cephfs subvolumegroup supports creating svg
with quota and the datapool, This PR adds the
support for the same.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2024-04-10 16:40:56 +02:00
sp98 ef00fdac53 core: subvolumegroup clean up
Cleanup the resources created by subvolumegroup
when its deleted. Following resources will be cleaned up:
- OMAP value
- OMAP keys
- Clones
- Snapshots
- Subvolumes

Signed-off-by: sp98 <sapillai@redhat.com>
2024-04-10 17:34:45 +05:30
subham rai 71b3728a99 Merge pull request #13958 from NymanRobin/improve-kubectl-get-output
operator: improve the output of kubectl get
2024-04-03 10:42:17 +05:30
NymanRobin 17adb16d0b operator: improve the output of kubectl get
make the kubectl output for crds more verbose.
Following changes was done for each crd:

CephBlockPool:
Added print columns:
 - Type
 - FailureDomain
 - Replication
 - EC-CodingChunks
 - EC-DataChunks
 - Age
Extended info field of status to include:
type and failureDomain

CephObjectStore:
Added print columns:
 - Endpoint
 - SecureEndpoint
 - Age

Added Age to print columns of following crds:
CephObjectStoreUser, CephObjectZoneGroup,
CephObjectZone, CephBucketTopic, CephClient,
CephRBDMirror, CephFilesystemMirror,
CephFilesystemSubVolumeGroup

Signed-off-by: NymanRobin <nyman.robin@gmail.com>
2024-04-02 20:41:13 +03:00
Travis Nielsen 3eed04e792 Merge pull request #14005 from sp98/use-correct-pool-name
core: use correct pool name to disable mirroring
2024-04-02 10:52:55 -06:00
sp98 996d9e136a core: use correct pool name to disable mirroring
Pool name either come from CephBlockPool name or
form the CephBlockPool Spec. Use the correct name
when trying to disable mirroring.

Signed-off-by: sp98 <sapillai@redhat.com>
2024-04-02 21:35:59 +05:30
Praveen M f985018f57 csi: update cephcsi to v3.11.0 release
This commit updates default cephcsi driver version
to v3.11.0

Signed-off-by: Praveen M <m.praveen@ibm.com>
2024-04-02 20:13:56 +05:30
Travis Nielsen 7f68d8be38 osd: prevent osd reconcile when device set names duplicated
If device set names are duplicated, the OSDs will be very confused
when multiple OSDs attempt to be configured with the same
device set names. Updating the device set names does not help
get out of the error situation since the OSDs will also be
confused about which device set they belong to. The reconcile
must fail completely if the device set names are duplicated
to avoid this error scenario.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2024-04-01 16:36:21 -06:00
Travis Nielsen 1c612b0f18 object: set non-ec shared pool to metadata pool
The omap data for multipart uploads is stored in an
additional data pool, which cannot be an EC pool.
So the extra data pool is set to the metadata pool
for object stores with shared pools.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2024-03-28 12:49:43 -06:00
Travis Nielsen 6d9ecce15c Merge pull request #13830 from cybozu-go/fix-removing-key-file
osd: fix removing key file timing
2024-03-26 11:21:33 -06:00
Travis Nielsen 6ab962c84e Merge pull request #13956 from mmaoyu/pdbv1beta1-remove
operator: remove PdbV1Beta1 support as k8s 1.25 doesnt support it
2024-03-26 10:07:52 -06:00
parth-gr a72e029459 csi: add a new flag to disable csi driver
added a new flag ROOK_CSI_DISABLE_DRIVER
to disable csi controller.

Signed-off-by: parth-gr <partharora1010@gmail.com>
2024-03-22 18:22:51 +05:30
piao 6ec1084181 operator: remove PdbV1Beta1 check as k8s 1.25 doesnt support it
Signed-off-by: piao <wupiaoyu61@gmail.com>
2024-03-20 09:38:03 +00:00
Santosh Pillai 20d24613a5 Merge pull request #13905 from sp98/remove-stale-cluster-peers
core: disable mirroring on pool with "image" mode
2024-03-19 20:12:00 +05:30
sp98 a37c47641f core: disable mirroring in image mode
For image mode mirroring, if cephBlockPool.Pool.Spec.Mirroring.Enable
is set to false, then remove the peer cluster and disable mirroring on
all the pool if the user has disabled mirroring on all the pool images.

If mirroring is not disabled on all the pool images, then reconcile will
fail asking the users to manually disable mirroring on those images.

Signed-off-by: sp98 <sapillai@redhat.com>
2024-03-19 14:20:51 +05:30
Yuma Ogami cdd655ed3f osd: delete the key file deletion in encryption open init containers
The key file deletion process is in the shell script commonly used by
all of encryption-open, encryption-open-metadata, and
encryption-open-wal init containers. The key file is deleted at the
encryption-open init container and encryption-open-metadata and
encryption-open-wal init containers are failed to open the key file.

The key file is in the /etc/ceph folder. Unless that folder is shared,
the key file anyway won't be available in the other init containers
even if it is not deleted by these init containers. And it will
naturally anyway be deleted after the init containers are
completed. So The key file deletion process in shell scripts is
unnecessary.

Fixes: #13737

Signed-off-by: Yuma Ogami <yuma-ogami@cybozu.co.jp>
2024-03-19 08:43:36 +00:00
Blaine Gardner e41366bbcd Merge pull request #13890 from BlaineEXE/csi-disable-holder
csi: allow force disabling holder pods
2024-03-14 10:27:06 -06:00