Commit Graph
5036 Commits
Author SHA1 Message Date
Blaine Gardner c92c6fbc36 core: rework usage of ReportReconcileResult
ReportReconcileResult should never be given an object that is nil. It is
impossible to force compile-time checking for this because the object's
type is an interface. We can't force this, but we can rework the
function definition to handle more cases where the object may not be
returned fully-complete, and we can rework callers to return structs
(not pointers-to-structs) so it is less likely a caller will pass nil
to the function.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2022-03-10 16:53:25 -07:00
Travis Nielsen 22dea0a1ef mon: disable startup probe on canary pods
The canary pods are very short-lived pods and are not
running ceph in any form. The startup probe was mistakenly
enabled for the canary pod, which could cause the pod
to fail unexpectedly if the startup probe was triggered
after the delay timeout.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-03-10 12:19:55 -07:00
Travis Nielsen 03c7164b15 mon: options for enabling msgr2 encryption and compression
msgr2 allows for encryption and/or compression across the wire.
Settings for enabling the encryption and compression are now
available in the cluster CR to that ceph will be automatically
configured with these settings when desired.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-03-10 11:50:42 -07:00
Travis Nielsen 9f6804515c mon: enable msgr2 by default for new mons
New mons all support msgr2, so there is no need to keep the default
msgr1 port for new mons.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-03-10 11:48:47 -07:00
Travis Nielsen 2b2231eb0c mon: no need to enable msgr2 since nautilus
Since Nautilus, mgr2 is already enabled by default. No longer
does the operator need to enable msgr2 after the mons are
configured or upgraded.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-03-10 11:48:47 -07:00
Travis Nielsen 8bce38fadb csi: populate mon endpoints even if driver not enabled
If the csi driver was enabled at a later time, the mon endpoints
would not be populated. The populate the csi config, either a new
cluster reconcile or restarting the operator would be necessary.
It is simpler just to update the csi configmap with every reconcile
even if the csi driver is not enabled.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-03-10 10:20:58 -07:00
Travis Nielsen 76b349d808 csi: log a warning if pod namespace env var not found
If the pod namespace was not found by the csi helper to update
the mon endpoints configmap, the reconcile was failing. To allow
for the update to continue in unit tests and ignore the env var,
we only log the warning instead of failing the reconcile.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-03-10 10:20:51 -07:00
Sébastien Han 74081d90d3 osd: clarify vault auth error message
When kube authentication is used, let's clarify the error message and
hopefully lead to a better understanding on where to look for.
It could be misleading to print "token auth" when using kube auth,
although internally a token is used (the JWT from the Service
Account).

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-03-10 14:10:19 +01:00
Travis Nielsen a181988f6d Merge pull request #9868 from TomHellier/9867-fix-to-csi-plugin-provisioner-resources
core: fix empty string bug
2022-03-09 10:40:12 -07:00
Travis Nielsen 41ca6f6f5c Merge pull request #9847 from parth-gr/cluster-status-fsid
core: sync ceph fsid on cephcluster status
2022-03-09 10:37:06 -07:00
parth-gr 2e89ff0fd9 core: sync ceph fsid on cephcluster status
FSID will be updated with cephcluster CR status
when monitoring check get start

Signed-off-by: parth-gr <paarora@redhat.com>
2022-03-09 21:57:37 +05:30
Tom Hellier 59b4c57406 core: fix empty string bug
This function was always using an empty string, instead of the extracted resources

Closes: #9867
Signed-off-by: Tom Hellier <me@tomhellier.com>
2022-03-09 16:11:19 +00:00
Blaine Gardner b640969a64 nfs: remove secret, configmap when downscaling CephNFS
When downscaling CephNFS clusters, be sure to remove secrets and
configmaps. Also be sure to only downscale for the currently-reconciling
CephNFS cluster.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2022-03-08 12:46:13 -07:00
Blaine Gardner 27ea49b9cd osd: disable raw mode for specific disk configs
If a specific disk is configured to have more than one OSD per device,
or if it has a metadata device specified, exclude it from raw mode on an
individual basis.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2022-03-07 08:35:14 -07:00
Travis Nielsen bc6381169e core: disruption controller log ceph errors in debug level
The controller for disruption budgets is verbose at cluster creation
when the cluster is not yet created, which generates a lot of noise
in the log that makes the cluster look unhealthy. This is an expected
condition, so we can change this logging to debug level.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-03-03 14:36:27 -07:00
Travis Nielsen 08aed0213c Merge pull request #9567 from Madhu-1/fix-9220
csi: add custom ceph.conf for csi pods
2022-03-01 08:19:02 -07:00
Madhu Rajanna 2076a3c788 csi: add custom ceph.conf for csi pods
Currently, the admin/user can configure the ceph.conf
for daemon pods using https://rook.io/docs/rook/v1.7/
ceph-advanced-configuration.html#custom-cephconf-settings.
This the above custom ceph.conf is only for ceph pods.
the support to provide constom ceph.conf for cephcsi
is added in cephcsi PR 2476

