Commit Graph
179 Commits
Author SHA1 Message Date
Travis Nielsen dbae36b2bb ceph: update to the latest octopus release
Update the base operator image and cluster examples to use the latest
octopus release v15.2.4. Also cleanup some old examples and unit tests
that were still based on mimic.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-07-06 12:11:47 -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
Sébastien Han 1efd490900 ceph: fix GetUser
Stop check for the output, but read it instead.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-06-29 16:08:35 +02:00
Sébastien Han aca541803b Merge pull request #5664 from leseb/ceph-object-user-external
ceph: add external support for object store user
2020-06-18 20:10:05 +02:00
Sébastien Han 5f74e493ef ceph: small user delete refactor
Do not return error code, interpret it directly, put the error as part
of the output on failures.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-06-18 18:49:03 +02:00
Sébastien Han 84d1e28c99 ceph: add external support for objectstoreuser
Now, the object store user is capable of creating s3 users on an
external Ceph cluster.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-06-18 16:34:01 +02:00
Sébastien Han 1e4a4b477a Merge pull request #5111 from leseb/lang-neutral-ceph
ceph: use octopus base image
2020-06-18 10:46:54 +02:00
Sébastien Han 68e62836c5 ceph: use newer octopus time format
radosgw-admin as of Octopus uses a different time format, it uses
"2006-01-02T15:04:05.999999999Z". It's close from RFC3339 but not quite
the same. This change is needed in order for the operator image (with a
Ceph Octopus based image) to perform radosgw-admin call correctly.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-06-17 23:00:17 +02:00
Sébastien Han c7f255a0e8 ceph: add the ability to set any pool property
We can now explicitly set any property on a given pool by using the new
Property field in the CephBlockPool Spec.

Also, this fixes the case where both `CephBlockPool` and `CephCluster`
are created at the same time. When Rook creates the pool, the cluster is
still being bootstrapped and the global option
`osd_pool_default_pg_autoscale_mode` has not bee set yet. So the pool
gets created but its `pg_autoscale_mode` property is set to `warn`
instead of `on`.

Closes: https://github.com/rook/rook/issues/5608V
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-06-17 10:08:00 +02:00
Sébastien Han 70cd4e0e4d Merge pull request #5509 from thotz/deleteuserorbucket
ceph: obc clean up resources incase of failure
2020-06-11 11:52:10 +02:00
Jiffin Tony Thottan 96e3d1529e ceph: remove unlinking user in revoke api for obc
UnlinkUser works if bucket owner is obc user, otherwise it result in mismatch.

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-06-10 18:30:21 +05:30
Jiffin Tony Thottan c0e23e0e16 ceph: clean up resources incase of failure
When obc creation fails in Grant() or Provision() the resources such as rgw user or bucket
created while provisioning need to remove.

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-06-10 18:30:16 +05:30
Jiffin Tony Thottan 07f5aa7a19 ceph: remove deleteCephUser() and deleteBucket()
Replacing deleteCephUser() and deleteBucket() with deleteOBCResource()
Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-06-10 18:30:12 +05:30
Jiffin Tony Thottan 9fccfb0e6f ceph: introduce new function for cleaning resources
Combining DeleteUser() and DeleteBucket() into single function
Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-06-10 18:30:06 +05:30
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
Travis Nielsen 872e6ff44a Merge pull request #5585 from ashangit/podAntiAffinity_rgw
ceph: fallback podAntiAffinity to preferredDuringSchedulingIgnoredDuringExecution on rgw
2020-06-04 13:28:14 -06:00
n.fraison c8df6c0faf ceph: add preferred pod anti-affinity on rgw if not host network
If host networking is not enabled add preferred pod anti-affinity on rgw pods to
improve spread of them

Signed-off-by: n.fraison <n.fraison@criteo.com>
2020-06-04 13:34:30 +02:00
Sébastien Han fc648970c4 Merge pull request #5511 from thotz/existingbucketsuserpolicy
obc: Do not delete user for retain policy if it is owner
2020-06-03 14:11:57 +02:00
Sébastien Han a90c18e0cb ceph: fix obc additionalConfig field
Some external consumers of Rook-Ceph are using the
lib-bucket-provisioner operator which creates different CRDs for both
objectbuckets.objectbucket.io and objectbucketclaims.objectbucket.io.
They have the `additionalConfig` declared in their spec. Rook-Ceph does
not and thus ignores it.
For the OB creation to work, the `additionalConfig` must be acknowledged
by the operator and populate or initialize it if empty.

This is preventing the following error:

