Commit Graph
1570 Commits
Author SHA1 Message Date
Rohan Joseph 82b062f91d core: add comment warning to keep k8sutil hashing consistent
The name generation utils need to provide consistent outputs across
versions so that names generated based on values are consistent and
older generated keys are not lost.

Signed-off-by: Rohan CJ <rohantmp@gmail.com>
2020-07-28 12:51:54 +05:30
Travis Nielsen 3e30b6fbdf Merge pull request #5869 from travisn/init-mon-spec
ceph: Require the cluster spec for initialization of the mons to avoid removing a healthy mon
2020-07-22 10:46:42 -06:00
Travis Nielsen 234877e7c0 ceph: skip first mon health check at startup
At startup there is a race condition between the goroutine checking
for mon health and the first reconcile of the mons. There is a lock
that ensures only one of them will check the mon health at a time.
The issue is that if the wrong one gets there first, it will not
have the desired mon count initialized from the cluster CR as expected
and the healther checker will use a desired mon count of 0.
The desired count of 0 leads the health checker to remove
a mon since there are extra mons. Only one mon is allowed
to be removed at a time, and adjusting to fewer than two mons is
disallowed once there are at least two mons.

After the health checker is completed, the main reconcile of the mons
will proceed with the correct desired mon count of 3 and attempt
to restore to the real desired quorum size.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-07-22 08:23:09 -06:00
Travis Nielsen c1736844c9 ceph: require the mon spec for initialization
The mon was starting with a partial spec. There was a race condition
that was causing incorrect initialization in the health check goroutine
that could remove a mon upon operator restart. Now the mon will be
properly initialized with the full spec.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-07-22 08:23:09 -06: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
Sébastien Han 907c8bf85f Merge pull request #5719 from alimaredia/wip-object-store-multisite-enhancements
ceph: check for adding endpoints into zone group
2020-07-22 11:19:15 +02:00
Travis Nielsen e4026560c5 Merge pull request #5860 from travisn/edgefs-security-review
Error checking for EdgeFS related to the security review
2020-07-21 20:54:57 -06: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
Sébastien Han 10ed662bdb ceph: enhancement disk sanitize options
Now, we can not only cleanup monitor data, logs and crashes but the
disks too. As part of the cleanupPolicy CR spec, we have a new setting
called sanitizeDisk which holds more details:

* method: indicates if the entire disk should be sanitized or simply ceph's metadata.
Possible choices are 'complete' or 'quick' (default)
* dataSource: indicate where to get random bytes from to write on the disk.
Possible choices are 'zero' (default) or 'random'
Using random sources will consume entropy from the system and will take much more time then the zero source
* iteration: overwrite N times instead of the default (1). Takes an integer value

See the documentation for more details.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-07-21 14:07:11 +02:00
Sébastien Han a343c597f6 Merge pull request #5857 from travisn/more-clusterinfo
ceph: Additional clusterInfo cleanup for user creds
2020-07-21 12:16:44 +02:00
Sébastien Han 6e99c0933f Merge pull request #5796 from rajatsingh25aug/finalizer-deletion
Ceph: Delete Filesystem only when it exists
2020-07-21 12:13:41 +02:00
Sébastien Han c9657e69e7 Merge pull request #5856 from leseb/report-error
ceph: report error on timeout
2020-07-21 09:14:45 +02:00
Travis Nielsen d06b18067b edgefs: simplify string formatting for labels
The label generated to apply to a node are simplified with the
backtick string delimeter to avoid the escaping of quotes.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-07-20 17:11:38 -06:00
Travis Nielsen 7bef54c089 edgefs: error checking for ineffectual assignments
All assignments made to errors or other variables should be
used instead of ignored. This checks for errors in a couple
places that were previously ignored, and also initializes
a variable such that it won't be always overwritten by the
various if else statements.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-07-20 17:11:37 -06:00
Travis Nielsen e7998b3c00 ceph: additional clusterInfo cleanup for user creds
The user creds should not be passed to the ceph helper methods
since the clusterInfo already has the needed context. Removing
a final reference that was missed in the refactor.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-07-20 16:26:20 -06:00
RAJAT SINGH e3c0d2530d ceph: delete filesystem only when it exists
ceph-file-controller gets stuck in loops, this happens when it tires to delete the filesystem which doesn't exist.Filesystem should only be deleted when it exist.

Signed-off-by: RAJAT SINGH <rajasing@redhat.com>
2020-07-21 01:58:11 +05:30
Sébastien Han d98e49f5b3 ceph: re-hydrate clusterInfo for external mode
Whether we run an external cluster or not we need to load the
appropriate clusterInfo.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-07-20 19:24:54 +02:00
Sébastien Han 954074b707 ceph: report error on timeout
If the healthcheck goroutine cannot check for the ceph status/times out
(if the mons are not in quorum) this should still be reflected in the
CRD status field.

