Commit Graph
98 Commits
Author SHA1 Message Date
Santosh Pillai d1c82015f9 ceph: stop orchestration restart on device config map update for osd on pvc
when running OSD on PVC, orchestration should not be started again if there is any change in the device config
map. Added a check to skip orchestration on device CM update when StorageClassDeviceSets are available,
that is, when running osd on pvc.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2019-10-30 20:00:27 +05:30
rohan47 7f9611d489 Ceph: Added removeOSDsIfOutAndSafeToRemove to Cluster CR
OSDs can be removed automatically with the current mechanism if a new
setting removeOSDsIfOutAndSafeToRemove is set to true. The default for
all new or upgraded clusters should be false.

Signed-off-by: rohan47 <rohgupta@redhat.com>
2019-10-23 15:10:36 +05:30
travisn bc68440006 ceph: more robust removal of cluster finalizer
The cluster finalizer in some scenarios was not being removed
during cluster removal. Specifically, if the cluster CR had been
modified, the operator would always fail to remove the finalizer.
This could occur when the CR status is updated around the same time
that the cluster is deleted. Therefore, we need to remove the finalizer
from a freshly retrieved instance of the cluster.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-10-14 09:29:46 -06:00
Sébastien Han 148f8da1fb ceph: relax pre-requisite for external cluster
We now differentiate the cases where:

* we only consume the external cluster
* we consume the external cluster as well as creating stateless
resources in Kubernetes (bootstrap mds,rgw, nfs)

This is mostly controlled via the image property spec. If not defined,
not extra CRs won't be able to be created.

Now the external cluster feature supports Ceph cluster as of Luminous 12.2.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-10-08 10:52:01 +02:00
Madhu Rajanna ec9784203e Add check for csi volumes before cluster delete
Add a finalizer to the CephCluster to check
the PV created by CSI so that we can block the
cluster deletion till the PVC are deleted.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-09-26 20:15:11 +05:30
Kristoffer Grönlund fb599dd02b Ceph: Remove finalizer even if flex is disabled
When the flex driver is disabled, the check for
volume attachments will fail and the finalizer
is never removed. To avoid this, just log the
failure to list volumes and remove the
finalizer anyway.

Resolves #3912

Signed-off-by: Kristoffer Grönlund <kgronlund@suse.com>
2019-09-24 08:22:30 +02:00
Sébastien Han 087d71106b ceph: add a new CR property to force upgrades
On rare occasion, the ceph checks might not be 100% correct and the user
might decide to force an upgrade anyway.
Correctly, if we are in an upgrade, we perform `ok-to-stop` check for
each daemon, if one of them fails, we retry and eventually fail.
They are corner-cases where users would like to force the upgrade anyway.

Enhance the new CR property: "skipUpgradeChecks: true".

Closes: https://github.com/rook/rook/issues/3872
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-09-19 10:55:56 +02:00
Alexander Trost 0827df646a docs/ceph: add list of unusable directories paths
This adds a list of unusable directories paths to the Ceph Cluster CRD
doc page and the Ceph operator validation code. Reason for adding these
directories is that they are causing errors during Ceph OSD deployment.
Example: When an user wants to use `/rook` as a directory for an OSD,
the cluster deployment fails because the `mountPath`s must be unique:
```
Job.batch "rook-ceph-osd-prepare-NODE" is invalid: spec.template.spec.containers[1].volumeMounts[4].mountPath: Invalid value: "/rook": must be unique
```

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2019-09-13 14:06:32 +02:00
Blaine Gardner 3a243d2978 ceph: remove configOverride functionality from CRD
After further consideration and working with the feature for a few
weeks, the `configOverride` functionality seems to be more complexity
than is worth it for the expected benefit. Users still have the most
preferred option of setting configs in Ceph's config database using
`ceph cofig set` or the dashboard, and the override ConfigMap still
exists for fallback scenarios. The config database can still be used
by Rook for setting necessary configs, but the user has no way of
telling Rook to do so.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-09-05 12:30:56 -06:00
Sébastien Han bc1a5a9037 ceph: external create 'rook-config-override' cm
This configmap is needed by RGW and MDS pods, if it's not present we
won't be able to start any of them.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-09-04 19:02:08 -06:00
Sébastien Han 9c1bb7c62d ceph: external be a bit more flexible on upgrade
Add various upgrade tests so that the local cluster does not fail if
an upgrade is available on the external cluster.