controller.go:190] error syncing 'default/ceph-retain-bucket-converged': error creating OB "": ObjectBucket.objectbucket.io "obc-default-ceph-retain-bucket-converged" is invalid: spec.endpoint.additionalConfig: Invalid value: "null": spec.endpoint.additionalConfig in body must be of type object: "null", requeuing

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-06-02 16:04:20 +02:00
Jiffin Tony Thottan 9a3ffbaab2 obc: Do not delete user for retain policy if it is owner
When obc is deleted, the attached ceph user will be also removed
This will cause obc creation failure for the same bucket since user
was missing. With this patch the user will be retained revoking his permissions

Also removed 'GetBucketPolicy' permission from Allowed action. The same set of
permission is used for denying the owner/old user of OBC. So that in the next
obc request for the bucket, owner can set polciy for the new user

Closes: https://github.com/rook/rook/issues/5510
Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-05-27 22:58:08 +05:30
Santosh PillaiandElise Gafford 5ef88f8f09 ceph: finalizer for OBC cleanup
This PR is for rebasing #4683 with master. With new controller runtime changes most the changes with #4683 got redundant.
Only valid change is waiting for all the object buckets to be cleaned up before removing the finalizer.

Co-authored-by: Elise Gafford <egafford@redhat.com>
Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2020-05-18 23:54:59 +05:30
Travis Nielsen 6d130864f3 ceph: set pg_num_min on new rgw metadata pools
pg_num_min needs to be set on all new and existing rgw
metadata pools so the autoscaler won't immediately
increase the pg count. The pg_num_min was only being set
on existing pools and not on new pools.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-05-15 16:22:38 -06:00
Travis Nielsen f47bb945c2 ceph: remove duplicate controller wait setting
The controller setting for requeuing an event moved to the
opcontroller package and was no longer needed in the main
controller package.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-05-14 16:52:24 -06:00
Sébastien Han bc581da75e ceph: change rgw certificate mode
Because the secret is mounted and owned by root and the rgw is running
under the 'ceph' user then it cannot access it. So moving from 0400 to
0444 fixes the issue.

Closes: https://github.com/rook/rook/issues/5265
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-05-13 18:07:53 +02:00
Sébastien Han 812f1bd4bb ceph: revert "objectstore: Add ceph group as FsGroup"
This reverts commit 68fc50686a since it
now conflict with OCP environments with the other scc in place.

Closes: https://github.com/rook/rook/issues/5468
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-05-13 15:58:10 +02:00
Sébastien Han ec388ed3aa Merge pull request #5465 from leseb/obc-deletion-fixes
ceph: obc relax error handling and user deletion
2020-05-12 17:40:16 +02:00
Sébastien Han 58577a3537 ceph: obc relax error handling and user deletion
When a user or a bucket does not exist anymore, let's stop the reconcile
loop instead of waiting forever.
Also, unlink the user before deleting it otherwise the deletion fails.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-05-12 16:28:47 +02:00
Sébastien Han 2e5d6c749e Merge pull request #5362 from thotz/ssl_regression_rgw
objectstore: Add ceph group to FsGroup
2020-05-07 17:18:49 +02:00
Jiffin Tony Thottan 68fc50686a objectstore: Add ceph group as FsGroup
ceph gid (167) provided as supplymentary group, so that all the mounts can
be accessed by the same. This is required for ssl certificate consumed by
the rgw server from ceph octopus onwards.

Closes: https://github.com/rook/rook/issues/5265
Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-05-07 18:37:36 +05:30
Sébastien Han b86bb9c528 ceph: add support for OBC on external cluster
We can now consume an external s3 endpoint which is not managed by Rook.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-05-04 18:14:26 +02:00
Madhu Rajanna 81688398f2 cleanup: use err.Wrap when the formatting is not required
Replaced err.Wrapf with err.Wrap when the formatting
is not required.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-04-29 17:42:59 +05:30
Sébastien Han f27fd207ce ceph: convert the CephCluster controller to the controller-runtime
This is the final conversion to controller-runtime conversion. This time the
CephCluster CRD has been converted to use the controller-runtime
library.
The controller incorporates all the previous watchers too, so the Node
and hot-plug configmap are been watched too.
Only the operator setting configmap is not being watcher since it's not
related to the CephCluster CRD.
Not only the patch converts to controller-runtime but also tries to
re-organize the tree of the repo to actually make the code more
readable and have better functions/methods/tests separations.

