Commit Graph
228 Commits
Author SHA1 Message Date
Sébastien Han bcd76bf46d ceph: run obc requests with debug
Use debug log to all the s3 calls so it's either to debug. Also, it's
not so verbose.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-08-26 15:27:49 +02:00
Jiffin Tony Thottan 7413485b8a ceph: use proper log functions in object package
There is incorrect usage of log functions in the object directory, changing those instances

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-08-21 12:39:53 +05:30
Travis Nielsen cb3db54187 Merge pull request #6072 from alimaredia/object-multisite-testing
ceph: object realm controller unit tests
2020-08-18 14:58:38 -06:00
Ali Maredia 5b339cf791 ceph: object realm controller unit tests
Add unit tests for the ceph object realm
controller.

Signed-off-by: Ali Maredia <amaredia@redhat.com>
2020-08-18 15:15:14 -04:00
subhamkrai e21854145a ceph: disable object store port when secureport specified
currently, the object store schema requires the
port to be non-zero. This does not allow http
access to the object store to be disabled.
so setting the port minimum to 0 to from 1 in the cr.

Signed-off-by: subhamkrai <subhamkumarrai03@gmail.com>
2020-08-12 21:57:01 +05:30
Madhu Rajanna 99cd310cd2 ceph: add check for nil object status
in couple of unit testing the tests are
panicing with nil pointer exception,This
commit adds a check for status pointer before
operating on it.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-08-06 12:19:49 +05:30
Sébastien Han 7d7523a8a2 ceph: fix unit test mock
Mock the user creation otherwise the health check fails and panics.

Closes: https://github.com/rook/rook/issues/5976
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-08-05 16:09:24 +02:00
Travis Nielsen 06c21954e1 ceph: labels are immutable for match selectors
The labels cannot be updated on a deployment match selector.
In v1.4 a new label was added for ceph_daemon_type that is intended
to be on the pod labels, but cannot be applied to the match selectors.
Therefore, we suppress any new labels that are added to the daemons.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-08-04 16:47:00 -06:00
Jiffin Tony Thottan ec5f13318c ceph: enable/disable dashboard for rgw
Provide permission for dashboard to collect the object store metrics.

Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
2020-08-03 10:26:54 +05:30
Jiffin Tony Thottan 73b8a598d2 ceph: add support to create system user for createuser api
Currently this is no way to create user with system permission in objectstore.
Add support for the same

Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
2020-08-03 10:24:42 +05:30
Jiffin Tony Thottan ab607075da ceph: handles an user creation error if the store is missing
Currently if object store is missing user creation fails without throwing
any error. Here the access and secret key values will be checked post the
creation command

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-08-03 10:24:34 +05:30
Blaine Gardner cb6881e401 Merge pull request #5909 from SUSE/ceph-add-daemon-type-label
ceph: add ceph_daemon_type label to Ceph daemon pods
2020-07-31 09:40:48 -06:00
Jiffin Tony Thottan 091679cbeb ceph: use deleteOBCResourceLogError instead of deleteOBCResource
Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-07-31 15:41:35 +05:30
Jiffin Tony Thottan 59f1e8364e ceph: fix up deleteOBCResourceLogError
Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-07-31 15:41:31 +05:30
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
Blaine Gardner dcf8ae2526 ceph: rename pod labels function for more clarity
Rename PodLabels function to CephDaemonAppLabels for more clarity about
what the function's purpose is.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2020-07-30 11:16:30 -06:00
subhamkrai 0279025e9e ceph: handling all the gosec errors
a few of the gosec errors were left. so
this commit will resolve all the errors.

Signed-off-by: subhamkrai <subhamkumarrai03@gmail.com>
2020-07-30 08:19:55 +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
Jiffin Tony Thottan 96a53389b1 ceph: adding new quota apis
Adding new apis such as EnableUserQuota() for enabling quota,
SetQuotaUserObjectMax() and SetQuotaUserMaxSize() for setting user specific quotas
for objects and size respectively. Please note the size is quota is determined in GBs.

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-07-28 12:00:04 +05:30
Jiffin Tony Thottan 5a6cafcdfc ceph: add missing explaination for apis in user.go
Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-07-28 11:59:57 +05:30
Jiffin Tony Thottan cf61966205 ceph: remove rgwerrno from setuserquota
Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-07-28 11:59:51 +05:30
subhamkrai acc4ed5df9 ceph: handling gosec errors that are not checked
this commit handles all the gosec g104
i.e audit errors not checked inside pkg.

