Commit Graph
3241 Commits
Author SHA1 Message Date
Sébastien Han 2749035315 ceph: do not activate crash module
The mgr crash module is always enabled so we don't need to run the
command again. It saves some orchestration time.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-06-09 15:37:04 +02:00
Travis Nielsen 282a2a3741 ceph: increase osd size when pvc template increases
When the PVC template increases in size for the storageClassDeviceSet
in the cluster CR, we need to increase the size of the PVC and restart
the OSD. The OSD is restarted by changing a variable on the pod spec
that indicates the desired size of the OSD.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-06-08 14:34:43 -06:00
Travis Nielsen daeb9b56b0 ceph: remove dead osd code
The completeProvisionSkipOSDStart function is no longer used.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-06-08 14:34:43 -06:00
Sébastien Han 887836586a Merge pull request #5595 from afflom/port-naming-work
Configurable Service Port Names
2020-06-08 12:57:01 +02:00
Alex Flom 9a4d535f09 ceph: hardcode service port and container port names
When integrating rook with istio, service port names need to be prefixed by their protocol.
Trying to fix this by removing static port names in favor of configurable names.

Closes: #5587

add protocol prefix to service port names, hardcoded as discussed. renamed container ports

Signed-off-by: Alex Flom <alexander.flom@gmail.com>
2020-06-06 21:58:23 -04:00
Sébastien Han be04b1ac33 Merge pull request #5607 from leseb/fix-5492
ceph: increase liveness probe start delay on OSD
2020-06-05 17:24:18 +02:00
Sébastien Han 8592caed58 Merge pull request #5606 from leseb/fix-5521
ceph: fix osd number detection on upgrade
2020-06-05 17:12:38 +02:00
Sébastien Han c8de7009de ceph: increase liveness probe start delay on OSD
When the cluster is loaded and we restart an OSD, it will need some time
to respond to socket calls, basically more to be ready.
Increasing the initialDelaySeconds of the liveness probe fixes that
issue. For OSD, it waits for 45 sec, where other daemons 10 sec.

Closes: https://github.com/rook/rook/issues/5492
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-06-05 15:53:49 +02:00
Sébastien Han 3c7a252862 ceph: fix osd number detection on upgrade
If the cluster has 3 OSDs, during the upgrade when the OSD restarts it
will temporarily disappear from the "ceph versions" list so we need a
more robust way to list the number of OSDs and always returns the total
number of OSDs.

Closes: https://github.com/rook/rook/issues/5521
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-06-05 15:20:46 +02:00
Sébastien Han 5520ee35bb ceph: check if ok-to-stop even on failure
Even if we cannot determine wheter all the OSDs are running on the host,
we still need to perform the ok-to-stop check. It is far more common to
have more than 3 OSDs anyways.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-06-05 15:06:35 +02:00
Madhu Rajanna 09ccf55453 ceph: update cephcsi to v2.1.2
Cephcsi v2.1.2 is released with bug fixes,
refer https://github.com/ceph/ceph-csi/releases/tag/v2.1.2
for release details.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-06-05 14:43:05 +05:30
Travis Nielsen 872e6ff44a Merge pull request #5585 from ashangit/podAntiAffinity_rgw
ceph: fallback podAntiAffinity to preferredDuringSchedulingIgnoredDuringExecution on rgw
2020-06-04 13:28:14 -06:00
Sébastien Han bfa3b4daf4 ceph: do not use external node IP for mon endpoint
When the cluster is using HostNetworking, Rook was either picking up the
external or internal IP of the node. This resulted in mon endpoints have
public IP addresses. Those IP are not reachable from within the cluster
so OSD/CSI couldn't access the monitors from the configmap endpoint.

Also, exposing the cluster on a public network does not seem realistic,
so sticky with private/internal IP addresses is better.