Also, add better upgrades handling on update and on add. We now rely as
much as possible on a unique function that works both local and external
cluster 'detectAndValidateCephVersion()'. So the code will act the same
way wether a CR update is triggered or if the operator is restarted.

The health check now reports any topology changes on the external
cluster such as odd number of mons and low number. It will also detect
if the external cluster has been upgraded and will log that information,
  helping the admin in his/her decision to trigger an image upgrade.

Finally, we prevent the creation of new CRs if the external cluster
version has a higher major number than the local one.

Closes: https://github.com/rook/rook/issues/3731
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-09-04 19:02:08 -06:00
travisn a9deac7d19 ceph: clean up verbose logging
The log messages for orchestrations being skipped due to nodes still
being schedulable or unschedulable is filling the logs and not necessary.
The log message for reconciling is now debug, and also fixed another
formatting log message.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-30 15:01:35 -06:00
Rohan CJ 4072d14557 Add tests for the clusterdisruption controller and update the docs and
pending releas notes for managed PDBs.

Signed-off-by: Rohan CJ <rohantmp@gmail.com>
2019-08-30 14:04:23 +05:30
Rohan CJ 079c24883b Add a controller-runtime scaffolding
Signed-off-by: Rohan CJ <rohantmp@gmail.com>
2019-08-30 08:59:53 +05:30
Sébastien Han bed14cfd71 ceph: improve upgrade on image change
From now on, Rook will only perform check before upgrades when there is
an actual upgrade. So if the Ceph image changed and a new version is
desired Rook will go through all the daemons and update them one by one
and perform checks in between.

Closes: https://github.com/rook/rook/issues/3583
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-29 10:18:19 +02:00
jiffin abe3678990 adding smoke test for bucket store
Signed-off-by: jiffin <thottanjiffin@gmail.com>
Signed-off-by: Jon Cope <jcope@redhat.com>
Signed-off-by: jeffvance <jeff.h.vance@gmail.com>
2019-08-22 19:54:44 -06:00
c852e86fe9 ceph-rook object bucket provisioner
Signed-off-by: travisn <tnielsen@redhat.com>
Signed-off-by: jeffvance <jeff.h.vance@gmail.com>
Signed-off-by: Jon Cope <jcope@redhat.com>

Co-authored-by: Jon Cope <copejon@users.noreply.github.com>
Co-authored-by: Jeff Vance <jeff.h.vance@gmail.com>
2019-08-22 19:54:43 -06:00
Sébastien Han caa8b9cb2f ceph: external refuse cluster older than Nautilus
The external cluster must run at least on Nautilus. The main reason
being the msgr2 knowledge by the Operator and the Ceph CLI.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Sébastien Han f25e4a6fbc ceph: re-adapt controller code
Re-adapt controller code with the latest changes. Split External and not
external more accuratly in initializeCluster.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Sébastien Han 2d24065ddb ceph: add check for external cluster spec
Before attempting to do anything let's just make sure the spec is
correctly fulfilled.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Sébastien Han 25158d3d2b ceph: purge external cluster metadata
Add code to remove configmap and secret injected and used by Rook to
connect to the external cluster.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Sébastien Han c7174b6b8e ceph: allow deployment of crds on external cluster
We can now deploy all the other Rook's CRDs. They will be deployed in
Kubernetes but will consume the external cluster storage.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Sébastien Han 033a664b56 ceph: controller: enhance external cluster
We now do multiple things:

