Commit Graph
252 Commits
Author SHA1 Message Date
Travis Nielsen 9168c22183 ceph: improve stability of object bucket tests
The object bucket tests will now always check if the conditions being waited
upon for creating users and buckets were completed, instead of allowing
the test to continue even when they didn't succeed.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-08-10 14:46:36 -06:00
Travis Nielsen 89284d9155 ceph: improve object bucket test stability
The object bucket check is sometimes not completed yet
that causes the integration test to fail intermittently.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-08-06 09:25:35 -06:00
tenzen-y 29087f8e41 ci: fix function comments
This commit will fix outdated function comments.

Signed-off-by: tenzen-y <toyonomajyutushi@yahoo.co.jp>
2020-08-05 08:08:53 +00:00
Travis Nielsen 772b7990db ceph: updated clusterroles applied in upgrade test
In the upgrade integration test we need to mirror what we expect
users to do during the upgrade by applying the new clusterroles.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-08-04 16:04:07 -06:00
Travis Nielsen e0ea87a353 Merge pull request #5674 from thotz/quotaobc
ceph: adding support for quota in object bucket claims
2020-07-30 22:51:58 -06:00
Sébastien Han 44355a921b Merge pull request #5920 from binoue/fix-log-output
ci: fix log output
2020-07-30 08:59:12 +02:00
binoue bb224733f6 ceph: fix log output
fix log output

Signed-off-by: binoue <banji-inoue@cybozu.co.jp>
2020-07-30 07:26:20 +09:00
Madhu Rajanna 28f0471106 ceph: update clusterrole of operator for csidrivers
updated the clusterrole of the rook operator
to delete the csidrivers object when csi-drivers
are disabled, without the required access rook operator
cannot delete the csidrivers object.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-07-29 09:41:26 +05:30
Jiffin Tony Thottan f4240cb31d ceph: add quota support for obc
Closes: #5274
Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-07-28 12:00:11 +05:30
Sébastien Han e517ac96aa ceph: fail if the pool fails to be deleted
Let's assert if the pool is still present.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-07-22 17:25:15 +02:00
Sébastien Han 8729a206f3 ceph: let the healthcheck set the status phase
Instead of setting the Phase of the CR once the reconcile is done, let's
actually set in from the healthcheck so it is more accurate.

Closes: https://github.com/rook/rook/issues/5249
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-07-22 17:25:12 +02:00
Sébastien Han 698f46e978 ci: purge after flexsuite
If we don't the mgr tests cannot verify the osd creation and will fail
with:

```
--- FAIL: TestCephMgrSuite (169.32s)
    --- FAIL: TestCephMgrSuite/TestCreateOSD (1.65s)
        ceph_mgr_test.go:217:
            	Error Trace:	ceph_mgr_test.go:217
            	Error:      	Should not be: ""
            	Test:       	TestCephMgrSuite/TestCreateOSD
            	Messages:   	No devices available to create test OSD
        ceph_mgr_test.go:218:
            	Error Trace:	ceph_mgr_test.go:218
            	Error:      	Should not be: ""
            	Test:       	TestCephMgrSuite/TestCreateOSD
            	Messages:   	No nodes available to create test OSD
```

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-07-21 17:10:28 +02:00
Sébastien Han 94c8546d31 ceph: fix some mgr test
Fail if the orch status never gets ready.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-07-17 14:03:58 +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
Travis Nielsen c375ef487f ceph: reenable the cephmgr test against Ceph master
The OSD creation has been fixed in Ceph master, therefore we can
reenable the Ceph mgr test that runs against master.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-07-13 13:51:31 -06:00
Sébastien Han 07c7dd457f ceph: expose endpoint in the CephObjectStoreUser
Now, when an S3 user gets created, Rook will add the S3 endpoint to the
Secret along with the credentials.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-07-10 15:59:47 +02:00
Travis Nielsen 2d793cdc3f ceph: disable ceph mgr test temporarily
Due to an issue in ceph master, the mgr integration test is failing.
Until this is fixed, we will temporarily disable the test. A fix
is expected with https://github.com/ceph/ceph/pull/35915

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-07-06 09:19:41 -06:00
Sébastien Han e4eaa91ede ceph: add rgw endpoint healthcheck
We have introduced a new goroutine to check the state of the rgw
endpoint. It will run every minute and perform operations on a bucket.
The success or failure will be reported as part of the status field of
the CephObjectStore CR.