This PR adds the support to create/update
ceph.conf for csi pods.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2022-03-01 12:42:59 +05:30
Travis Nielsen c8e68511ce Merge pull request #9804 from travisn/cleanup-metadata-pvcs
osd: Purge job will remove all pvcs for the osd
2022-02-28 11:08:38 -07:00
Travis Nielsen 879bde4416 osd: remove osd with purge instead of destroy
The osd destroy command leaves the osd id in use instead
of fully purging the osd id. If the osd id is not also
removed, it gives the impression that there is still
something that needs to be cleaned up from the old osd.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-02-25 12:02:20 -07:00
Travis Nielsen b3ca0f1b87 osd: purge job will remove all pvcs for the osd
The purge job is intended to clean up all the resources
related to an OSD that is to be removed. An OSD with
a metadata, wal, and data PVC was only cleaning up the
data PVC. Now the metadata and wal PVCs will also be
cleaned up.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-02-24 12:05:15 -07:00
Travis Nielsen 1f8f71b396 file: allow filesystem removal even with failures
If the filesystem is in a bad state such as never being
created successfully in the first place, the filesystem
removal will continuously fail and prevent the CR from
being removed. Thus, we treat the filesystem removal
as a best effort and log the issue instead of failing
the uninstall reconcile.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-02-23 16:01:58 -07:00
parth-gr 413662d475 core: change livenessProbe file name to probes
Added unit test for probes changes and
did re-naming of liveness probes file
as it will contain multiple types of probes

Signed-off-by: parth-gr <paarora@redhat.com>
2022-02-23 17:20:07 +05:30
parth-gr 2cf89b11df rgw: use ceph config probes for rgw
use the common method ConfigureStartupProbe and
ConfigureLivenes probe for rgw probes configuration

Signed-off-by: parth-gr <paarora@redhat.com>
2022-02-22 20:36:40 +05:30
parth-gr 1679af4a02 mds: override mds startup liveness probes from CephFilesystem CR
Rook code allows overriding the probes for mds from the CephCluster,
but this should really come from the CephFilesystem CR.

Closes: https://github.com/rook/rook/issues/9519

Signed-off-by: parth-gr <paarora@redhat.com>
2022-02-22 20:36:40 +05:30
Sébastien Han 3f97132fd1 Merge pull request #9751 from thotz/set-default-for-zone-zonegroup-external-rgw
object: set default zone/zonegroup/realm values for external rgw
2022-02-22 09:15:02 +01:00
Jiffin Tony Thottan 022645f71d object: set default zone/zonegroup/realm values for external rgw
currently if multisite is not configured Rook sets values for
zone/zonegroup/realm as object store name which is only valid for
internal ceph object store. This may not exists for rgw running in
external cluster.

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2022-02-21 14:25:24 +05:30
Satoru Takeuchi 1fd8e9ef98 osd: re-enable raw mode on disk
We can re-enable raw mode OSD on disk if Ceph version is at least v16.2.6.

https://github.com/ceph/ceph/pull/42469

