Commit Graph
1771 Commits
Author SHA1 Message Date
Sébastien Han 032e6b5d77 ceph: remove osd pvc when the cluster is gone
Just like we do for the monitors, we set an ownerref to the OSD PVC so
when the cluster is deleted we remove the PVC too.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-10-30 16:17:15 +01:00
Sébastien Han ea1d71cbfb ceph: add vault kms support for osd encryption
When the Ceph cluster runs on PVC and the OSDs are encrypted we can
store LUKS's Key Encryption Key inside a Key Management System. Today,
Rook only supports HashiCorp Vault: https://www.vaultproject.io/

The CephCluster has now a new "security" field which will plug onto the
KMS. Here is an example:

security:
  kms:
    tokenSecretName: <name of the secret containing a Vault token, used
    to authenticate>
    connectionDetails: < a map of strings containing connection
    information>

Refer to the ceph-cluster-crd documentation to lear more.

Closes: https://github.com/rook/rook/issues/6105
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-10-30 16:16:33 +01:00
Travis Nielsen 22a1630249 Merge pull request #5483 from cloudandheat/feature/configurable-crush-root
ceph: make root= CRUSH label value configurable
2020-10-29 10:21:02 -06:00
Sébastien Han 9dd53cce9d Merge pull request #6494 from LalitMaganti/master
ceph: ignore MDS_ALL_DOWN during reconciliation
2020-10-29 11:30:09 +01:00
Jonas Schäfer 7ace6ac255 ceph: make root= CRUSH label value configurable
The CRUSH map does not allow duplicate values (nor keys) for the
labels. That means that if the currently hardcoded label value
`default` occurs anywhere else in the tree (for example, because
some of the topology labels provided by the cloud provider use it),
the cluster cannot sucessfully spawn.

By giving the user control over the label value used for the root
CRUSH map label, it is possible to adapt the cluster to this
situation.

To be able to actually use the `default` value, the root=default
node which is created by default by ceph itself has to be removed;
since that node is accompanied by a replicated crush rule, we have
to remove that rule, too.

The integration tests are modified to sometimes use the custom
crushRoot (based on an arbitrary criterium) to get coverage across
the various suites. Separate tests could be added, but were not
deemed necessary at this point.

Fixes #4993.

Signed-off-by: Jonas Schäfer <jonas.schaefer@cloudandheat.com>
2020-10-29 09:22:41 +01:00
Lalit Maganti 88f16e4980 ceph: ignore MDS_ALL_DOWN during reconciliation
This allows the catch-22 situation where the filesystem cannot be
reconciled because there is no MDS but there is no MDS because the
operator has not reconciled the filesystem and brought up the MDS pods.

Closes #5967, #5846

Signed-off-by: Lalit Maganti <lalitm@google.com>
2020-10-29 01:11:36 +00:00
subhamkrai cfdc5e7c50 ceph: remove allNode option for rgw
this commit removes unnecessary allNodes option
from rgw.

Signed-off-by: subhamkrai <srai@redhat.com>
2020-10-28 22:38:11 +05:30
Travis Nielsen 725e978a79 Merge pull request #6493 from travisn/check-orphan-mon-pvcs
ceph: Check for orphaned mon resources with every reconcile
2020-10-27 07:44:10 -06:00
subhamkrai dd7a1a895a ceph: export the storage capacity of the ceph cluster
adding fields `TotalBytes`, `UsedBytes`, `AvailableBytes`
`LastUpdated` to the ceph cluster CR's status section to
report the storage details of ceph cluster.

`TotalBytes`: Total storage capacity in bytes
`UsedBytes`: Total storage used in bytes
`AvailableBytes`: Total storage used in bytes(Total - Used)
`LastUpdated`: Last update time

for example(I have added 10GB disk):

`kubectl get cephclusters.ceph.rook.io -o yaml`

```
status:
    ceph:
      capacity:
        bytesAvailable: 9657188352
        bytesTotal: 10733223936
        bytesUsed: 1076035584
        lastUpdated: "2020-10-23T12:57:48Z"
```