A good status will look like:

status:
  endpointStatus:
    lastChanged: "2020-06-25T13:47:45Z"
    lastChecked: "2020-06-25T13:48:46Z"
  phase: Connected

A failed status:

status:
  endpointStatus:
    details: |-
      error creating bucket "rook-ceph-internal-s3-bucket-checker": RequestError: send request failed
      caused by: Put http://rook-ceph-rgw-my-store.rook-ceph:8080/rook-ceph-internal-s3-bucket-checker: dial tcp 10.108.189.148:8080: connect: connection refused
    health: ERROR

This check works for both converged and external modes. Note that the
CephObjectStore CRD has a new field called "externalRgwEndpoints" which
allows you to define a list of IP addresses pointing to rgws.

Closes: https://github.com/rook/rook/issues/5692
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-07-02 16:34:10 +02:00
Madhu Rajanna 02c9bfe00f ceph: update RBAC required for external-snapshotter
Updated the required RBAC for external-snapshotter
beta to work.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-07-01 07:20:04 +05:30
Vineet Badrinath ce1003aef8 ceph: adds scripts and components to support admission controllers
adds deploy.sh script to deploy validatingwebhookconfiguration and create secrets.
adds new command ceph admission-controller to start webhook servers.
adds validation for various rook custom resources

Signed-off-by: Vineet Badrinath <vbadrina@redhat.com>
2020-06-24 14:59:00 +05:30
Sébastien Han d950f4f823 ci: add more debug
If we cannot get the bucket we need more debug information.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-06-16 10:19:01 +02:00
Ali Maredia fc579f4520 ceph: initial commit for ceph rgw multisite resources
This commit contains CR implementations for:
CephObjectRealm
CephObjectZoneGroup
CephObjectZone

Also there are changes made to the objectstore
to add rgws in the object-store to zones and
zone groups in a multisite configuration and
the removal of the --default parameter for any
realms/zonegroups/zones that are created.

Signed-off-by: Ali Maredia <amaredia@redhat.com>
2020-06-09 16:28:53 -04:00
Satoru Takeuchi 43296ef36a ceph: make OSD on PVC test work again
OSD on PVC test doesn't work at all because "manual" storage class doesn't
exist here.

It's a regression caused by the following commit.
https://github.com/rook/rook/commit/e96009c26dab8d06e6d3e45efe55b9783028b359

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2020-05-28 06:18:59 +09:00
Satoru Takeuchi 206e45facd ceph: fix the wrong condition in the cluster health check
There are the following problems in the cluster health check.

- If the cluster is healthy: Unnecessary long time before exiting from
  the health check loop. The test succeeds thanks to the succeeding
  assertion by luck.
- If the cluster is unhealthy: Exit from the health check loop immediately.
  The test fails in the succeeding assertion by luck too.

