Commit Graph
5036 Commits
Author SHA1 Message Date
Travis Nielsen f7013884b4 Merge pull request #6972 from jshen28/improve-cluster-upgrade-observibility
ceph: exposing which node/osd is processing
2021-01-15 14:32:53 -07:00
Satoru Takeuchi 1be47ea0b8 ceph: delete discovery daemon if it is disabled
discovery-daemon still exists even if it's disabled.

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

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2021-01-15 19:44:40 +00:00
Sébastien Han 758226294b ceph: convert CephClient CRD to controller-runtime
This was the last remaining CRD to not use the controller-runtime
library.
Small additions were added with the transition:

* the Kubernetes Secret that contains the CephX key has now an owner
  reference to the CephClient object
* the secret name is present in the Status field of the CephClient:

```
status:
  info:
    secretName: rook-ceph-client-glance
  phase: Ready
```

The controller will reconcile on CR updates and also if the Kubernetes
Secret is deleted.

Closes: https://github.com/rook/rook/issues/4938
Signed-off-by: Sébastien Han <seb@redhat.com>
2021-01-15 16:17:38 +01:00
shenjiatong 0d80cc396d ceph: exposing which node/osd is processing
it would be more firendly to cloud operators to
know which node is being processed during
upgrade

Signed-off-by: shenjiatong <yshxxsjt715@gmail.com>
2021-01-15 23:12:26 +08:00
Sébastien Han cb7d600841 ceph: set process working dir to /var/log/ceph
By setting the working directory of a Ceph daemon to the log direcor
(which is bindmounted to the host), we can ensure that the coredumps
will be available.

On CentOS 7 **only**, the kernel is configured with:

```
cat /proc/sys/kernel/core_pattern
core
```

which means that the coredumps will end up in the process working
directory and will be named "core".

On CentOS 8, everything is different and this won't work but still
CentOS will be able to consume this and changing the working directory
is harmless.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-01-15 16:06:42 +01:00
Travis Nielsen ea29665a8a ceph: during object store deletion return success if not found
If the object store is not found during deletion of the object store CR,
proceed with the deletion instead of blocking and re-queueing the
deletion reconcile in an endless loop. This was causing instability
in the integration tests.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-01-13 15:44:28 -07:00
Sébastien Han 22721f1df8 Merge pull request #6949 from leseb/bump-controller-runtime-0.7
core: bump to controller-runtime 0.7.0 version
2021-01-13 17:16:13 +01:00
Sébastien Han 7558d37420 core: bump to controller-runtime 0.7.0 version
Now using https://github.com/kubernetes-sigs/controller-runtime/releases/tag/v0.7.0

Closes: https://github.com/rook/rook/issues/6689
Signed-off-by: Sébastien Han <seb@redhat.com>
2021-01-13 11:00:43 +01:00
Sébastien Han c75f0594b9 Merge pull request #6691 from iamniting/log
ceph: enhance delete cephObjectStoreUser logging
2021-01-13 09:34:57 +01:00
Travis Nielsen 4ad432ffcf ceph: only restart ceph dashboard module if settings changed
If ssl was not enabled, the dashboard was being restarted with every
reconcile. Instead, the dashboard should only be restarted when
the settings have changed in order to reduce the frequency that
the dashboard is restarted.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-01-12 16:00:13 -07:00
Nitin Goyal 76a370a57a ceph: enhance delete cephObjectStoreUser logging
DeleteUser was returning error "failed to delete user ... with buckets"
without corresponding buckets information. Now it will check buckets, If
buckets are present then return error with buckets info on failure.

Signed-off-by: Nitin Goyal <nigoyal@redhat.com>
2021-01-12 23:30:57 +05:30
Sébastien Han 67c12a803e Merge pull request #6883 from jshen28/allow-disable-liveness-check-for-mds
ceph: allow disable liveness check for mds daemonset
2021-01-11 11:20:10 +01:00
ushen d3416fcf2c ceph: allow disable liveness check for mds daemonset
Allow to disable liveness probes for mds pod