Signed-off-by: subhamkrai <srai@redhat.com>
2020-10-27 17:35:02 +05:30
Travis Nielsen efb1cc9f72 ceph: check for orphaned mon resources with every reconcile
The mon resources may be orphaned if there is a mon failover
that was cancelled, for example a mon pvc may remain if the
original mon comes up and the operator was restarted before
the mon failover completed. The cleaning up of mon resources
was only happening was each successful mon failover, now we
perform the check with every reconcile since the resources
were not being cleaned up predictably enough.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-10-26 14:06:17 -06:00
Ali Maredia 8964941d44 ceph: add unit tests for object store controller with multisite
Add unit tests for when the "Zone" is configured
in an object store so that the object store joins
the CephObjectZone and the zone's corresponding
multisite configuration.

Signed-off-by: Ali Maredia <amaredia@redhat.com>
2020-10-22 11:36:06 -04:00
Travis Nielsen 6da0609b70 Merge pull request #6469 from sp98/fix-mon-pdb-reconcile
ceph: fix mon pdb reconcile
2020-10-21 15:45:34 -06:00
Santosh Pillai 28cd611eb4 ceph: fix mon pdb reconcile
updated mon pdb reconcile to delete mon pdb and create a new one when mon count changes in the cluster spec

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2020-10-21 23:15:29 +05:30
Satoru Takeuchi 081c7c4dba ceph: reduce the number of admission controller pods in small cluster
The number of admission controller pods is 2. When there is only one
node as the CI environment, one of these becomes Pending state.
Although it's harmless, it's better to reduce this value to 1.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2020-10-21 11:47:08 +00:00
subhamkrai cb0ca66a6b ci: enable gosec linter in golangci-lint
golangci-lint linter gosec showing more errors
than gosec gh. This commit resolve
new errors. And, removing
nosec comments from autogenerated files.

Signed-off-by: subhamkrai <srai@redhat.com>
2020-10-19 11:50:06 +05:30
Satoru Takeuchi e22bedbd9b ceph: reduce the number of provisioner pods in small K8s cluster
The default number of provisioner pods are 2. When there is only one node,
for example the CI environment, one of these becomes Pending state.
Although it's harmless, it's better to reduce this value to 1.

Closes: https://github.com/rook/rook/issues/6294

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2020-10-15 18:25:27 +00:00
Sébastien Han b70b098405 ceph: add support for stretched cluster crush rule
The pool spec has now a new property called "replicasPerFailureDomain"
which essentially represents the number of replicas to store in each
failure domain.
Assuming the failure domain is a datacenter (if the cluster is
stretched) then you will have 2 replicas per datacenter where each
replica ends up on a different host. This gives you a total of 4
replicas and for this, the "size" must be set to 4.

Closes: https://github.com/rook/rook/issues/5591
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-10-13 16:33:34 +02:00
Travis Nielsen c7e0338d5e ceph: require an odd number of mons and sufficient nodes
The ceph mons should never be started with an even number in quorum.
The desired state should always be an odd number of mons to ensure
a healthy majority quorum. The operator now rejects a request for
an even number of mons.

If there are not a sufficient number of nodes for mons to be on a
unique host, the operator also returns an early error instead of
getting stuck waiting for a pending mon. This is not foolproof since
there might be fewer available nodes for the mons, but at least it
is a quick check for the common case.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-10-12 15:21:27 -06:00
Thomas Bechtold ede4b9cb1a ceph: improve watcher debug message when node is not tolerable
When a node is not tolerable, also output the node name so it's clear
which not it is which is not tolerable.

Signed-off-by: Thomas Bechtold <tbechtold@suse.com>
2020-10-12 14:19:17 +02:00
Sébastien Han 7bdbc0a4fc Merge pull request #6397 from leseb/fix-6134
ceph: tune osd tcmalloc thread cache bytes
2020-10-08 18:56:04 +02:00
Sébastien Han eba561f13e Merge pull request #6408 from leseb/fix-bz-1885971
ceph: reduce s3 max retry
2020-10-08 17:30:27 +02:00
Travis Nielsen fd5c1982d1 Merge pull request #6407 from varshar16/update-nfs-ganesha-rados-url
ceph: update nfs ganesha rados config object
2020-10-08 08:56:23 -06:00
Sébastien Han d01a35cadd ceph: reduce s3 max retry
When rgw is not responding the aws-sdk retries using exponential
backoff. Having 20 retries means we would wait for a while (hours) to
eventually fail. This is a problem as we cannot reflect the status of
the bucket properly.
Now we use 5 max retries which means around 8 seconds.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-10-08 16:20:00 +02:00
Varsha Rao f5d125f8c9 ceph: update ganesha config object name
In cephadm and volume/nfs module, all ganesha daemons within a cluster watch
single config object. Each ganesha daemon in rook watches it's own config
object. This patch updates the ganesha config object name to maintain
uniformity.