Closes: https://github.com/rook/rook/issues/9659

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2022-02-21 00:09:45 +00:00
Sébastien Han 3b0547a88c Merge pull request #9760 from leseb/fix-external-cluster-csi-validation
core: various external mode enhancements
2022-02-17 16:44:17 +01:00
Satoru Takeuchi f6abe14d03 Merge pull request #9746 from travisn/osd-return-error
osd: Return error if fail to list osds in prepare job
2022-02-18 00:13:08 +09:00
Sébastien Han 0143a8f8ee core: remove unnecessary secret validation
We don't need to validate the name of Ceph-CSI secret, simply because
the names can be different. The default example have default names but
since the secret can be created by the administrator we should not
assume anything. This check will fail if the secret names are different
for whatever reason. This is especially true for external mode. In
converged mode Rook creates the secrets on its own if needed to ease the
integration with the default StorageClass examples.

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-02-17 15:33:54 +01:00
Sébastien Han 47b8bb989e core: move clusterInfo discovery in converged cluster
The external code has its own mechanism to look up the clusterInfo so
let's move this to the non-external condition to clarify the code.

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-02-17 15:32:37 +01:00
Sébastien Han fdcad15b87 core: check for canceled context in external mode
This is fixing a potential race where the context is canceled and the
external cluster is trying to fetch the cluster info. If the context is
canceled then the loop will be stuck forever. Now we check for the
canceled context and return appropriately.

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-02-17 15:30:25 +01:00
Madhu Rajanna f482b1ceba core: remove rbd_default_features setting
Instead of setting the default values in the Rook
we should use the defaults provided by the ceph
it self. This configuration is causing problem
for the rbd image creation, this is not allowing
the rbd images to have default image features
which comes with librbd.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2022-02-17 16:08:55 +05:30
Sébastien Han d86351aa1c Merge pull request #9728 from thotz/vault-kms-backendpath-tranist-engine-fix
object: fix backend path for transit engine for rgw kms
2022-02-16 10:21:08 +01:00
Travis Nielsen d4b8fa19b2 osd: return error if fail to list osds in prepare job
The OSD prepare job was succeeding even if the OSDs failed to be listed
by ceph-volume. These errors should be returned and fail the job, resulting
in a retry to retrieve the OSDs. Otherwise, the failure is masked and
the admin needs to dig through logs to find why the OSDs were not configured
on that node.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-02-15 15:49:50 -07:00
Travis Nielsen 1d5b43593e Merge pull request #9718 from travisn/node-placement-logging
osd: Write log message when node is being skipped
2022-02-15 08:14:56 -07:00
Jiffin Tony Thottan 0b4cdb992b object: fix backend path for transit engine for rgw kms
The backend path was added with additional `transit` to it.
Also added PR test case to check transit engine

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2022-02-15 18:49:31 +05:30
Travis Nielsen 476e94632b Merge pull request #9713 from Rakshith-R/cleanup-csi
csi: cleanup csi driver resources when zero cephclusters exist
2022-02-14 13:31:20 -07:00
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
Sébastien Han 7f32461b8f rgw: fix variable assignment
We need to explicitly assign the ceph version within each scope since
one function returns a pointer and one is not.
Previously, the `desiredCephVersion` was recreated in the scope of the
`else` and thus a new variable `desiredCephVersion` was initialized (see
the `:=`).
Now, each scope creates and assign to clusterInfo a `desiredCephVersion`
value.

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-02-14 12:42:30 +01:00
Sébastien Han c3e02e7295 Merge pull request #9724 from leseb/fix-external-object
object: do not check for upgrade on external mode
2022-02-11 09:32:55 +01:00
Travis Nielsen 2d3839bf41 Merge pull request #9715 from leseb/ix-9714
core: do not dereference a non-pointer
2022-02-10 09:56:08 -07:00
Sébastien Han 856b14e60a object: do not check for upgrade on external mode
The object child controller should not compare versions if the object
store is external. The current version comparison is using the
cmdreporter to check the ceph version of the image in the CephCluster spec.
In external mode, this image is not set so the cmdreporter fails.
Also, this check is only valid for converged mode, so external mode
should be skipped.

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-02-10 17:41:01 +01:00
Sébastien Han 32998cbda4 core: do not dereference a non-pointer
In this case `oldMappingToGo` and `newMappingToGo` were not pointers so
there is nothing to dereference.
This happens when the monitors endpoints configmap is updated, but only
on the pool and file controllers. They are watching for changes on that
configmap so that they can reconcile and upate the bootstrap peers token
when replication is enabled.

Closes: https://github.com/rook/rook/issues/9714
Signed-off-by: Sébastien Han <seb@redhat.com>
2022-02-10 17:11:38 +01:00
Travis Nielsen 8e8c95d342 Merge pull request #9702 from sathieu/registrar_v2.5.0
csi: bump registar image to v2.5.0
2022-02-10 08:59:30 -07:00
Sébastien Han 23832c8cc7 osd: add namespace in vault client
If the KMS connection details for Vault have a VAULT_NAMESPACE we must
use it when building the vault client to auto-detect the KV internal
version.

Signed-off-by: Sébastien Han <seb@redhat.com>
2022-02-10 12:13:41 +01:00
Rakshith R 1e9920fb85 csi: cleanup csi driver resources when zero cephclusters exist
This commit modifies ceph-csi controller to be able to cleanup
ceph-csi deployment,daemonset,services & csidriver objects
when no cephcluster exists.

It makes the following changes:
- redundant check for tp.DriverNamePrefix is removed.
- retry to start drivers within reconcile loop is removed,
  controller will retry in case of error now.
- stopDrivers() will now return error in case of failure.
- predicate delete func will now respond to cephcluster deletion.
- CSI resources will be cleaned up when cephcluster does not exist.

Fixes: #9697

Signed-off-by: Rakshith R <rar@redhat.com>
2022-02-09 12:07:34 +05:30
Travis Nielsen 221b3dfb72 object: update pool properties during reconcile
The reconcile was skipping updating most pool properties for
object stores. The implementation of pools between the file,
object, and pool controllers had some duplicate code, so
this change also factors out the common code for better
reuse in a single place. Anytime a pool is created or updated,
it will now consistently update all the pool properties
that are expected to be modifiable.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2022-02-04 13:41:12 -07:00
Satoru Takeuchi 2d8f9b67c6 core: eliminate unnecessary code
We can eliminate the OSD creation code for Ceph < v15.2.0 because Nautilus(v14.2.z)
is no longer supported. In other words, we can now expect that all newly-created
OSDs on PVC are raw mode.

Please note that the existing lvm mode OSDs on PVCs still be supported after this change.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2022-02-04 13:59:01 +00:00
Mathieu Parent 405dcaadac csi: bump registar image to v2.5.0
Upgrades image:

- k8s.gcr.io/sig-storage/csi-node-driver-registrar: v2.4.0 -> v2.5.0

Detailed changelog:

- https://github.com/kubernetes-csi/node-driver-registrar/blob/v2.5.0/CHANGELOG/CHANGELOG-2.5.md

Signed-off-by: Mathieu Parent <mathieu.parent@insee.fr>
2022-02-04 11:19:43 +01:00