Commit Graph
3904 Commits
Author SHA1 Message Date
Sébastien Han 8556f3fe26 ceph: remove pool id from the peer
We don't need to put this information in the token.
It's not useful and not used anywhere.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-08-03 09:44:54 +02:00
Sébastien Han 1c8caa2270 Merge pull request #8379 from leseb/manual-peer-bootstrap
ceph: add an rbd-mirror bootstrap token on cluster creation
2021-08-02 19:03:29 +02:00
Sébastien Han 630c2f6a8b ceph: add an rbd-mirror bootstrap token on cluster creation
They are scenarios where the mirroring information want to be shared
between clusters prior to creating pool. Because the bootstrap peer
import command needs a pool name to operate this is not suitable. So
additionally now each time the cluster is reconciled and on any new
clusters a new secret will be created that contains a boostrap peer
token. It can be exchanged with another cluster.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-08-02 18:34:27 +02:00
Sébastien Han 4e2879a154 ceph: signal signals handling with context
As of Golang 1.16, we can use `signal.NotifyContext()` from the signal
package. Essentially it combines signal handling for termination as well
as canceling the context to stop any ongoing operations.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-08-02 14:19:50 +02:00
Madhu Rajanna b556dbf109 ceph: update cephcsi to v3.4.0
This PR updates the required RBAC, templates,
CSI image version and examples for new
cephcsi v3.4.0 release.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2021-08-02 10:22:54 +05:30
Sébastien Han 082858bf53 ceph: use v16 for mirroring test in ci
The CI test for mirroring now runs on stable v16 tag. Internally our
code has a minimum version of 16.2.5 for cephfs mirroring since it's
available.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-07-30 16:17:08 +02:00
Sébastien Han 7ef127b816 ceph: append additional info in the rbd-mirror bootstrap peer token
If the title looks familiar this is normal, this piece of code was
removed during https://github.com/rook/rook/pull/7604. Probably due to a
rebase. So I'm re-adding the code.

We know append additional information to the rbd-mirror bootstrap peer
token. It is useful for disaster recovery scenario where the other
cluster is reading the peer token and needs to know the pool_id as well
as the namespace.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-07-30 15:40:35 +02:00
Travis Nielsen 30063359da Merge pull request #8410 from leseb/simplify-cluster-creation-internal-flow
ceph: small bootstrap sequence refactor
2021-07-30 07:37:12 -06:00
Travis Nielsen 8304303120 Merge pull request #8355 from anmolsachan/add_metric_label
ceph: added monitoring managedBy label to metrics
2021-07-30 07:28:42 -06:00
Sébastien Han fa3ab50eff Merge pull request #8429 from leseb/admin-ops-api-debug
ceph: change the debug implementation of the admin ops API
2021-07-30 15:23:07 +02:00
Sébastien Han 65aea09e7d ceph: small bootstrap sequence refactor
Moving and factoring code here and there to hopefully make the
initialization sequence easier to go by.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-07-30 15:03:25 +02:00
Anmol Sachan c6944edc37 ceph: added monitoring managedBy label to metrics
This commit adds 'managedBy' label to the ceph metrics if the
cephcluster is managed by another higher Resource. The optional
label shall be added as part of cephcluster CRs monitoring labels.