Signed-off-by: Varsha Rao <varao@redhat.com>
2020-10-08 14:42:25 +05:30
Sébastien Han 35d524c7ed Merge pull request #6322 from alimaredia/object-zone-unit-tests
ceph: add unit tests for object/zone
2020-10-08 10:24:05 +02:00
Ali Maredia b62a50309f ceph: add unit tests for object/zone
Add unit tests for CephObjectZone controller.

Signed-off-by: Ali Maredia <amaredia@redhat.com>
2020-10-07 18:52:44 -04:00
Sébastien Han b49b6393bc ceph: tune osd tcmalloc thread cache bytes
We can now tune the value of TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES by
setting an annotation on the CephCluster CRD like so:

```
annotation:
  osd:
    TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES: "134217728"
```

Alternatively, if nothing is specified Rook will read the value of the
file `/etc/sysconfig/ceph`.

Closes: https://github.com/rook/rook/issues/6134
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-10-07 18:49:18 +02:00
subhamkrai 364df7793f ceph: remove suffix _sdd for tuneFastDeviceClass
this commit remove _ssd  suffix from
tuneFastDeviceClass setting as with _ssd
won't affect disk.

Signed-off-by: subhamkrai <srai@redhat.com>
2020-10-06 20:54:52 +05:30
Travis Nielsen 3eddcf5477 Merge pull request #6283 from sp98/rook-IPv6-support
ceph: support IPv6 single-stack
2020-10-06 07:46:25 -06:00
Raghavendra TalurandTravis Nielsen 0c21abd535 ceph: prevent closing of channel more than once
Once we close the channel for the monitoring daemons, we update the
monitoring status so as to not call them again.

This is to prevent "close of closed channel" panic.

Co-authored-by: Travis Nielsen <tnielsen@redhat.com>
Signed-off-by: Nitin Goyal <nigoyal@redhat.com>
Signed-off-by: Raghavendra Talur <raghavendra.talur@gmail.com>
2020-10-05 22:14:16 +05:30
subhamkrai c2c59ec47b ceph: tune fast device class for OSD on PVC in the Azure
on Azure, all SSDs are reporting as a rotational disk.
This commit will add `tuneFastDeviceClass` flag which will
tune for an SSD even if the cloud provider is reporting
rotational. We have a flag `tuneDeviceClass`
which works vice-versa.

Signed-off-by: subhamkrai <srai@redhat.com>
2020-10-05 20:19:55 +05:30
Sébastien Han 95ac992e48 ceph: check underlaying block status
During the initialization encrypted OSD initialization sequence, we check
for the presence of the encrypted container. If it exists we don't try
  to open it again since this will result in an error.
However, there is another case we need to handle, when the underlying
device is gone. For instance, if the pod/PV couple was drained and move
back, living the orphan dm. Once the pod comes back, the dm is still
present and perfectly matches. Unfortunately, the underlying disk is
different and thus the dm must be removed and the disk re-opened.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-10-05 15:47:29 +02:00
Santosh Pillai 70c5f70701 ceph: support IPv6 single-stack for ceph
Add --ms-bind-ipv6 true args to mom, osd, mgr, object, mds, rbd daemons.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2020-10-02 01:03:03 +05:30
Travis Nielsen cebcf0a04e Merge pull request #6353 from leseb/fix-obc-external
ceph: fix obc upgrade from 1.3 to 1.4 external cluster
2020-10-01 07:37:35 -06:00
Sébastien Han d2d1da5970 ceph: fix obc upgrade from 1.3 to 1.4 external cluster
During the 1.3 cycle, we had implemented support for OBC external mode
through an Endpoint in the StorageClass parameter. In 1.4, this is not
the case anymore as we directly use the CephObjectStore external mode.
However, we must maintain backward compatibility with the cluster using
the Endpoint and not fail the upgrade.
Thus checking for a CephObjectStore is invalid and should not always be
assumed, now if we detect an Endpoint we return a simple context which
fixes the upgrade.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-10-01 11:33:54 +02:00
subhamkrai 0fddfcf307 ceph: handle golangci-lint linter errcheck error
this commit handle golangci-lint linter errcheck.