Signed-off-by: subhamkrai <subhamkumarrai03@gmail.com>
2020-07-24 20:02:06 +05:30
Sébastien Han dcadf10f0c Merge pull request #5837 from leseb/external-connection
ceph: let the healthcheck set the status phase
2020-07-23 09:24:58 +02:00
Sébastien Han cf28b16b68 Merge pull request #5836 from subhamkrai/objectstore-liveness
ceph: ability to configure livenessprobe for cephobjectstore crd
2020-07-23 09:14:34 +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 89f815bf9b ceph: start rgw healthcheck immediately
When we run the goroutine, we should run start it immediately instead of
waiting for the configured interval to start. With that we can get the
Status Phase reported much faster in the CRD.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-07-22 17:10:17 +02:00
Sébastien Han 8f4e37b80a Merge pull request #5452 from leseb/osd-wipe
ceph: enhancement disk sanitize options
2020-07-22 16:11:35 +02:00
Ali Maredia e6ed4ff8ea ceph: minor fixes + add realm/zg/zone to object context
- Add realm/zone group/zone to Object Context,
so that any call to runAdminCommand has the
same realm, zone group, and zone as the object
store that the call is going to.

- Also modify the delete code for the object-store
using multisite to remove the endpoints of an
object store from a zone instead of the normal
clean-up

- Added more debug logging all around the object-store
code related to multisite

- files generated by rerun of `make codegen`

- change back the edit on the Copyright in object.go

Signed-off-by: Ali Maredia <amaredia@redhat.com>
2020-07-21 16:47:59 -04:00
Ali Maredia 0f7e55780c ceph: add pool creation for ceph-object-zone
When zones are created the ceph RGWs inside the
those zones should be using pools with the zones
name not the object-store's name

Signed-off-by: Ali Maredia <amaredia@redhat.com>
2020-07-21 13:30:41 -04:00
Ali Maredia 5d9c2f09a9 ceph: enable the realm pull on ceph-object-realm
This commit:
- adds the pull section on the CephObjectRealm spec
to enables realms to be pulled instead of created.

- creates the system user and generates the access
key and secret key for the user and zones in a realm.

- adds "omitempty" to fields in multisite CRs that
are not required

Signed-off-by: Ali Maredia <amaredia@redhat.com>
2020-07-21 13:30:19 -04:00
Sébastien Han 0a6cce43fb ceph: add clusterResourceDeleted flag
During the deletion sequence of the CR, we now set a success flag at the
end, right before removing the finalizer.
This avoids the case where we fail to remove the finalizer.

2020-07-21 13:29:46.334816 E | ceph-object-controller: failed to reconcile failed to remove finalizer: failed to remove finalizer "cephobjectstore.ceph.rook.io" on "teststore": Operation cannot be fulfilled on cephobjectstores.ceph.rook.io "teststore": the object has been modified; please apply your changes to the latest version and try again

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-07-21 17:11:29 +02:00
subhamkrai 23f0ac7f9c ceph: ability to configure livenessprobe for cephobjectstore crd
this commit allows us to disable livenessprobe for
cephobjectstore crd.

Signed-off-by: subhamkrai <subhamkumarrai03@gmail.com>
2020-07-20 22:53:32 +05:30
Ali Maredia 48ef107271 ceph: fix names of variables for requeue times
Name for requeue time variables were the same for
the object-zone and the object-zonegroup.

This commit makes them more descriptive and
accurate

Signed-off-by: Ali Maredia <amaredia@redhat.com>
2020-07-17 11:32:31 -06:00
Ali Maredia f29c650ce1 ceph: allow creation for non-master zonegroups/zones
The masterArg flag cannot be "" so a different
command without masterArg must be run for zone
and zone group creation