Closes: https://github.com/rook/rook/issues/5495
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-06-04 14:12:45 +02:00
n.fraison c8df6c0faf ceph: add preferred pod anti-affinity on rgw if not host network
If host networking is not enabled add preferred pod anti-affinity on rgw pods to
improve spread of them

Signed-off-by: n.fraison <n.fraison@criteo.com>
2020-06-04 13:34:30 +02:00
Sébastien Han fc648970c4 Merge pull request #5511 from thotz/existingbucketsuserpolicy
obc: Do not delete user for retain policy if it is owner
2020-06-03 14:11:57 +02:00
Sébastien Han 5a36f335c0 Merge pull request #5276 from subhamkrai/osd-on-pvc
ceph: Updated initializeBlockPVC method and added unit tests.
2020-06-03 11:53:25 +02:00
Sébastien Han a90c18e0cb ceph: fix obc additionalConfig field
Some external consumers of Rook-Ceph are using the
lib-bucket-provisioner operator which creates different CRDs for both
objectbuckets.objectbucket.io and objectbucketclaims.objectbucket.io.
They have the `additionalConfig` declared in their spec. Rook-Ceph does
not and thus ignores it.
For the OB creation to work, the `additionalConfig` must be acknowledged
by the operator and populate or initialize it if empty.

This is preventing the following error:

controller.go:190] error syncing 'default/ceph-retain-bucket-converged': error creating OB "": ObjectBucket.objectbucket.io "obc-default-ceph-retain-bucket-converged" is invalid: spec.endpoint.additionalConfig: Invalid value: "null": spec.endpoint.additionalConfig in body must be of type object: "null", requeuing

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-06-02 16:04:20 +02:00
Travis Nielsen 6c249e751b ceph: start csi driver in parallel of cluster
The csi driver does not need to be started before the cluster
is created. When the csi driver fails to load, neither should
it prevent the cluster from being created. Therefore, we
initialize the basic constructs in the csi driver that are required
for cluster creation, then start the csi driver in a goroutine
so the cluster creation can continue. If the csi driver fails
or takes a long time to load, it will no longer affect cluster
creation.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-05-29 16:42:22 -06:00
Travis Nielsen ffe12a8ba2 ceph: remove obsolete csi driver cleanup code
The csi driver is no longer removed based on the deletion
of a configmap. Removing obsolete code.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-05-29 15:14:19 -06:00
subhamkrai 4378a30c64 ceph: updated initializeBlockPVC method and added unit tests
Updated initializeBlockPVC method to add
crushDeviceClass along with
immediateExecuteArgs instead of
metadataArg. Also added unit tests for this method.

Signed-off-by: subhamkrai <subhamkumarrai03@gmail.com>
2020-05-29 12:30:19 +05:30
Travis Nielsen 3ab060965c ceph: force restart mon pods if on bad node
If a mon is stuck in terminating state on a failed node,
force delete the pod so it can attempt to restart. If
the mon is backed by a PV the mon can start on another
node as well.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-05-28 12:11:05 -06:00
Travis Nielsen ff6a3f80cd ceph: improve osd update logging
The operator should only print helpful info messages
when an OSD is going to be updated. If the OSD hasn't
changed it is just a debug message.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-05-28 10:05:51 -06:00
Travis Nielsen 07f095c772 ceph: set osd health check interval to 60s
The osd health check every 5 min is not frequent enough to respond
quickly enough to osds going down. Reducing the time interval
to one minute for faster response time.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-05-28 10:05:51 -06:00
Travis Nielsen 171910707b ceph: refactor pod deletion to k8sutil package
The pod deletion is needed by other daemons besides the osds,
so we move the helper method into the k8sutil package.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-05-28 10:05:50 -06:00
Jiffin Tony Thottan 9a3ffbaab2 obc: Do not delete user for retain policy if it is owner
When obc is deleted, the attached ceph user will be also removed
This will cause obc creation failure for the same bucket since user
was missing. With this patch the user will be retained revoking his permissions