Signed-off-by: shenjiatong <yshxxsjt715@gmail.com>
2021-01-11 17:55:51 +08:00
Sébastien Han 362637ec3d ceph: do not explicitly turn on the balancer
As of Pacific the balancer is now on by default in upmap mode.
In earlier versions, the balancer was included in the `always_on_modules` list, but needed to be
turned on explicitly using the ``ceph balancer on command.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-01-08 17:20:47 +01:00
Sébastien Han c4c7b151ac ceph: add pacific release name
When the version is detected it will print the name of the release
Pacific correctly where previously it was showing <unknown version>".

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-01-08 17:20:47 +01:00
subhamkrai 9109cc6b8c ceph: apply OSD resources and placement for device sets
`.spec.resources.osd` resources and `placement: all:` placements
parameters for the OSD pod did not reflect the value like
it has for other pods mon,mgr.

this commit will allow to set those parameters for the OSD pod also.

Signed-off-by: subhamkrai <srai@redhat.com>
2021-01-08 18:05:21 +05:30
Julien Girardin d63d9b7d4d ceph: change external rgw detection, not relying on cluster
After #6217, internal rgw spawning on external cluster was still broken,
operator claiming:
```
ceph-object-controller: failed to reconcile failed to create object
store deployments: failed to reconcile external endpoint:
failed to create or update object store "arch-cloud" endpoint:
failed to create endpoint "rook-ceph-rgw-arch-cloud". Endpoints
"rook-ceph-rgw-arch-cloud" is invalid: subsets[0]:
Required value: must specify `addresses` or `notReadyAddresses`
```

To spawn internal rgw for external cluster, changes detection of
what mean 'internal' for rgw and only use the externalRgwEndpoints
list for that independently of the status of the cluster
Now there is multiple posibilities:

 * internal cluster and internal rgw pods: "normal case"
 * external cluster and internal rgw pods: <= now working with the PR
 * external cluster and external rgw pods: the external case
 * internal cluster and external rgw pods: <= new case that could exist

Signed-off-by: Julien Girardin <jugirardin@free.fr>
2021-01-08 11:28:41 +01:00
Travis Nielsen afeb38417d ceph: suppress reconcile error after operator restart
After the operator restarts, the controllers will not all be able
to reconcile until the ceph config has been generated by the reconcile
of the CephCluster controller. The message printed to the operator log
is frequently seen as an error condition even though it is a normal
condition where we requeue the reconcile until the config is available.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-01-07 17:24:13 -07:00
Travis Nielsen 464e332dc1 ceph: init rgw dashboard access key in goroutine
The command to set or disable the rgw dashboard started
hanging in some scenarios in v15.2.8. For now we start
the rgw dashboard config in a goroutine until this issue
is tracked down. After the issue is fixed in ceph, the
goroutines will no longer be necessary.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-01-07 07:08:20 -07:00
Travis Nielsen 7d3f02c92d Merge pull request #6853 from subhamkrai/log-level
ceph: update to latest Kubernetes version 1.20.0
2021-01-04 12:58:04 -07:00
Travis Nielsen 857c1b277f Merge pull request #6749 from sp98/requeue_disruption_reconciler
ceph: requeue clusterDisruption controller more proactively
2021-01-04 12:41:08 -07:00
subhamkrai 0146eb3805 ceph: update to latest Kubernetes version 1.20.0
updating to latest Kubernetes version 1.20.0 fix
security issues. In the current version, it allows
for the token leak in logs when logLevel >= 9.

Signed-off-by: subhamkrai <srai@redhat.com>
2020-12-21 13:18:13 +05:30
Travis Nielsen 423bc3167d Merge pull request #6856 from travisn/obsolete-legacy-rgw-cleanup
ceph: No need for removal of legacy rgw deployments
2020-12-18 14:32:17 -07:00
Travis Nielsen a3619be9c0 Merge pull request #6857 from travisn/obsolete-operator-ns
ceph: Remove unused operator namespace parameter
2020-12-18 14:31:53 -07:00
Blaine Gardner b8dc2a3214 ceph: update lib bucket provisioner
Update to the latest lib bucket provisioner code.
Fixes issue 6650

Modifies CRD for objectbucketclaims to fix an additional bug where an
ObjectBucket's 'ClaimRef' is lost due to the CRD validation being
specified incorrectly.

Changes OBC deletion/cleanup to delete the bucket before the user. A
user cannot be deleted without an unsafe purge option if the user has
buckets associated to it.