Signed-off-by: Ali Maredia <amaredia@redhat.com>
2020-07-17 11:32:31 -06:00
Ali Maredia 49e6796b90 ceph: allow multiple object-stores in a zone
Make it so that zones & zone groups can be
modified with more than one endpoint so that
more than one object store can be in a zone

Signed-off-by: Ali Maredia <amaredia@redhat.com>
2020-07-17 11:32:31 -06:00
Ali Maredia 1efb3d4bd1 ceph: check for adding endpoints into zone group
Endpoints can only be added to a zone group if the
zone the endpoint is part of is master.

Signed-off-by: Ali Maredia <amaredia@redhat.com>
2020-07-17 11:32:28 -06:00
Sébastien Han 34ccb84aa3 ceph: add external prometheus endpoint
We can now connect an external prometheus exporter to Rook to collect
metrics and generate alerts from Prometheus.
Just enable this in the CephCluster CR:

```
spec:
  external:
    enable: true
   monitoring:
    enabled: true
    rulesNamespace: rook-ceph
    externalMgrEndpoints:
    - ip: 192.168.39.182
```

Closes: https://github.com/rook/rook/issues/5516
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-07-17 11:29:48 +02:00
Travis Nielsen 30e0cb53d2 ceph: debug logging for the rgw health check
Health checks should log to debug rather than info
or else the operator log fills with messages as the health
checks trigger periodically.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-07-16 15:54:54 -06: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 4681f9e73d ceph: consolidate ceph config and client packages
The ceph config and client packages are conceptually the same.
To avoid circular dependencies in some cases, we simplify by combining
the packages into the client package.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-07-16 15:54:43 -06:00
Travis Nielsen 631b13b906 ceph: refactor creds used by operator
The operator should only connect to ceph with a single set of creds.
In a converged cluster this will be the admin creds and in an external
cluster it will be lower-privileged creds. Independent clusters were
implemented with a separate set of creds. To simplify the code these
are now merged to a single set.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-07-16 15:54:42 -06:00
Jiffin Tony Thottan e37a6ee122 ceph: display name updation for existing ceph object stores users
Closes: #5713
Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-07-16 16:14:34 +05:30
subhamkrai 3e33fc55a3 ceph: report secret in cephobjectstoreuser status field
adding method to generate secret name in
cephobjectstoreuser status field in order
to programmatically retrieve the secret name
generated by the cephobjectstoreuser crd.
Also added unit test for the method.

Signed-off-by: subhamkrai <subhamkumarrai03@gmail.com>
2020-07-15 14:27:23 +05:30
Travis Nielsen 4b45048557 ceph: skip logging output of bucket policy change
The output of the bucket policy change should not be logged in case
there is sensitive information in the output.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-07-14 11:50:16 -06:00
Sébastien Han ccb52b84e6 ceph: configurable status checks and livenessprobe
This commit allows us to configure status check for each daemon:

* "mon": health check on the ceph monitors (quorum)
* "osd": health check on the ceph osds
* "status": ceph health status check

Each check is controlled by the following settings:

* disabled: whether to disable the check (default: false)
* internal: interval to run the check
* timeout: only valid for mons, is the timeout for unresponsive mon
before failling over.

Example to disable the status health check:

```yaml
healthCheck:
  daemonHealth:
    status:
      disabled: true
```

As part of that, pod's livenessprobe can now be configured via the
following settings:

* disabled: whether to enable or not
* probe: override the current probe in place by a new one

```yaml
healthCheck:
  livenessProbe:
    mon:
      disabled: true
```

Closes: https://github.com/rook/rook/issues/5772
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-07-10 19:21:59 +02:00
Sébastien Han d097343001 Merge pull request #5774 from leseb/object-user-endpoint
ceph: add s3 endpoint to the rgw user cr
2020-07-10 17:22:22 +02: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
Sébastien Han 5c5008e27c ceph: add s3 endpoint to CephObjectStore CRD
For the CephObjectStore, the Status field of the CR has a new property
called "info", which contains a couple of information about the CR.
The first new addition is the endpoint of the object store.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-07-10 12:06:25 +02:00
Jiffin Tony Thottan 2308ad311e ceph: check for ceph object user cleanup
Do not delete ceph object store until ceph object users are cleaned up

Closes: #5712
Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-07-08 23:46:30 +05:30
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