It's a regression that is introduced in the following commit.
https://github.com/rook/rook/commit/c0c0dc4ed977a6b373b1884c5b76c9588f0be077

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2020-05-27 05:20:24 +09:00
Travis Nielsen e1a9a9039b ceph: pool resize test hangs during cleanup
In Octopus 15.2.2 there is an rbd change that causes the rbd ls command
to hang if there are not sufficient OSDs to meet the replica requirement.
The smoke suite just started hanging today since the 15.2.2 image was
released with this change. Therefore, the test that resizes the pool
to replica 3 must resize back to 1 before cleaning up.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-05-19 22:02:37 -06:00
Satoru Takeuchi e96009c26d ceph: prepare PVCs for OSD on PVC test inside the integration test
The PVCs for OSD on PVC test is prepared before running the integration test.
In addition, users are forced to run this script for this by themselves.
To avoid this problem, running this script inside the integration test.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2020-05-14 05:14:27 +09:00
Travis Nielsen b95b89f838 Merge pull request #4913 from jmolmo/mgr_integration_tests
Ceph: manager integration tests
2020-05-11 09:19:29 -06:00
Satoru Takeuchi 22c5743656 cleanup: remove the descriptions of directory-based OSD
Directory-based OSD is not supported in v1.3.0 anymore. Let's remove
the descriptions of this feature. As an exception, it should still
be in the manifests of v1.2.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2020-05-06 00:44:31 +09:00
Satoru Takeuchi c0c0dc4ed9 tests: return bool if the functions are prefixed by "Is"
There are several functions that are prefixed by "Is" and return
just error. It's straightfoward to return bool to make the meaning
of these functions clearer.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2020-05-05 22:55:01 +09:00
Juan Miguel Olmo Martínez 4b492e6f39 ceph: manager integration tests
Ceph orchestrator device ls
Ceph orchestrator status
Ceph orchestrator host ls
Ceph orchestrator create OSD
Ceph orchestrator ls

[test ceph]

Signed-off-by: Juan Miguel Olmo Martínez <jolmomar@redhat.com>
2020-05-04 11:32:56 +02:00
Travis Nielsen 8d72e788c1 ceph: lookup of the cluster cannot rely on namespace name
The name of a CephCluster is commonly the same as the namespace,
but not always. When looking up the ceph cluster we can look for
the first one in the namespace rather than requiring the name
to be the same as the namespace.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-04-22 13:42:40 -06:00
Sébastien Han 7c994441c3 ceph: make admin key optional for external cluster
Currently, we need to configure the Ceph external Admin keyi
in the Rook deployment to be able to connect to an external Ceph cluster.
If we wanted to run in a multi-tenant fashion
were several K8s/Rook clusters wanted to connect to the same external ceph cluster,
each K8s deployment would have the access to the External Ceph Admin key
and could potentially access or delete the Data
from pools that belong to other k8s/Rook Clusters.

Now the admin key is optional but the helper script create-external-cluster-resources.sh
will help create the necessary keys/users to connect to that cluster.

Closes: https://github.com/rook/rook/issues/4917 and https://github.com/rook/rook/pull/5227
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-04-20 09:59:04 +02:00
Juan Miguel Olmo Martínez 28afede309 ceph: refactor <StartTestCluster>
Refactor the StartTestCluster method to make it more readable.

I have put most of the parameters used in this function in the struct.
In this way the call to this function is more easy to understand and to use.
The addition of new parameters to this method started to be annoying.

[test ceph]

Signed-off-by: Juan Miguel Olmo Martínez <jolmomar@redhat.com>
2020-04-16 12:03:45 +02:00
Sébastien Han d16cebea70 ci: modify upgrade to master
We now install 1.2 by default, then we upgrade from 1.2 to 1.3 and 1.3
to master.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-04-15 09:12:57 +02:00
Sébastien Han c1b8a7aa9e ceph: extract rbd-mirror to its own crd
Previously, the rbd-mirror daemon was integrated into the `CephCluster`
CRD. This wasn't really practical since we would have to wait for the
whole orchestration to be done to actually set it up. The same goes for
any CR update. Let's say you want to change the number of daemons, Rook
would go through mons, mgrs and osds until it get to rbd-mirror.
This triggers an undesired full orchestration.

With its own CRD this component just gains a lot more flexibility.

