Commit Graph
2479 Commits
Author SHA1 Message Date
Travis Nielsen cdfe1982d1 ceph: consolidate the calls to set mon config
The mon config had two different implementations that have evolved
over the lifetime of the project. This is a simple refactor to remove
the SetConfig() option and stick with the MonStore as a single
implementation for updating the mon store.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-08-24 14:38:26 -06:00
Travis Nielsen 7af10af781 Merge pull request #8514 from thotz/obcupdateapi
ceph: add support for update() from lib-bucket-provisioner
2021-08-24 13:28:46 -06:00
Sébastien Han 656dd0f334 ceph: move the admission webhook to the operator
Our admission webhooks will now run as part of the Operator container
and not an additional deployment. This has the advantage of consuming
fewer resources in the cluster and not having to manage affinities and
tolerations. This only drawback is that the Secret containing the
certificates is not mounted anymore and the content needs to be written
inside the Operator. This is not practical since we also need to watch
for the Secret content to change. Meaning that the certificates have
been renewed and the webhook server needs to use them.
A new approach is on its way to hopefully simplify this last issue and
implement a watcher for the Secret.
In the meantime, users need to use the cert-manager or renew
certificates manually. Additionally, they must update the
ValidatingWebhookConfiguration object with the new CA bundle.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-08-24 19:07:04 +02:00
Travis Nielsen 9a96afab05 Merge pull request #8582 from Madhu-1/fix-csidriver-panic
ceph: fix panic when recreating the csidriver object
2021-08-24 09:05:31 -06:00
Sébastien Han 579fc27783 ceph: embed ceph-csi templates in rook binary
Thanks to Golang 1.16, we can now embed files in the Go binary. This
means we don't need to add the CSI templates files to the container
image. They are added in the Go binary at build time.

The existing location of the template must be in the package calling it.
So they moved to pkg/operator/ceph/csi/template. All the files have been
symlinked back to cluster/examples/kubernetes/ceph/csi/template.

Closes: https://github.com/rook/rook/issues/7609
Signed-off-by: Sébastien Han <seb@redhat.com>
2021-08-24 16:22:20 +02:00
Madhu Rajanna d246dde443 ceph: remove variable declaration
remove csiDriver and csiClient variables
creation and reuse them from the method
receivers.
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2021-08-24 19:43:18 +05:30
Madhu Rajanna e2dc418371 ceph: fix logging of csidriver
log the successful message about
starting CSIDriver after creating
the daemonset and deployment objects.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2021-08-24 19:41:04 +05:30
Madhu Rajanna d48f67a82c ceph: fix panic in reCreateCSIDriverInfo
Initialize the client and the csidriver object
before calling the reCreateCSIDriverInfo
function.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2021-08-24 12:15:48 +05:30
Satoru Takeuchi 6582bac8e7 Merge pull request #8441 from leseb/signal
ceph: signal signals handling with context
2021-08-24 14:01:29 +09:00
parth-gr 72e4bb8099 ceph: remove legacy PDBs methods
Removing the deleteLegacyPDBForOSD method
because we don't support legacyPDBs

Closes: https://github.com/rook/rook/issues/8360
Signed-off-by: parth-gr <paarora@redhat.com>
2021-08-20 21:24:52 +05:30
parth-gr 1601ba1c1c core: convert util.NewSet() to sets.NewString()
Converting util.NewSet() instance to use sets.NewString() instance

Closes: https://github.com/rook/rook/issues/8479
Signed-off-by: parth-gr <paarora@redhat.com>
2021-08-20 18:56:25 +05:30
Jiffin Tony Thottan f4bb47e440 ceph: add support for update() from lib-bucket-provisioner
Recently lib-bucket-provisioner add support for update() API.
Include that on the obc implementation since it can be used to
update quota for OBC.