`errcheck` - Errcheck is a program for checking for
unchecked errors in go programs. These unchecked errors
can be critical bugs in some cases

To see only staticcheck linter output
`golangci-lint run --disable-all -E errcheck`

Signed-off-by: subhamkrai <srai@redhat.com>
2020-09-30 22:24:34 +05:30
Sébastien Han 61b2c6186d Merge pull request #6350 from leseb/fix-luks2-resize
ceph: disable keyring after opening encrypted block
2020-09-30 16:42:51 +02:00
Sébastien Han a7e78858ce ceph: disable keyring after opening encrypted block
On LUKS2 format, the resize operation requires the KEK to be passed. To
maintain a single simple init container for resize, we now open the
encrypted block with  "--disable-keyring" so that further operations
won't require the keyring.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-09-30 15:53:36 +02:00
Sébastien Han 7852f75418 Merge pull request #6344 from varshar16/create-user-per-nfs-daemon
ceph: create user for each ganesha daemon
2020-09-30 10:49:07 +02:00
Varsha Rao 8d3140c8a0 ceph: create user for each ganesha daemon
Ganesha daemons don't need to acess ceph cluster with admin capabilities.
Instead new user with restricted caps can be used.

Signed-off-by: Varsha Rao <varao@redhat.com>
2020-09-29 22:27:17 +05:30
Travis Nielsen 5351968181 Merge pull request #6330 from travisn/osd-reconcile-perf
ceph: Detect OSDs on PVCs in batches instead of with label selectors individually
2020-09-29 09:24:35 -06:00
Sébastien Han eecfa1b7b0 Merge pull request #6338 from thotz/fixobcdeleteissue
ceph: remove user unlink while deleting OBC
2020-09-29 17:14:04 +02:00
Jiffin Tony Thottan b7bc51ea69 ceph: remove user unlink while deleting OBC
User unlink is performed just before deleting OBC resources.
Since user is internal to OBC and next to remove to delete user,
unlinking user is not necessary.

Fixes: 6300
Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-09-29 17:20:54 +05:30
Madhu Rajanna 2fa3e71733 ceph: update cephcsi to v3.1.1
as cephcsi v3.1.1 is released today
with many bug fixes and enhancements,
more details can be found at
https://github.com/ceph/ceph-csi/releases/tag/v3.1.1

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-09-29 14:03:44 +05:30
Travis Nielsen caa51e4cb8 ceph: detect osd deployments on pvcs in a batch
OSD prepare jobs only need to be run if the OSD deployments on PVCs were
not already started. For efficiency, we now query them in a batch instead
of querying them one-by-one with a label selector, which proves to be very
slow in large clusters.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-09-28 12:52:17 -06:00
Travis Nielsen c73022060a ceph: detect osd pvcs in a batch
The OSD PVCs were being detected one by one with a label selector.
This proves to be slow in large clusters. Instead, we now make this
more efficient by querying for all existing PVCs and looking up their
existing in memory with a map.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-09-28 12:52:17 -06:00
Travis Nielsen 6472544b84 Merge pull request #6336 from agarwal-mudit/csi
csi: update csi sidecar images
2020-09-28 10:18:02 -06:00
subhamkrai bfc878e33a yugabytedb: integration test failing
this commit reverts the changes done in
controller file as previous changes failing
in ci and those changes are related to linter
so we can supress them.

Signed-off-by: subhamkrai <srai@redhat.com>
2020-09-28 19:16:52 +05:30
Mudit Agarwal c547b36aa0 ceph: update csi sidecar images
This PR makes the changes in csi templates and
upgrade documentation required for updating
csi sidecar images.

Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
2020-09-28 18:58:52 +05:30
Travis Nielsen d3ce1574f3 Merge pull request #6309 from bhavin192/update-yugabytedb-version
yugabytedb: update YugabyteDB container image
2020-09-24 13:01:53 -06:00