Signed-off-by: Anmol Sachan <anmol13694@gmail.com>
2021-07-30 11:41:33 +05:30
Travis Nielsen 990d92790b Merge pull request #8420 from travisn/cleanup-old-versions
ceph: Remove old references to luminous and mimic versions
2021-07-29 07:40:46 -06:00
Sébastien Han ad45924807 ceph: change the debug implementation of the admin ops API
The go-ceph library has removed the `Debug` field from the API type in
https://github.com/ceph/go-ceph/pull/543. Since the HTTP Client can be
mutated we now have our own client to dump requests and responses when
the operator log level is DEBUG.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-07-29 13:59:50 +02:00
Sébastien Han 99e00dea1e ceph: auto detect vault k/v version
Rook will now auto detect the kv version of the vault server. This
allows users not having to pass the VAULT_BACKEND configuration in the
CephCluster CR.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-07-29 10:16:31 +02:00
Travis Nielsen f5030f0560 ceph: remove old references to mimic version
References to luminous and mimic, and unnecessary references to nautilus
were found in the docs that have been cleaned up and clarified. At the same
time, the tests are updated to use more recent versions.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-07-28 14:00:35 -06:00
Sébastien Han a62e7e75e7 Merge pull request #8380 from sp98/update-cephblockpool-cr
ceph: add mirroring peer specification to CephBlockPool CRD
2021-07-28 17:34:52 +02:00
Santosh Pillai 3b50f5fd00 ceph: add MirroringPeerSpec to CephBlockPool.Spec.Mirroring
Instead of having the RBDMirroringPeerSpec in the RBDMirror CRD we want
to move it on the CephBlockPool CRD so that each pool can have its own peer.
This enables pool to re-use an existing peer secret if it points to the
same cluster peer.So we don't need to duplicate secret peer anymore.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2021-07-28 17:47:36 +05:30
Satoru Takeuchi 30e4fbb01f ceph: make the timeout of ceph commands cofigurable
Sometimes the default 15s is not enough for timeout of ceph commands. For examples,
I encountered that `radosgw-admin` command took dozens of seconds under heavy load.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2021-07-27 12:42:16 +00:00
parth-gr 6ebd109088 ceph: updated mon health check goroutine for reconfiguring patch values
When changing the settings for the Rook mon health check
(.spec.healthCheck.mon) in the CephCluster resource,
the mon health check isn't reconfigured with the new values

Updated checkHealth goroutine so it can
updates the new patched values

Closes: https://github.com/rook/rook/issues/8363
Signed-off-by: parth-gr <paarora@redhat.com>
2021-07-26 22:51:37 +05:30
Sébastien Han 2481e0c85c ceph: remove non-existing mock
This is what happens when you merge without rebasing onto master
first...
MockExecuteCommandWithOutputFile is gone in
https://github.com/rook/rook/pull/8351 but
https://github.com/rook/rook/pull/8353 was merged before and
https://github.com/rook/rook/pull/8351 should have been rebased first.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-07-23 18:29:08 +02:00
Sébastien Han d55fb8d13b Merge pull request #8351 from leseb/refact-exec-helpers
ceph: remove unnecessary exec helpers
2021-07-23 18:12:57 +02:00
Sébastien Han 0811359d28 Merge pull request #8358 from leseb/move-to-quay
ceph: move all of our docker.io reference to quay.io
2021-07-23 18:03:53 +02:00
Sébastien Han daf53ea585 ceph: add unit test for object store user dependents
Now that we have the mock client for the admin ops api we can add unit
tests.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-07-23 10:01:53 +02:00
Sébastien Han 733c0f72f6 ceph: mock object store user create
Since the mock client was added to the rgw/admin package from the
go-ceph project in https://github.com/ceph/go-ceph/pull/532 we can now
mock the HTTP client and validate the entire reconcile.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-07-23 10:01:53 +02:00
Sébastien Han 6d77a9976c ceph: remove unnecessary exec helpers
Both `ExecuteCommandWithOutputFileTimeout()` and
`ExecuteCommandWithOutputFile()` generate unnecessary system calls by
creating/reading/removing files where the stream output of the command
can simply be used. So sticking with `ExecuteCommandWithOutput()` and
`ExecuteCommandWithCombinedOutput()` for reading outputs is sufficient.