Closes: https://github.com/rook/rook/issues/4939
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-04-28 09:40:35 +02:00
Travis Nielsen 10d5631fee Merge pull request #5246 from ashangit/rm_rgw_on_mon_config_db
ceph: remove specific rgw configuration on mon configuration database
2020-04-27 08:20:54 -06:00
Satoru Takeuchi f78efc50aa cleanup: use the constants of environment variables properly
There are some code where constants of environment variables
are defined but not used properly. Let's avoid to use string
literals as possible.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2020-04-24 17:31:00 +00: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
n.fraison 848d99265b ceph: factorize deletion of rgw CephX key and configuration in centralized mon database
Use same method for the deletion of rgw CephX key and configuration in centralized mon database
when removing a CephObjectStore or scaling down number of rgw

Signed-off-by: n.fraison <n.fraison@criteo.com>
2020-04-21 22:36:29 +02:00
n.fraison 6b9a70cb9a ceph: remove specific rgw configuration on mon configuration database
Remove specific rgw config added to the mon configuration database when deleting a CephObjectstore
or when scaling down number of rgw

Signed-off-by: n.fraison <n.fraison@criteo.com>
2020-04-21 22:36:11 +02: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
Travis Nielsen 66f310c73b Merge pull request #5219 from travisn/status-reconcile-loop
Skip reconcile events where the spec is not updated
2020-04-09 16:53:40 -06:00
Travis Nielsen 24789f4c6a ceph: update the object store service port during upgrade
In the v1.3 release the target port for the rgw daemons changed to 8080.
The upgrade was skipping the service update anytime the service already existed.
Now the service will be updated with every reconcile to ensure the target port
is correct.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-04-09 12:42:20 -06:00
Travis Nielsen 269cfe1199 ceph: update status on current version of resources
When updating the status on resources sometimes the update fails due to
the resource being an outdated version. This frequently occurs when
the same reconcile loop updates the status multiple times, or the finalizer
is added, or some other update to the resource. Upon the next reconcile
the error would generally go away since the status or finalizer didn't
need to be updated multiple times. But now the error is not expected
since the controller will retrieve the latest version of the resource
immediately before attempting to update it.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-04-09 11:20:45 -06:00
n.fraison 27579733b8 ceph: set pg_num_min for rgw metadata pools
Since e396379 rook create rgw metadata pools with 8 PGs instead of
32. But the pg_autoscaler increase it back to 32 as the pg_num_min parameter
is not set on those pools.

Signed-off-by: n.fraison <n.fraison@criteo.com>
2020-04-06 18:14:56 +02:00
n.fraison 2cb04ea271 ceph: remove appropriate rgw ceph user when CephObjectStore is deleted
Signed-off-by: n.fraison <n.fraison@criteo.com>
2020-04-06 07:23:55 +02:00
Sébastien Han 20d1543507 ceph: add multus support
You can now use Rook along with Multus. Multus must be up and running
and the right ressources must exist such as NetworkAttachmentDefinition
CR.
The Cluster CR spec has new fields to work with multus:

network:
  provider: multus (or 'host' for hostNetworking)
  selectors:
    public: NetworkAttachmentDefinition name
    cluster: NetworkAttachmentDefinition name

If only a single NetworkAttachmentDefinition is provided Rook will use
both anyway for the Ceph traffic.

Please refer to the doc to learn more.

Closes: https://github.com/rook/rook/issues/4716
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-04-03 18:00:15 +02:00
Sébastien Han ed37a6a699 Merge pull request #5128 from leseb/liveness-other-daemons
ceph: add liveness probe to mon, mds and osd daemons
2020-04-01 10:53:12 +02:00
Sébastien Han 040193bb5a ceph: remove DaemonType type
This type was a string already and was just making us doing string()
calls all the time to it's not worth it.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-04-01 09:08:18 +02:00
Travis Nielsen 0e55aa348b tests: reduce unhelpful debug logging
Removed some extremely verbose debug logging that makes
the logs difficult to read when debug is enabled.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-30 13:32:47 -06:00
Sébastien Han f136105951 ceph: use a different port for rgw on sdn
When running on SDN, the container is not privileged and the network
stack is not exposed so running the gw on port 80 will not work (not
enough privileged).

Closes: https://github.com/rook/rook/issues/5106
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-03-30 19:37:11 +02:00
Travis Nielsen e39637930d ceph: set pg_num for rgw metadata pools to lower default
The PG count on metadata pools should default to rgw_rados_pool_pg_num_min
instead of the more general default pg count. This means rgw pools
will default to 8 PGs instead of 32 PGs, which means a lot more pools
can be created before hitting the default PG limit.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-27 09:06:59 -06:00
Sébastien Han 55aee177f3 ceph: don't hardcode ContinueUpgradeAfterChecksEvenIfNotHealthy
Let's just read the given value from the spec.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-03-26 14:07:46 +01:00