Does not reintroduce bug 6767 from previous fix for 6650

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2020-12-18 12:48:54 -07:00
Travis Nielsen e8ea6dc2f8 ceph: no need for removal of legacy rgw deployments
The legacy rgw deployments were removed in 1.0, so there is no more need
for the operator to keep checking for those!

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-12-18 12:03:50 -07:00
Travis Nielsen e56c68c9e9 ceph: remove unused operator namespace parameter
The operator namespace is not used in the StartOperatorSettingsWatch()
method. Instead, the method looks up the namespace from the
POD_NAMESPACE env var.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-12-18 11:45:14 -07:00
Travis Nielsen 0d4e6843ba Merge pull request #6839 from varshar16/remove-ganesha-prefix-rados-config-obj
ceph: remove 'ganesha-' from nfs-ganesha config object name
2020-12-18 08:54:59 -07:00
Varsha Rao 9530807179 ceph: remove 'ganesha-' from nfs-ganesha config object name
PR[1] in volume nfs plugin will remove it too. Since it can cause
inconsistencies.

This change will not affect exports created using dashboard. As it looks for
ganesha config object just by 'conf-' [2].  Exports cannot be created by using
volume/nfs plugin in Octopus version. Because the ceph rook module is broken.

[1] https://github.com/ceph/ceph/pull/38510

[2] https://github.com/ceph/ceph/blob/octopus/src/pybind/mgr/dashboard/services/ganesha.py#L1111

Signed-off-by: Varsha Rao <varao@redhat.com>
2020-12-18 17:18:52 +05:30
shenjiatong 8d3d460e70 ceph: refactor and remove duplicate codes
Signed-off-by: shenjiatong <yshxxsjt715@gmail.com>
2020-12-18 18:01:30 +08:00
shenjiatong 04aabb3896 ceph: analyze result for new typed return from lvm batch
Signed-off-by: shenjiatong <yshxxsjt715@gmail.com>
2020-12-18 11:11:03 +08:00
ushen 373b952988 ceph: allow ceph 14.2.15 for lvm batch
14.2.15 lvm batch command prepare report changes
output format. This commit skips md check if ceph version
is greater than 14.2.13.

Signed-off-by: shenjiatong <yshxxsjt715@gmail.com>
2020-12-18 11:11:02 +08:00
Travis Nielsen 3beb625f08 ceph: update examples and operator to Ceph v15.2.8
The latest octopus release is now out with v15.2.8. We update the
operator base image and the examples to run with this version.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-12-17 18:21:15 -07:00
Travis Nielsen d38119631b Merge pull request #6801 from binoue/remove-deplicated-env-var-in-mgr-pod
ceph: remove overlapping env values
2020-12-16 15:48:06 -07:00
Travis Nielsen 45e8ca7173 Merge pull request #6838 from synarete/ceph-crush-rule-with-device-class
ceph: Two step crush rule with device class
2020-12-16 13:08:52 -07:00
Travis Nielsen 64fc740d8a ceph: revert new node is not provisioned when useallnodes is true
This reverts commit a6ee5657ae.
The operator reconcile of the cephcluster was staying in an endless
loop in clusters that did not have OSDs configured on all nodes.
Now we revert this change for the patch release and will follow
up with a more complete fix in https://github.com/rook/rook/pull/6813.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-12-16 11:36:31 -07:00
Shachar Sharon 39a806f747 test: ceph add-rule via crush-map explicit decompile/compile
Test the code-flow when creating crush-rule via explicit
decompile/compile crushmap, when building two-steps crush rule. Relevant
for the case where 'PoolSpec.Replicated.ReplicasPerFailureDomain' is non
zeoro.

This test requires ceph's 'crushtool' to be installed on local machine.
Otherwise, it is ignored.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
2020-12-16 17:43:49 +02:00
Shachar Sharon 53461dd2ef ceph: pass 'device-class' when creating explicit crush-rule
When 'pool.Replicated.ReplicasPerFailureDomain' is non zero, the code
goes via route of adding explicit crush-rule from template, but ignores
the 'pool.DeviceClass' if it is set. Added option to template to have
(optional) 'class hdd|ssd'

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
2020-12-16 17:42:27 +02:00
binoue 2ecde7c9c6 ceph: remove deplicated env value
Currently, mgr deployment has two overlapping environment variables, ROOK_POD_IP.
This causes kube-apiserver to create error logs