* write ceph config and key to the operator
* check for the ceph verion and compare it
* set the cluster status

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Sébastien Han e3b2ae5278 ceph: controller rename crd to cr
We are talking about CR ressources (instanciation of CRD) so let's use
the correct word.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Sébastien Han 7f98b77b99 ceph: controller: populate clusterInfo
For external clusters, clusterInfo must be populating so that the
heatlh checker can run correctly.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
travisn 70e4c0ac19 ceph: skip local setup for an external ceph cluster
When configuring an external cluster the orchestration of discover and all the ceph
daemons will be skipped. The operator will still watch for the creation of
crds for this namespace. When a filesystem, object, object user, or
ganesha crd are created, the operator will simply print an error
to the log.

Signed-off-by: travisn <tnielsen@redhat.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:32 +02:00
travisn 12979f4259 ceph: wait for external mon connection info
Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-22 17:19:32 +02:00
travisn 7ab689ee8e ceph: skip local setup for an external ceph cluster
When configuring an external cluster the orchestration of discover and all the ceph
daemons will be skipped. The operator will still watch for the creation of
crds for this namespace. When a filesystem, object, object user, or
ganesha crd are created, the operator will simply print an error
to the log.

Signed-off-by: travisn <tnielsen@redhat.com>
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:32 +02:00
Ashish Ranjan 8d852359b9 fix ceph cluster namespace not showing in the logs
This commit fixes cluster namespace not showing in the rook operator logs.

Signed-off-by: Ashish Ranjan <aranjan@redhat.com>
2019-08-20 17:30:17 +05:30
travisn be391de73c resolve changes from merge conflict in upgrade changes
The upgrade changes for #2901 added the check for the correct version
of the ceph image before continuing with an upgrade. This commit is
to refactor that change to work with the new code path to validate
the ceph version.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-13 07:23:00 -06:00
travisn 98d0a59c91 ceph: create cluster during onUpdate event if needed
If the cluster is not successfully initialized during the onAdd event,
the cluster will not be in a properly initialized state. The admin
will likely need to update the CR, in which case the onUpdate event would
be triggered. In this case we need to call the same code path as the
onAdd event to properly initialize the cluster.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-13 07:23:00 -06:00
travisn 9a3dc52a11 ceph: minimum version allowed is mimic 13.2.4
With the 1.1 release we should not be creating bluestore OSDs
with rook's legacy partitioning scheme. All new bluestore OSDs
should be created with ceph-volume. Therefore, the miminum
version allowed is a version of mimic supporting ceph-volume.

This commit also adds consistent version checking between
the Add and Update methods for the operator handling the
CR events.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-13 07:22:59 -06:00
travisn 258a66554f ceph: remove unnecessary CR validation
Range checks for CR values are done statically in the CRD
for the number of mons. There is no need to check in the code
if the mon count is out of range.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-13 07:17:38 -06:00
John Mulligan 17fad8e958 ceph: plumb a mutex for csi config map updates through the application
Create a mutex at the rook operator level that will be used when
updating the shared-between-clusters config map that Ceph CSI consumes.
Pass the mutex down to the function that will update the CM.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-12 16:41:26 -04:00
Noah Watkins df20c7da17 ceph: shush device discovery log messages
fixes: #3483

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-07-31 14:34:24 -07:00
Travis Nielsen e5779f79d5 Merge pull request #3533 from ethan-daocloud/patch-1
cleanup: fix log message mis-spelled words
2019-07-29 11:14:37 -06:00
René Kalff 25780878eb Make the ownerreference name match the cluster name referenced
In order to cleanup all cluster resources in case of cluster deletion
all resources have an ownerreference to the cluster crd instance.
Because the name of the reference was incorrectly set to the name of the
namespace the cluster resources can unintentionally be deleted by the
kubernetes garbage collector after a kubernetes cluster anomaly.