Also removed 'GetBucketPolicy' permission from Allowed action. The same set of
permission is used for denying the owner/old user of OBC. So that in the next
obc request for the bucket, owner can set polciy for the new user

Closes: https://github.com/rook/rook/issues/5510
Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-05-27 22:58:08 +05:30
Sébastien Han c799e11032 ceph: enhancement cleanup with disks
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 sanitizeDisks which holds more details:

* confirmation: the confirmation message to sanitize disks,
use "yes-really-sanitize-disks" to confirm

This will **only** wipe the metadata, so it's a fast cleanup allowing
you to re-install later but won't remove all the data from the drive.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-05-27 18:14:02 +02:00
Travis Nielsen e9348070a7 Merge pull request #5533 from gyant/ryanthompson/fix-cassandra-annotations
cassandra: Adds json struct tags to fix cassandra annotations
2020-05-26 15:34:24 -06:00
Sébastien Han 0ed8e73942 ceph: add missing security context to crash collector
The crash collector was missing the security context to properly run on
OCP, thus crashing when trying to post a crash dump.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-05-26 16:35:11 +02:00
Ryan Thompson 36db509747 cassandra: Adds json struct tags to fix cassandra annotations
x ClusterSpec
x RackSpec

The lack of the json tag required manifests to use 'Annotations' rather than 'annotations' to propogate annotations to the stateful set pods. This change will allow the software to function as documented.

Closes: https://github.com/rook/rook/issues/5097
Signed-off-by: Ryan Thompson <ryan@zengyant.com>
2020-05-22 22:26:50 -07:00
Sébastien Han 062e58e053 ceph: do not enforce osd-memory-target
As of Nautilus Ceph auto-tunes its osd_memory_target on the fly so we don't need to force it.
ROok does not support Mimic anymore so this can be removed.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-05-22 11:09:02 +02:00
Travis Nielsen 8bb4f603e6 ceph: default the device set template name to data
In 1.3 we added support for the metadata pvcs, thus requiring the name
to be set on the templates to differentiate between data and metadata.
For backward compatibility we need to assume the template is for data
if it is not set.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-05-21 11:33:16 -06:00
Sébastien Han 2576674648 Merge pull request #5515 from leseb/lvm-verbose
ceph: fix lvm arg
2020-05-20 17:13:47 +02:00
Sébastien Han 712c958202 ceph: fix lvm arg
Add the valid verbose flags back.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-05-20 13:03:51 +02:00
Travis Nielsen 5ac7b528c3 Merge pull request #5342 from rajatsingh25aug/ceph-mds-deactivate
Ceph: Newer mechanism to scale MDS for Nautilus+
2020-05-19 10:50:00 -06:00
Sébastien Han d28e2f605c Merge pull request #5490 from travisn/monitoring-goroutines
Only run the cluster monitoring goroutines once
2020-05-19 09:40:13 +02:00
Sébastien Han dce5846301 Merge pull request #5488 from travisn/host-cleanup-chan
Stop monitoring a cluster immediately when deleted
2020-05-19 08:50:15 +02:00
Sébastien Han 511772afb9 Merge pull request #5436 from sp98/obc-finalizer
finalizer for OBC cleanup
2020-05-19 08:44:38 +02:00
Sébastien Han 2c550dce83 Merge pull request #5486 from cybozu-go/ceph-stop-operator-if-critical-problems-happens
ceph: gave up to run the operator if the controller-runtime failed to start
2020-05-19 08:43:17 +02:00
Travis Nielsen 394b98cb0b ceph: cancel the host cleanup if pvc deletion pending
During cluster delection, the finalizer will not be removed until
all the PVCs are removed. Since this could wait for a long time,
as long as the deletion event is re-queued, we need to cancel
the goroutine that is watching for cluster deletion so it can
avoid running multiple goroutines as the event runs again
and again.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-05-18 13:07:35 -06:00
Travis Nielsen 4173bee7c1 ceph: stop monitoring a cluster when deleted
When a cluster is requested for deletion there is no longer
a reason to monitor the cluster health such as whether mons
are in quorum, osds are up and in, or monitor the ceph status.
The cluster will wait potentially for a long time if the
PVCs are not deleted by the admin, therefore we stop monitoring
the cluster even before the finalizer is removed.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-05-18 13:02:37 -06:00
Travis Nielsen 90fa3a6d22 ceph: set external creds if admin key is available
If the admin key is available, set the external creds struct
to use that admin username and key instead of requiring the
callers to check every time if they should use the admin
key or the external key.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-05-18 12:56:28 -06:00
Travis Nielsen 81dae96929 ceph: remove obsolete version from osd health check
The Ceph version information is not needed to be passed
to the osd health checker since mimic support was dropped.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-05-18 12:56:28 -06:00
Travis Nielsen 85b0be301e ceph: simplify ceph user for monitoring goroutines
The ceph username is all that needs to be passed to the goroutines
that are monitoring the health of Ceph. This simplifies the
initialization of the goroutines.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-05-18 12:56:27 -06:00
Travis Nielsen 52e15b6e36 ceph: only run the cluster monitoring goroutines once
The monitoring goroutines that check for mon and osd health,
the ceph cluster status, and the bucket provisioner should
only be started once for each cluster. Previous to this change
and since the controller runtime conversion the goroutines were
being started again every time a reconcile was run. This means
you could potentially have many goroutines monitoring the same
thing.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-05-18 12:55:58 -06:00
Santosh PillaiandElise Gafford 5ef88f8f09 ceph: finalizer for OBC cleanup
This PR is for rebasing #4683 with master. With new controller runtime changes most the changes with #4683 got redundant.
Only valid change is waiting for all the object buckets to be cleaned up before removing the finalizer.