Signed-off-by: binoue <banji-inoue@cybozu.co.jp>
2020-12-15 09:11:26 +09:00
Travis Nielsen 27b0295ac1 Merge pull request #6815 from travisn/osd-deviceclass
ceph: Apply deviceClass properly to new osds
2020-12-14 13:13:55 -07:00
Travis Nielsen a635707538 Merge pull request #6822 from travisn/osds-on-pvc-and-devices
ceph: Allow OSDs on both PVCs and devices
2020-12-14 13:13:24 -07:00
Santosh Pillai 049b44f990 ceph: requeue clusterDisruption controller more proactively
Currently the reconcile of the clusterDisruption controller was triggered mainly due to the
ceph status update in the cephCluster CR. This PR adds reconciles the cluster when:
1. Reconcile when the cluster is created. (This will trigger the first reconcile)
2. Reconcile only when the clusterSpec is updated. (This will avoid triggers when cluster status is updated)
3. Reconcile for events on cephblockpool, cephfilesystem and cephObjectStore.
4. Reconcile for events on Main PDB and when `DisruptionsAllowed` is 0. (that is, when one of the OSD goes down).
5. Reconcile after 30 seconds when there is an active drain going on, that is, pdbStateMap has `draining-failure-domain` as not empty.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2020-12-14 16:22:52 +05:30
Travis Nielsen 3ca3d7783b ceph: allow OSDs on both pvcs and devices
The OSD configuration on local devices was being skipped if a
storageClassDeviceSet was specified. Both types of OSDs should
be allowed in the same cluster, which allows a cluster in the cloud
to also take advantage of local devices with different perf
properties.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-12-11 14:21:47 -07:00
Travis Nielsenandshenjiatong a0a27bc426 ceph: apply deviceClass properly to new osds
The deviceClass property was being ignored when creating the
non-pvc OSDs. Now the deviceClass will be specified as a property
for individual devices, all devices on a node, or all OSDs in the
cluster, depending on the level where the config is applied in the
cluster CR.

Co-authored-by: shenjiatong <yshxxsjt715@gmail.com>
Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-12-11 10:16:00 -07:00
Madhu Rajanna 5392bc0d07 ceph: update csi to v3.2.0
updating cephcsi to latest release version

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-12-11 20:22:36 +05:30
Travis Nielsen d0ba899341 ceph: check stretch cluster is ready to configure arbiter
The arbiter can only be configured with the stretch cluster if the
CRUSH map is balanced and there are two zones in the CRUSH map.
After the OSDs are configured, we wait for all the OSD pods to be
running and that the CRUSH map is balanced. If it takes more than
two minutes, we fail the reconcile and try again. This is only done
the first time the stretch cluster is configured. In future reconciles
we first check if the stretch cluster is already enabled before
enabling it again.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-12-09 16:37:24 -07:00
Travis Nielsen 6fff48fbf5 ceph: remove obsolete mon pod and retry variables
The mon timeouts and pod retries were removed back in v1.1,
this just removes some obsolete variables from the legacy
mon scheduling.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-12-09 11:26:18 -07:00
Travis Nielsen bfbae0e4fe ceph: reset maxMonId if mons were not started after canaries
The operator schedules all the mons at the same time, then
serially starts each of the mons. If the operator was restarted
or otherwise failed before all the mons were started, the next
reconcile will schedule new mons again and ignore the scheduling
that was already computed. Since the last mon running is always
expected to be in quorum, we can reset the maxMonId to be
the highest mon currently created.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-12-09 11:00:44 -07:00
Madhu Rajanna ece9efd978 ceph: add mgr caps for csi-rbd-node client
If the kernel doesnt support mapping of
rbd image with deep-flatten feature,cephcsi
need to flatten the rbd image first and than
map the image on the node.

cephcsi first tries to add a task to flatten
the rbd image if its receives any permission
error it will try to call rbd CLI command which
is a blocking call.
This commit adds mgr caps to the csi-rbd-node user
so that cephcsi will add flatten task and return
immediate error to the kubelet, let kubelet retry
again,If we go with blocking rbd CLI call we may
end up having stale maps on the node in corner cases.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-12-08 17:09:18 +05:30
Travis Nielsen f46097db63 Merge pull request #6761 from travisn/arbiter-placement
ceph: Allow arbiter to have separate placement from other mons
2020-12-07 12:21:15 -07:00