Example:

```
status:
  ceph:
    details:
      error:
        message: 'failed to get status. . timed out: exit status 1'
        severity: Urgent
    health: HEALTH_ERR
    lastChanged: "2020-07-20T14:11:05Z"
    lastChecked: "2020-07-20T14:11:05Z"
    previousHealth: HEALTH_WARN
```

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-07-20 16:15:08 +02:00
Sébastien Han f3c4975e35 ceph: fail prepare pod if lvm2 pkg is missing
A long-standing issue that was only solved via a documentation note. Now,
during the prepare pod instantiation, we check for the presence of the
lvm binary on the host. Success will indicate that we can bootstrap
OSDs where failure will refuse to prepare the OSD.

Closes: https://github.com/rook/rook/issues/5627
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-07-20 10:05:05 +02:00
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
Blaine Gardner 825f1e3eb2 ceph: support device names with special chars
Pass desired devices to the OSD provisioning container by
JSON-marshalling/-unmarshalling a disk ID with StorageConfig settings.
This will allow disks to be specified that contain special characters.
Notably, this will support /dev/disk/by-path/pci-HHHH:HH:HH.H devices
that were unsupported previously due to the format which separated
devices from params with colons (:).

Fixes #5056
Fixes #5535

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2020-07-17 09:44:26 -06:00
Sébastien Han 0e684460bd Merge pull request #5642 from leseb/monitoring-endpoint
ceph: add external prometheus endpoint
2020-07-17 16:20:51 +02: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
Sébastien Han 90787daef7 ceph: do not enable the 'rook' module by default
We currently don't use the module, so let's speed up the bootstrap
progress as well as the reconcile by not always enabling it.
It can always be enabled via the spec mgr section.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-07-17 10:37:28 +02:00
Sébastien Han 1bdb369cb4 ceph: do not enable orchestrator_cli
orchestrator_cli is always-on so we don't need to do anything.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-07-17 10:36:59 +02:00
Travis Nielsen 76028f66ab ceph: load external creds from deprecated secret
The external creds have been loaded from their own key. For
backward compatibility we need to check that key if the
new key is not found.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-07-16 15:54:54 -06: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
Sébastien Han c4f89361ee Merge pull request #5813 from thotz/updatingdispnamecepbobjectuser
ceph: display name updation for existing ceph object store users
2020-07-16 17:49:11 +02: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
Hiroshi Muraoka e2b1a2230d ceph: ignore PodAntiAffinity for detect-version placement
When a PodAntiAffinity is set to mon, detect-version may not be scheduled because detect-version has the same PodAntiAffinity with mon.
This commit fixes this issue.

Closes #5810

Signed-off-by: Hiroshi Muraoka <h.muraoka714@gmail.com>
2020-07-16 04:27:06 +00:00
Sébastien Han e669e903b3 Merge pull request #5828 from leseb/fix-reconcile
ceph: fix CRs not reconciling on updates
2020-07-15 23:08:10 +02:00
Sébastien Han 56954d5cc8 ceph: fix CRs not reconciling on updates
Most of the CRs expect CephCluster and CephBlockPool were not
reconciling on updates. The predicate must return true on CR diff.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-07-15 11:15:33 +02:00
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 4a72875089 Merge pull request #5824 from travisn/no-log-bucket-policy-output
ceph: Skip logging output of bucket policy change
2020-07-14 21:41:05 -06:00
Blaine Gardner f2bc23c33e Merge pull request #4916 from SUSE/drive-groups
Ceph: provision OSDs using Drive Groups
2020-07-14 18:08:45 -06:00
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
Travis Nielsen 3d3986ee02 Merge pull request #5785 from prksu/fix-nfs-on-openshift
nfs: fix nfs issue on openshift
2020-07-14 11:06:47 -06:00
Blaine Gardner 7117fc12b7 ceph: osd: add drive groups spec to cluster CR
Add the ability to provision Ceph OSDs with Drive Groups.
This adds Drive Groups to the CephCluster CRD, and it sets code
in place for propagating this config to the OSD provisioning pod.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2020-07-14 09:43:03 -06:00
Ahmad Nurus S 1659687d37 nfs: fix nfs issue on openshift
Signed-off-by: Ahmad Nurus S <prksu.sh@gmail.com>
2020-07-14 18:11:39 +07:00
Travis Nielsen 7dcd64f1a2 Merge pull request #5761 from vbnrh/rook-ac-controller-runtime
ceph: implement controller-runtime for admission controllers
2020-07-13 16:31:23 -06:00
Vineet Badrinath 98874ccf4d ceph: implement controller-runtime for admission controllers
moves the admission-controller server to use controller-runtime library for better support, maintainibility of code.

Signed-off-by: Vineet Badrinath <vbadrina@redhat.com>
2020-07-14 01:10:03 +05:30