Co-authored-by: Elise Gafford <egafford@redhat.com>
Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2020-05-18 23:54:59 +05:30
Satoru Takeuchi f6a3da2760 ceph: gave up to run the operator if the controller-runtime failed to start
The operator continues to run even though the controller-runtime
failed to start. Since the controller-runtime is essential, the operator
is non-functional after that. It makes troubleshooting more difficult.

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

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2020-05-18 17:38:35 +00:00
Michael Fritch 248178e0c3 ceph: replace CACHEINODE with MDCACHE
CACHEINODE has been deprecated in favor of MDCACHE

https://review.gerrithub.io/c/ffilz/nfs-ganesha/+/454929
https://github.com/nfs-ganesha/nfs-ganesha/commit/4f4d624ceb361e2ac05e9e304583f35832921790

Signed-off-by: Michael Fritch <mfritch@suse.com>
2020-05-18 10:32:44 -06:00
Travis Nielsen 6d130864f3 ceph: set pg_num_min on new rgw metadata pools
pg_num_min needs to be set on all new and existing rgw
metadata pools so the autoscaler won't immediately
increase the pg count. The pg_num_min was only being set
on existing pools and not on new pools.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-05-15 16:22:38 -06:00
Travis Nielsen d1da12c6ac ceph: wait indefinitely for cleanup before removing cluster finalizer
During cluster deletion, we currently only retry for a couple minutes
to wait for the pvcs to be deleted. After the timeout, we proceed
with the cluster deletion. To properly protect the pvcs for proper
cleanup, the finalizer should not be removed until the pvcs
are all confirmed to be deleted. In order to not block other cluster
events, we re-queue the deletion event to run again every 10s
until the pvcs are deleted or the finalizer is manually removed.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-05-14 16:52:24 -06:00
Travis Nielsen f47bb945c2 ceph: remove duplicate controller wait setting
The controller setting for requeuing an event moved to the
opcontroller package and was no longer needed in the main
controller package.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-05-14 16:52:24 -06:00