Commit Graph
1895 Commits
Author SHA1 Message Date
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
n.fraison 9c6ef9c278 ceph: remove specific mds configuration on mon configuration database
Remove specific mds config added to the mon configuration database when deleting a CephObjectstore
or when scaling down number of mds
Also remove mds CephX key

Signed-off-by: n.fraison <n.fraison@criteo.com>
2020-04-26 11:15:27 +02:00
Travis Nielsen 8727807e49 Merge pull request #5321 from cybozu-go/ceph-some-minor-fixes
update documents and cleanup code
2020-04-24 12:57:15 -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
Satoru Takeuchi afb6dbe1ed ceph: fix a wrong comment and a warning message about populating device info
PopulateDeviceInfo may fail for reasons other than lsblk failure.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2020-04-24 13:00:15 +00:00
Travis Nielsen 99dc363ab6 ceph: metadatadevice to not be added to osd data device list
When the metadataDevice is specified, it was a regression that it was
being interpreted also as a data device. ceph-volume was failing
when the metadataDevice was added as both a data and metadata device.
So we ensure it is not added to the list of data devices.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-04-23 12:40:11 -06:00
Travis Nielsen 5789c2b197 Merge pull request #5289 from Madhu-1/csi-v2.1.0
CSI: update cephcsi to v2.1.0
2020-04-23 07:49:23 -06: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 f792cd7c04 Merge pull request #5280 from travisn/mgr-module-async
Configure mgr modules in parallel of rest of reconcile loop
2020-04-20 14:07:21 +02:00
Madhu Rajanna 5684c4cc37 CSI: update cephcsi to v2.1.0
cephcsi v2.1.0 is released and doesnot need any deployment
template changes. This PR updates the cephcsi image
version to v2.1.0

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-04-20 14:58:25 +05:30
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
Sébastien Han 58b7b1e012 ceph: stop potential secret leak
If cluster info is not fully initialized we could leak some of the ceph
secrets in the operator logs.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-04-20 09:56:27 +02:00
Travis Nielsen 348690ea64 ceph: update defaults to the ceph v14.2.9 release
With the release of ceph v14.2.9 we set the default examples to this version.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-04-17 12:54:06 -06:00
Travis Nielsen 9634574d5b ceph: configure mgr modules in parallel of osds
The mgr modules take some time to configure during every reconcile loop.
The OSDs were waiting until the mgr module config was completed. Since
the mgr module config is optional or at least not critical to the rest
of the reconcile we can do it in parallel.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-04-17 12:43:53 -06:00
Sébastien Han 5adfc7b43d Merge pull request #5085 from leseb/rbd-mirror-crd
ceph: extract rbd-mirror to its own crd
2020-04-15 10:58:22 +02:00
Sébastien Han c1b8a7aa9e ceph: extract rbd-mirror to its own crd
Previously, the rbd-mirror daemon was integrated into the `CephCluster`
CRD. This wasn't really practical since we would have to wait for the
whole orchestration to be done to actually set it up. The same goes for
any CR update. Let's say you want to change the number of daemons, Rook
would go through mons, mgrs and osds until it get to rbd-mirror.
This triggers an undesired full orchestration.

With its own CRD this component just gains a lot more flexibility.

Closes: https://github.com/rook/rook/issues/5084
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-04-15 09:12:56 +02:00
Travis Nielsen 668bca27b1 ceph: reduce verbose logging for ok-to-stop failures
When a daemon is not safe-to-stop the operator will print the full
stack trace rather than a simple error message that the daemon
cannot be stopped.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-04-14 14:53:56 -06:00
RAJAT SINGH bb79f7bc2c Ceph: PV provisioning fails upon upgrade
CSI CephFS provisioner fails to provision a Persistent Volume after upgrading from Rook Ceph Operator 1.1.2 to 1.1.7.
This issue can be fixed by removing givePoolAppTag function whenever there is an appName cephFs.

Signed-off-by: RAJAT SINGH <rajasing@redhat.com>
2020-04-14 08:24:07 +05:30
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 8622583154 Merge pull request #5183 from umangachapagain/mgr-minimal-privilege
Ceph: revert mgr to minimal privilege
2020-04-09 16:53:32 -06:00
Travis Nielsen 8ba023764b Merge pull request #4433 from rajatsingh25aug/dataPool-Fix
Ceph: Filesystem Pool Size are ignored
2020-04-09 16:53:16 -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 ff1ab64d8d ceph: skip reconcile events where the spec not updated
The controllers should ignore events for status updates. The reconcile
only needs to happen when the spec is updated or the resource is marked
for deletion. Otherwise, the controllers may stay in an update loop as
the reconcile events are triggered again every time there is a status
update during the reconcile.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-04-09 11:20:45 -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
Michael Adam 76434a8bc1 nfs: fix comment typo
Signed-off-by: Michael Adam <obnox@redhat.com>
2020-04-08 00:32:08 +02:00
Travis Nielsen f4df6f6069 Merge pull request #5143 from shellwedance/ceph_add_size_in_pool_create
Ceph: Add replica_size flag in replicated pool creation time
2020-04-07 07:21:05 -06:00
Sébastien Han 36f6726405 Merge pull request #5200 from leseb/fix-codegen
rook: fix codegen
2020-04-07 14:46:38 +02:00
Sébastien Han 6a1c9ec5f0 rook: fix codegen path
The path was copied in the wrong location, ending up with a duplicated
directory in pkg/pkg/api. We need pkg/ only.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-04-07 13:11:59 +02:00
morimoto-cybozu 9edf8c45b5 ceph: fix resync failure of OSD pod using LV-backed-PV
This fixes the resync of the Deployment of the OSD pod that uses
an LV-backed PV.
`getOSDInfo()` reads the configuration of the OSD pod from the existing
Deployment, but it overlooked this case.