Signed-off-by: René Kalff <r.kalff@intermax.nl>
2019-07-26 18:33:38 +02:00
ethan 3a6bef33df cleanup: fix log message mis-spelled words
Signed-off-by: ethan <guangming.wang@daocloud.io>
2019-07-26 16:40:48 +08:00
travisn 3142c3e5cb simplify CR status updates for ceph and edgefs
The status messages on the CRs had much duplicated code
for logging an error if the status update failed.
Now any failures around the status update are logged
consistently within the updateClusterStatus method
so there is no need to return an error and duplicate
the error handling everywhere.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-07-24 12:52:30 -06:00
Alexander Trost 07fbea0fd9 fix usage of Infof in CephClusterController
Currently the ClusterController logs out a message like:
```
Cluster %s is not ready. Skipping orchestration.rook-ceph
```
without the "placeholders" fullfilled. This is because the code uses the
logger.Info() instead of logger.Infof() function.
This change fixes that to use Infof and therefore corrects the log
message.

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2019-07-23 16:08:16 +02:00
Travis Nielsen 41005b53a6 Merge pull request #3456 from travisn/remove-legacy-conversion
Remove legacy Ceph CRD conversion from v1beta1 to v1
2019-07-17 11:52:41 -06:00
Sébastien Han a17c47d36a ceph: upgrade: preserve operator state
This commit makes OnAdd() and OnUpdate() consistent in behavior. They
will do their best detecting if we can upgrade, continue an upgrade or
refuse to do one. It also refuses to downgrade to any version.
It also load ClusterInfo earlier in the controller so that we can
compare the spec version versus the cluster running one.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-17 00:50:42 +02:00
Sébastien Han c24ae45eca ceph: upgrade, don't check osd if aio
If we detect all OSDs are running on the same host, we don't perform any
checks for upgrade.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-17 00:41:40 +02:00
Sébastien Han 25f4f889c5 ceph: upgrade: display success when upgrade is done
If we successfully changed all the Ceph version of all the daemon we
consider the upgrade complete and successfully, thus we display a
message.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-17 00:39:18 +02:00
Sébastien Han bd7df53b18 ceph: refuse to upgrade an un-healthy cluster
If the cluster shows a state of HEALTH_ERR, Rook will refuse to upgrade
it if the image version changed.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-17 00:39:15 +02:00
travisn 9e073857c5 ceph: remove legacy conversion from v1beta1 to v1
In the 0.9 release rook converted the v1beta1 CRD resources
to v1 resources. This conversion code is no longer necessary
as we will be using v1 resources going forward.
The code paths will not be triggered anymore, thus
removing the dead code.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-07-15 16:58:37 -06:00
Blaine Gardner cc359b6d6b Ceph: Fix crit bug in call to detect Ceph version
For all calls to detect the Ceph version, ensure they are consistent.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-07-11 16:37:45 -06:00
Blaine Gardner 5fc99a6266 Merge pull request #3369 from SUSE/cmd-reporter
Add cmd-reporter daemon; use it to get ceph version
2019-07-11 16:05:14 -06:00
Blaine Gardner 2ef83c4027 ceph: use cmd-reporter for ceph version job
Use cmd-reporter to detect Ceph version.

The job to detect Ceph version needs to run in a security account context
capable of getting/creating ConfigMaps, so a new security account, role,
and role binding are created for the cmd-runner jobs. In the future, the
Ceph mgr may create jobs in this service account for running
`ceph-volume` on nodes, and this also keeps Rook operators controlling
multiple Ceph clusters independent.

Fixes #2686 - ceph version job not working correctly with graylog

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-07-05 15:37:14 -06:00
Sébastien Han f183ad2bb1 ceph: controller: fix panic on cr update
If we are running a Ceph cluster that has an unsupported version and if
we have set allowUnsupported: false, a newly bootstrap operator will
fail to start. To fix this, the user will update the CR and set
allowUnsupported: true, however at this point clusterInfo hasn't been
initialized so the operator will panic because we were referencing a nil
pointer.

To fix this, we re-populate clusterInfo if necessary and things go
smoothly.

Closes: https://github.com/rook/rook/issues/3137
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-04 16:21:17 +02:00