Closes: https://github.com/rook/rook/issues/8343
Signed-off-by: Sébastien Han <seb@redhat.com>
2021-07-23 09:16:33 +02:00
Travis Nielsen 9c06d236b6 Merge pull request #8356 from travisn/cronjob-beta
ceph: Update test to watch for v1 cronjob instead of v1beta1
2021-07-22 12:05:46 -06:00
Travis Nielsen 013e3a22a3 Merge pull request #8359 from leseb/rbd-mirror-code
ceph: remove `removeExtraMirrors()`
2021-07-22 11:34:21 -06:00
Travis Nielsen 16403ac901 Merge pull request #8350 from leseb/fix-7183
ceph: remove operator config `ROOK_ALLOW_MULTIPLE_FILESYSTEMS`
2021-07-22 11:33:40 -06:00
Travis Nielsen 07ddcda0ce ceph: update test to watch for v1 cronjob
The v1beta1 cronjob is deprecated and needs to use v1 for K8s 1.16 and newer

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-07-22 11:25:55 -06:00
Sébastien Han 7c5a86cb85 ceph: remove operator config ROOK_ALLOW_MULTIPLE_FILESYSTEMS
Multiple filesystems are supported as of the Ceph Pacific release. So we
remove the flag from the operator configuration and just have a ceph
version check instead.

The Operator configuration option `ROOK_ALLOW_MULTIPLE_FILESYSTEMS`
has been removed in favor of simply verifying the Ceph version is
at least Pacific.
Multiple filesystems are stable since Ceph Pacific.
So users who had `ROOK_ALLOW_MULTIPLE_FILESYSTEMS` enabled will
need to update their Ceph version to Pacific.

Closes: https://github.com/rook/rook/issues/7183
Signed-off-by: Sébastien Han <seb@redhat.com>
2021-07-22 11:42:33 +02:00
Sébastien Han 6bce1ff3e9 ceph: move all of our docker.io reference to quay.io
Recently, the builds of `ceph/ceph` image moved to quay.io, see
https://github.com/ceph/ceph-build/pull/1883 for more details.
Current images will remain but new builds will happen on quay.io only.

This means that tags such as `v14.2`, `v15.2`,`v16.2` will need to
switch to quay.io to get updates.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-07-22 11:17:05 +02:00
parth-gr 77813f7093 ceph: update PodDisruptionBudget from v1beta1 to v1
This commit update the PodDisruptionBudget policy to use version v1
Updated to policy/v1 as policy/v1beta1 PodDisruptionBudget is deprecated in v1.21+

Closes: https://github.com/rook/rook/issues/7917
Signed-off-by: parth-gr <paarora@redhat.com>
2021-07-22 14:09:33 +05:30
Sébastien Han 0eaa1e71d1 ceph: remove removeExtraMirrors()
Since https://github.com/rook/rook/pull/7180 rook does not deployment
multiple deployments of the rbd-mirror daemon but uses replicas. Users
have upgraded from subsequent 1.6.x release and have that supported so
we can remove this code that was scale up/down the number of
deployments.