Fixes: #7146

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2021-08-19 23:57:11 +05:30
Travis Nielsen 993b82674f Merge pull request #8520 from travisn/no-arbiter-failover
ceph: Refuse to failover the arbiter mon on stretch clusters
2021-08-11 07:16:25 -06:00
Travis Nielsen f9f322683a ceph: refuse to failover the arbiter mon on stretch clusters
Stretch clusters in Ceph do not yet support failing over the arbiter
mon, so we now disable the arbiter mon from failing over. Soon
Ceph will support the arbiter mon failover and we will reenable
this failover feature.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-08-10 16:26:47 -06:00
Denis Egorenko fb04908315 ceph: add ability to specify ca bundle for rgw
Specify ca Bundle for RGW spec and mount inside pods.

Related-Issue: https://github.com/rook/rook/issues/8490
Signed-off-by: Denis Egorenko <degorenko@mirantis.com>
2021-08-10 23:18:26 +04:00
Sébastien Han e4ac38e555 Merge pull request #8482 from leseb/restrict-manager-cache
ceph: move scheme initialization to the same place
2021-08-06 17:45:30 +02:00
Sébastien Han 2d55e69416 ceph: move scheme initialization to the same place
Let's initialize the schemes in a single place instead of doing it
when each controller initializes.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-08-06 11:33:10 +02:00
Sébastien Han 07d14a93a2 ceph: remove cli unused flags
I don't know why these flags are there but it's not like we run the
operator with them and with a different value.
So removing for clarity.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-08-06 11:05:20 +02:00
Travis Nielsen cc16b60f5f Merge pull request #8381 from subhamkrai/osd-placement-merge
ceph: add an option to enable/disable merge all placement
2021-08-04 07:23:33 -06:00
Sébastien Han 1ddf28144a Merge pull request #8459 from humblec/cephfs-fsgroup
ceph: set default FsGroupChangePolicy value to 'None'
2021-08-04 11:03:41 +02:00
subhamkrai 9838313398 ceph: add an option to enable/disable merge all placement
earlier, we had the issue for osd placement regarding
whether we should merge the placements or not.

Now, we have option `skipApplyAllPlacement` to
enable/disable osd placement. By default it is false
which means it will merge both placement.All() and
storageClassDeviceSets.Placement, when true
it will only apply storageClassDeviceSets.Placement.

Also, adding unit test.

Closes: https://github.com/rook/rook/issues/8135
Signed-off-by: subhamkrai <srai@redhat.com>
2021-08-03 19:47:40 +05:30
Sébastien Han 412b3eaf5e Merge pull request #8447 from leseb/fix-8438
ceph: ignore errors when mirroring is not enabled on the filesystem
2021-08-03 16:06:16 +02:00
Sébastien Han 9e63aed974 Merge pull request #8460 from leseb/add-fs-mirror-cleanup
ceph: add fs-mirror to cleanup list
2021-08-03 16:05:59 +02:00
Sébastien Han e1cd82beb3 ceph: add fs-mirror to cleanup list
Before running the cleanup job we now also wait for the fs-mirror pods
to be gone.
Also, small refactor to print nicely the list of remaining daemons.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-08-03 15:22:36 +02:00
Humble Chirammal 8034a4ef98 ceph: set default FsGroupChangePolicy value to 'None'
The `None` value Indicates that volumes will be mounted
with no modifications, as the CSI volume driver does not
support these operations. While volumes are provisioned
by the CephFS CSI driver the global permissions are set
on the volume and we dont expect the Fsgroup policy or
check from CO side  to play a role here.

Ref #ceph/ceph-csi/../internal/cephfs/nodeserver.go#L190

```
!csicommon.MountOptionContains(fuseMountOptions, readOnly) {
		// #nosec - allow anyone to write inside the stagingtarget path
		err = os.Chmod(stagingTargetPath, 0o777)
```

The current default value ie `ReadWriteOnceWithFSType` cause
volumes to be examined to determine if volume ownership and permissions
should be modified to match the pod's security policy. Changes could occur
if the fsType is defined and the persistent volume's accessModes contains
ReadWriteOnce.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2021-08-03 16:54:10 +05:30
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