Closes: https://github.com/rook/rook/issues/5084
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-04-15 09:12:56 +02:00
Travis Nielsen c4e712bbd2 tests: convert cli params to env vars
The command line flags parsing inside an init() method was causing
issues at runtime when trying to add certain new features, which
is a limitation of the flag parsing. We now move away from using
any command line flags in the tests and only use environment variables
to simplify adding new parameters to the tests.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-04-14 07:29:18 -06:00
Sébastien Han e17b6e11d5 ci: use exec combined output to check fs status
On Octopus, the "ceph fs status" reports on stderr for some reason.
So we need to combined the output to read the filesystem status.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-04-06 16:07:01 +02:00
Travis Nielsen a737975077 ceph: integration test for upgrade from nautilus to octopus
The upgrade test will now support upgrading from nautilus
to octopus and that files and be read and written
after the upgrade.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-04-06 16:07:01 +02:00
Travis Nielsen d3a8a397f9 tests: skip upgrade test where csi is not supported
The upgrade test requires the CSI driver to be running so we cannot
run the test on older versions than k8s 1.13.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit f90664209b)
2020-04-03 15:57:19 -06:00
Sébastien Han 6062771687 Merge pull request #4901 from travisn/octopus-tests
Run integration tests against octopus
2020-03-31 10:59:11 +02:00
Travis Nielsen ba3e601a50 ceph: update k8s versions for ceph tests on 1.18
With 1.18 in the test matrix we need to update which versions
will run the different ceph test suites.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-30 16:51:02 -06:00
Travis Nielsen 360e5552b6 ceph: run integration tests against octopus
With the release of Octopus we need to run the integration tests
on Octopus in order to have validation as a supported platform.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-30 13:32:47 -06:00
Santosh Pillai 2bfd7c42bc ceph: cleanup cluster.Spec.DataDirHostPath on cluster deletion
In order to ensure proper clean up of all the rook-ceph data when the cluster is deleted, we need to clean up the dataDirHostPath (var/lib/rook)

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2020-03-30 19:36:01 +05:30
Umanga Chapagain ac9244fc1a Ceph: integration test creates ObjectStoreUser before ObjectStore
This fix is added to ensure that everything works as expected
when user tries to create ObjectStoreUser before creating
ObjectStore itself. ObjectStoreUser will wait for ObjectStore
to be up and running.

Signed-off-by: Umanga Chapagain <chapagainumanga@gmail.com>
2020-03-27 18:16:28 +05:30
Satoru Takeuchi a5ea2858c9 manifests: remove unnecessary namespace fields
There are many namespace fields in ClusterRole{,Binding}. However,
ClusterRole{,Binding} are not namespaced. So we can remove these.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2020-03-18 15:58:31 +00:00
Travis Nielsen ce1fedf884 ci: only list the images in the needed pool during cleanup
The pool cleanup only needs to happen for an individual pool.
No need to query the block images in all pools. One of the rgw
pools is periodically causing a hang when it is queried,
but there is no need to query for it when we are cleaning
up the pool tests.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-17 15:28:17 -06:00
Sébastien Han a8159c62c1 ci: enable DEBUG logging
Activate DEBUG logging for the integration tests.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-03-17 15:12:41 -06:00
Sébastien Han 44a4c1826d ci: remove object store when done
Purge the object store properly, otherwise the cephobjectstore CRD won't
be deleted since a finalizer is in place for the CR.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-03-17 15:12:41 -06:00
Sébastien Han f268c897e9 ceph: Convert the Ceph ObjectStore controller to the controller-runtime
The CRD watcher has been replaced by the new controller-runtime
framework.
This brings robustness in our operator, meaning that any resources that
are modified will be reconciled into the desired state.

Closes: https://github.com/rook/rook/issues/4937
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-03-17 15:12:41 -06:00
Travis Nielsen 4ce9b45ffd ceph: remove dead test code for cluster purging
Cluster purging is no longer called, therefore can be removed.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-05 15:39:39 -07:00