Closes: https://github.com/rook/rook/issues/7183
Signed-off-by: Sébastien Han <seb@redhat.com>
2021-07-21 15:11:40 +02:00
Travis Nielsen d1f02f22f3 ceph: test upgrades from v1.6 to master
With v1.7 approaching, the upgrade integration test will now test from
v1.6.x to the latest master, which will effectively become the v1.7
release soon.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-07-20 11:03:40 -06:00
Travis Nielsen 552a67bc3e Merge pull request #8330 from travisn/reconcile-mgr-services
ceph: Reconcile mgr services with every reconcile
2021-07-20 08:19:17 -06:00
Travis Nielsen 14227600cc Merge pull request #7535 from travisn/mon-stretch-location
ceph: Set the location on the mon daemon for stretch clusters
2021-07-20 08:17:01 -06:00
Travis Nielsen 107f89260d ceph: reconcile mgr services with every reconcile
When there are multiple mgr daemons, the mgr sidecar owns reconciling
the services for the active mgr. However, for efficiency the sidecar
only reconciles the services if the active mgr changes. Now the operator
will also reconcile the mgr services to ensure that services are re-created
after being deleted, or otherwise in an incorrect state.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-07-20 07:23:58 -06:00
Travis Nielsen 3d629ea2a4 ceph: set minimum version for stretch clusters to v16.2.5
The stretch clusters pass a new parameter to the mon daemons which is
only available in v16.2.5 and newer. Older versions of Ceph will fail
to run with stretch clusters in rook.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-07-20 07:22:01 -06:00
Sébastien Han 1900160939 ceph: proxy rbd commands when multus is enabled
We now pass the networking spec to the clusterInfo so that the executor
can make the right decision on how to execute a command.
This is a small change that allows us to remove the CephBlockPool CR
since it's checking for rbd images. On a Multus deployment, the operator
does not have the network annotations, thus has no access to the OSD
network then rbd commands are hanging forever.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-07-20 12:28:00 +02:00
Travis Nielsen fca761c950 ceph: set the location on the mon daemon
The mon daemon in a stretch cluster now can have its location set
as a CLI param instead of setting it with a separate command.
This enables mon failover to set the location of a mon immediately
when it is joining quorum instead of having a delayed command
to set the location.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-07-19 14:30:43 -06:00
subhamkrai d254c935e8 ceph: create new keyring for osd
when osd pods removed, they are not able
to add back due to missing `ceph auth`
or different `ceph auth`.

this commit mounts the secret `rook-ceph-admin-keyring`
inside the osd activate initcontainer which has
admin keyring.

Signed-off-by: subhamkrai <srai@redhat.com>
2021-07-19 19:26:06 +05:30
Satoru Takeuchi fa153421db Merge pull request #8304 from cybozu-go/ceph-mount-dev-directory-in-lvm-mode-osd-on-lv-backed-pvc
ceph: mount dev directory in lvm mode osd on  osd on lv-backed pvc
2021-07-14 05:25:59 +09:00
Sébastien Han 1fd76a1168 ceph: add missing ceph cluster spec
The lib-bucket-provisioner was missing the cephCluster spec so the check
in RunAdminCommandNoMultisite would fail.
This is similar to ad54ed8aac just a
different place.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-07-13 18:45:39 +02:00
Satoru Takeuchi 763b076c75 ceph: mount dev directory in lvm mode osd on osd on lv-backed pvc
"/dev/" is only mounted on OSD on device. However, this directory
should also be mounted on OSD on LV-backed PVC.

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

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2021-07-13 12:21:41 +00:00
Satoru Takeuchi 5418d2dceb ceph: create pdb for all rgw and cephfs
Fix the improper breaking from the loops to add pdbs.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2021-07-13 05:23:51 +00:00
Sébastien Han ad54ed8aac ceph: add missing spec to the object context
The CephClusterSpec was missing from the object context, so the check
for the network provider in RunAdminCommandNoMultisite() was not
discovering the network property correctly.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-07-12 15:46:09 +02:00
Sébastien Han f074c12c4d ceph: get the s3 user first instead of create
The Rados Gateway Admin OPS API has changed its behavior from Nautilus
to Pacific. Calling user create on an existing user wil generate
additional keys to the user on Nautilus. Where in Pacific it will report
an error with UserAlreadyExists.
So to handle both scenarios, let's first get the user, and if the user
does not exist (NoSuchUser) we then create it.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-07-09 18:32:48 +02:00
Sébastien Han 1e45eaa436 ceph: always rehydrate the access and secret keys
Prior to that the access and secret keys were left empty if the user
already existed, which led to updating the secret with empty values when
the operator restarts.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-07-09 10:39:52 +02:00
Sébastien Han 319828a7c7 Merge pull request #8274 from cybozu-go/ceph-fix-pdb-of-rgw-pods
ceph: fix pdb of RGW instances
2021-07-08 15:50:29 +02:00