Commit Graph
3904 Commits
Author SHA1 Message Date
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
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
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
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 4d0856c297 Merge pull request #5762 from thotz/cleanupobjectcephusers
ceph: check for ceph object user cleanup
2020-07-10 14:56:57 +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 b7b46b15e1 Merge pull request #5605 from subhamkrai/remove-drivers
ceph: remove csi drivers when disable
2020-07-07 11:16:07 -06:00
Travis Nielsen 8f9df75f7b ceph: capture logging from the osd daemon
The OSD daemon has been missing critical flags for logging to stderr
where k8s can capture the logs. Without the --log-to-stderr=true,
all the OSD logging was essentially lost until now.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-07-06 14:38:37 -06:00
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
subhamkrai 7f9f1690d2 ceph: remove csi drivers when disable
remove csi drivers and delete k8s
services that drivers create,when
the default setting of drivers changed
to false.

Signed-off-by: subhamkrai <subhamkumarrai03@gmail.com>
2020-07-06 13:33:52 +05:30
Ahmad Nurus S 441e5edc33 nfs: add controller unit-test
Signed-off-by: Ahmad Nurus S <prksu.sh@gmail.com>
2020-07-03 14:34:55 +07:00
Ahmad Nurus S 90da5ec7b9 nfs: add validation admission webhook using controller-runtime
Signed-off-by: Ahmad Nurus S <prksu.sh@gmail.com>
2020-07-03 14:33:36 +07:00
Ahmad Nurus S f7f8270f58 nfs: rewrite nfs operator controller to use controller-runtime
Signed-off-by: Ahmad Nurus S <prksu.sh@gmail.com>
2020-07-03 14:33:25 +07: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
Madhu Rajanna 3f46b437c6 ceph: remove CSI_ENABLE_SNAPSHOTTER from CSI config
removed CSI_ENABLE_SNAPSHOTTER from the configuration
to enable or disable csi-snapshotter as snapshot
is moved to beta and enabled by default in kubernetes
1.17+

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-07-01 07:20:04 +05:30
Madhu Rajanna 54f396ca0e ceph: add check for snapshotter deployment
as we need kubernetes v1.17+ for snapshotter
to work,Added code changes to disable snapshotter
sidecar deployment by default if the kubernetes version
is less than v1.17+

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-07-01 07:20:04 +05:30