Closes: https://github.com/rook/rook/issues/5139
Signed-off-by: morimoto-cybozu <kenji_morimoto@cybozu.co.jp>
2020-04-07 09:53:00 +00:00
RAJAT SINGH 013c5bbac3 Ceph: Filesystem Pool Size are ignored
The old Filesystem's pool is not getting updated when changed with the new File system.
So, we added two helper functions namely generateDataPoolNames and generateMetaDataPoolName  that will generate the names of the pools and then change those pool's values using the SetPoolSize method.

Signed-off-by: RAJAT SINGH <rajasing@redhat.com>
2020-04-07 14:54:45 +05:30
taeuk_kimanddonggyu_park c266c982c9 Ceph: Add replica_size to replicated pool creation
Add size parameter to pool create command instead of executing pool set command only for size
This makes pool min_size reflect replica size.

Co-authored-by: donggyu_park <donggyu_park@tmax.co.kr>
Signed-off-by: taeuk_kim <taeuk_kim@tmax.co.kr>
2020-04-07 07:06:35 +00:00
Dmitry Yusupov b640f75c08 edgefs: fix SMB controller update path
Signed-off-by: Dmitry Yusupov <dmitry.yusupov@nexenta.com>
2020-04-06 18:32:23 -07:00
Travis Nielsen 099ed307d5 Merge pull request #5177 from ashangit/set_pg_num_min
ceph: set pg_num_min for rgw metadata pools
2020-04-06 11:24:39 -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 ddadfbc993 ceph: remove leading and trailing space from get config
Value returned by ceph config get can contains some trailing space which leads to
issues when running other ceph command.
For ex.:
2020-04-06 15:32:43.543050 I | exec: Running command: ceph osd pool set test-1.rgw.control pg_num_min 8
 --connect-timeout=15 --cluster=rook-ceph --conf=/var/lib/rook/rook-ceph/rook-ceph.config --keyring=/var/lib/rook/rook-ceph/client.admin.keyring --format json --out-file /tmp/249563089
2020-04-06 15:32:44.005018 I | exec: Error EINVAL: error parsing int value '8

Signed-off-by: n.fraison <n.fraison@criteo.com>
2020-04-06 18:14:50 +02:00
Sébastien Han 71799682ca ceph: print the reason for reconciling
General debugging helper without having to turn on DEBUG logs.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-04-06 16:07:01 +02:00
Travis Nielsen eeb687ad14 ceph: log skipped reconcile based on ceph health
When the Ceph health is HEALTH_ERR the controllers will skip the
reconcile. With info level logging there needs to be an indication
of this decision to skip the reconcile, otherwise users will
wonder why their resources aren't being created.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-04-06 16:07:01 +02:00
Umanga Chapagain 362a9c78e0 Ceph: revert mgr to minimal privilege
mgr should only include "mon allow profile mgr" instead
of "mon allow *"

Fixes: #2529
Reverts: #2523
Signed-off-by: Umanga Chapagain <chapagainumanga@gmail.com>
2020-04-06 16:03:51 +05:30
Sébastien Han 56707ddcc4 Merge pull request #5179 from ashangit/auth_key_not_deleted
ceph: remove appropriate rgw ceph user when CephObjectStore is deleted
2020-04-06 10:02:20 +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
Umanga Chapagain 3fa772e3a7 Yugabytedb: fixes unhandled type assertions
unhandled type assertions can lead to runtime panic. using
the boolean 'ok' flag to handle failure to assert type.

Issue: #4566
Signed-off-by: Umanga Chapagain <chapagainumanga@gmail.com>
2020-04-04 14:00:57 +05:30
Umanga Chapagain a6e7256d52 NFS: fixes unhandled type assertions
unhandled type assertions can lead to runtime panic. using
the boolean 'ok' flag to handle failure to assert type.

Issue: #4566
Signed-off-by: Umanga Chapagain <chapagainumanga@gmail.com>
2020-04-04 14:00:52 +05:30
Umanga Chapagain e8889c4764 Edgefs: fixes unhandled type assertions
unhandled type assertions can lead to runtime panic. using
the boolean 'ok' flag to handle failure to assert type.

Issue: #4566
Signed-off-by: Umanga Chapagain <chapagainumanga@gmail.com>
2020-04-04 14:00:47 +05:30
Umanga Chapagain b6a8a094ce Cockroachdb: fixes unhandled type assertions
unhandled type assertions can lead to runtime panic. using
the boolean 'ok' flag to handle failure to assert type.

Issue: #4566
Signed-off-by: Umanga Chapagain <chapagainumanga@gmail.com>
2020-04-04 14:00:42 +05:30
Umanga Chapagain ffc029f6fe Cassandra: fixes unhandled type assertions
unhandled type assertions can lead to runtime panic. using
the boolean 'ok' flag to handle failure to assert type.

Issue: #4566
Signed-off-by: Umanga Chapagain <chapagainumanga@gmail.com>
2020-04-04 14:00:39 +05:30
Umanga Chapagain 654efb6d0a Ceph: fixes unhandled type assertions
unhandled type assertions can lead to runtime panic. using
the boolean 'ok' flag to handle failure to assert type.

Issue: #4566
Signed-off-by: Umanga Chapagain <chapagainumanga@gmail.com>
2020-04-04 14:00:19 +05:30
Dmitry Yusupov afd8398a6b Merge pull request #5165 from dyusupov/master
edgefs: support for SMB CRD
2020-04-03 14:18:14 -07:00