Commit Graph
5036 Commits
Author SHA1 Message Date
Blaine Gardner af822018e3 ceph: osd: filestore: fix filename too long error
Add osd-max-object-{name,namespace}-len flags to filestore OSDs to avoid
`ERROR: osd init failed: (36) File name too long` errors.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-12-09 10:41:54 -07:00
Sébastien Han 80ba8ab2ad ceph: change cep-nfs pid location
Let's put the PID under the directory owned by ganesha.

Closes: https://github.com/rook/rook/issues/3525
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-12-09 18:21:37 +01:00
Sébastien Han 5ce2ed220e ceph: use "github.com/pkg/errors"
We now use the error package.
Kubernetes errors have been renamed kerrors since they are lower than
'errors'.

Closes: https://github.com/rook/rook/issues/4054
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-12-09 16:58:32 +01:00
Sébastien Han 04ad1636c8 ceph: reject ceph dm devices
Since https://github.com/rook/rook/pull/4219, lv devices are now
presented to ceph-volume when preparing the device.
So on this initial run, this won't fail because the dm hasn't been
created yet but if an orchestration is re-triggered, the prepare pod
ensures idempotency with the ceph-volume batch command.
Unfortunately, c-v seems to have a bug where it doesn't read the dm to
detect whether or not they are ceph members already.
Ceph bug: https://tracker.ceph.com/issues/43209

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-12-09 16:17:26 +01:00
Travis Nielsen 6a66e010ad Merge pull request #4445 from travisn/continue-on-node-missing
Continue orchestration on missing node for osd
2019-12-09 08:05:36 -07:00
Mateusz Los 0daec4a7d6 ceph: change rgw client prefix
add rgw prefix to objectstore user

Signed-off-by: Mateusz Los <los.mateusz@gmail.com>
2019-12-09 12:49:24 +01:00
Mateusz Los 50f3d29cf4 ceph: client controller tests and docs
ceph client CRD refactoring
Add info about client crd to documentation
Add tests for client controller CRD

Signed-off-by: Mateusz Los <los.mateusz@gmail.com>
2019-12-09 12:48:44 +01:00
Mateusz Gozdek 65fd8ece2a ceph: Create initial client controller code
Create initial client controller code

Signed-off-by: Mateusz Los <los.mateusz@gmail.com>
2019-12-08 16:47:57 +01:00
Travis Nielsen 618028d2cd ceph: continue orchestration on missing node for osd
When a node has been removed, cordoned, or is otherwise
missing from the filters that rook uses to evaluate deploying
osds on nodes, the orchestration should continue instead
of failing. Otherwise, the orchestration will stay stuck
in a retry loop if any nodes are cordoned or removed in
the middle of an orchestration.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2019-12-06 15:48:19 -07:00
Sergey Kaydalov b6b95d44ed edgefs: payloads on an S3 service
Added support for data chunk forwarding to an external S3 service

Signed-off-by: Sergey Kaydalov <kayserg@gmail.com>
2019-12-06 19:16:43 +02:00
dulltzandSatoru Takeuchi dfe45ac6b0 ceph: support OSD on PVC backed by LV
"OSD on PVC" doesn't work for PV backed by LV. Fixing this problem
by the following changes.

- Rook accepts LVM disk type.
- If a LV-backed device is passed, Rook/Ceph invokes
  "ceph-volume lvm prepare" with "--data vg/lv"
  instead of "--data /path/to/device".
- If a LV-backed device is passed, Rook/Ceph suppresses
  activation/deactivation of VG that owns this LV.

Fixes: https://github.com/rook/rook/issues/4185
Signed-off-by: dulltz <isrgnoe@gmail.com>
Co-authored-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2019-12-05 17:26:27 +00:00
Sébastien Han e108f87b06 Merge pull request #4386 from leseb/location-prepare
ceph: do not restart the osds when upgrading the operator
2019-12-05 16:59:33 +01:00
Travis Nielsen 0a352f64d9 Merge pull request #4285 from cybozu-go/use-mapper-name
ceph: support device selection for OSDs by device path name patterns
2019-12-05 07:54:07 -07:00
Sébastien Han 470798c570 ceph: osd stop using rook binary and tini
This patch removes the need of using both tini and rook binary to run
the main osd container.
By removing this, we know can upgrade the operator image without
restarting the OSD since the osd pod does not use the rook image
anymore.
This patch only works when not running OSD on PVC since they are certain
actions that we cannot achieve with an init container.
A new init container has been introduced to do the activation of the
OSD, the activate files are placed in a empty dir mount and shared with
the main osd process.
Now the main osd process runs the ceph-osd daemon binary directly.

This currently has a few limitation:

* only works with bluestore OSDs
* only works when not running OSD on PVC

Closes: https://github.com/rook/rook/issues/4363
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-12-05 14:39:51 +01:00
Kazuhito MATSUDA 40d868ebd7 ceph: support device selection for OSDs by device path name patterns
Add devicePathFilter to Storage Selection Settings which enables
device selection with a regular expression for device path names.

Fixes: https://github.com/rook/rook/issues/4275
Signed-off-by: Kazuhito MATSUDA <kazuto.jinnai@gmail.com>
2019-12-05 07:02:44 +00:00
Travis Nielsen ab69d75cf2 Merge pull request #4354 from egafford/cleanup-csi-resources
ceph: clean up CSI resources on cluster deletion
2019-12-04 20:00:39 -07:00
Travis Nielsen 5b8eb3c18e Merge pull request #4396 from leseb/ganesha-pid
ceph: openshift ganesha fixes
2019-12-04 17:40:09 -07:00
Sébastien Han 4a7258eb0d ceph: osd pass crush location from prepare pod
We shouldn't need to compute the location from the main OSD pod, since
the prepare pod runs on the same node we can populate the crush location
information from that pod and pass it along to the main osd container.

This is an initial commit that aims to eventually remove the need of
using the rook binary when running the main osd container.

Closes: https://github.com/rook/rook/issues/4362
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-12-04 23:03:02 +01:00
Kazuhito MATSUDA 05ac9489b3 ceph: use /dev/mapper/<name> for ceph-volume instead of /dev/md-x
`ceph-volume` cannot handle a device correctly if the device has an alias
under `/dev/mapper/`.
This commit fixes it by checking whether the device has that kind of alias
and using the alias as an argument for `ceph-volume`.

Signed-off-by: Kazuhito MATSUDA <kazuto.jinnai@gmail.com>
2019-12-04 12:53:50 +00:00
Sébastien Han ad18158f81 ceph: revert "ceph: osd append instead of replace"
This reverts commit 7553318235.
The append puts the filter at the end of the file and it's out of any
lvm section, so it does not work anymore.

LVM complains with:

Configuration setting "filter" invalid. It's not part of any section.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-12-04 12:03:13 +01:00
Sébastien Han 12ebb8376e ceph: revert "ceph: add the missing newline in lvm.conf's filter configuration line"
This reverts commit eb908e8959.
See next commit for the reason of the revert.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-12-04 12:02:54 +01:00
Sébastien Han cdacb4d763 Merge pull request #4418 from travisn/osd-log-errors
Continue orchestration on osd update errors
2019-12-04 10:53:49 +01:00
Sébastien Han 0a01a60de9 Merge pull request #4398 from leseb/ceph-version-output
ceph: fix ceph version output
2019-12-04 08:20:57 +01:00
Travis Nielsen add3129c12 ceph: continue orchestration on osd update errors
During an orchestration if there were failures to update any OSD deployment,
the orchestration would fail and continue trying again. If the OSD(s)
continued failing, the operator would be stuck in a loop and never
respond to other CR updates.

Now the operator will log the OSD errors, if any, and complete the
orchestration. We will rely on K8s to continue to attempt to start
the OSD pods instead of the operator being stuck in the loop.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2019-12-03 19:16:48 -07:00
Travis Nielsen e76859b937 Merge pull request #4391 from rohantmp/crConfig
Ceph: Generate new client config for controller-runtime
2019-12-03 12:57:37 -07:00
Sébastien Han 8c38cc7e67 Merge pull request #4409 from Madhu-1/snapshot
CSI: Ability to disable snapshotter from ceph-csi rbd
2019-12-03 11:03:53 +01:00
Sébastien Han 9be06d91b2 Merge pull request #4399 from cybozu-go/ceph-fix-lvm-conf-broken-idempotence
ceph: add the missing newline in lvm.conf's filter configuration line
2019-12-03 09:35:17 +01:00
Madhu Rajanna 6a2c0bad86 CSI: Fix logging in csiDriver object creation
replcaed Info with Infof for proper driver name
logging.
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-12-03 13:27:59 +05:30
Madhu Rajanna cc418bce3b CSI: Ability to disable snapshotter from ceph-csi rbd
we need to set a ENV `CSI_RBD_ENABLE_SNAPSHOTTER`
variable to "false" in operator template to disable
deployment of snapshotter sidecar in ceph-csi rbd
provisioner.

Fixes: #4401
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-12-03 13:27:29 +05:30
Sébastien Han db614473c2 ceph: fix race condition on crd child update
We recently discovered a race condition which happens not to update the
child CRDs when CR image changes.

The race happens under the following sequence:

* orchestration onAdd() is called when the operator image restarts
or its image updated
* the orchestration then goes into processing mon/mgr/osd
* during this the cluster CR is updated so onUpdate() is called,
however, onAdd() is not done yet for child CRDs (mds, rgw)
* onUpdate() runs against the cluster CR and updates the cluster images
* by the time the child CRDs reached onUpdate() from their respective
ParentClusterChanged() methods, the image is already up to date
so we were exiting since our check for updating
these resources are based on the cluster image version

To fix this, we changed the comparison, but using isUpgrade instead and
slightly changed the way isUpgrade operates. So now, isUpgrade is true
even if the Ceph version is identical which allows us to verify whether
or not the image changed.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1775624
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-12-02 17:33:52 +01:00
Satoru Takeuchi eb908e8959 ceph: add the missing newline in lvm.conf's filter configuration line
lvmFilter doesn't contain a newline character. So when we will add more
lines after lvm.conf's filter configuration line, lvm.conf will corrupt.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2019-12-02 15:00:44 +00:00
Sébastien Han 09ac5823f6 ceph: fix ceph version output
We now print the build number.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-12-02 11:47:45 +01:00
Sébastien Han f335936140 ceph: nfs ganesha pid location
Let's use /var/run/ganesha directory to host the PID of the ganesha.nfsd
process instead of /var/run

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-12-02 10:08:08 +01:00
Sébastien Han df40a7c905 ceph: nfs add pod security for openshift
The container needs to be privileged so that it can have the right
access for OpenShift.

Closes: https://github.com/rook/rook/issues/3525
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-12-02 10:07:55 +01:00
Rohan CJ 3b5ee8b4c6 Ceph: Generate new client config for controller-runtime
Reusing the kubeconfig was resulting in concurrent access issues.

Signed-off-by: Rohan CJ <rohantmp@gmail.com>
2019-11-29 18:14:20 +05:30
Travis Nielsen a9252bab6e Merge pull request #4331 from leseb/use-mon-kv-config
ceph: rgw and mds use ceph mon config store
2019-11-26 18:06:44 -07:00
Travis Nielsen 6d58adeee8 Merge pull request #4373 from leseb/ceph-version-build
ceph: fix upgrade of mds/rgw on build release
2019-11-26 16:00:54 -07:00
Sébastien Han 6d8bb7e822 ceph: mds use ceph mon config store
The Ceph Mimic release introduced the monitor config store which allows
us to set configuration flag per daemon in a centralized fashion. Let's
use it for Mimic and newer and keep the CLI flag of daemon startup for
older versions.
The main benefit is that the config of a daemon can now be overridden.

Also, this commit refactors some code and add methods that are unit
tested.

Closes: https://github.com/rook/rook/issues/4307
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-11-26 23:21:26 +01:00
Sébastien Han 334827fb95 ceph: rgw use ceph mon config store
The Ceph Mimic release introduced the monitor config store which allows
us to set configuration flag per daemon in a centralized fashion. Let's
use it for Mimic and newer and keep the CLI flag of daemon startup for
older versions.
The main benefit is that the config of a daemon can now be overridden.

Closes: https://github.com/rook/rook/issues/4307
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-11-26 23:20:52 +01:00
Sébastien Han 9a33429ec1 ceph: fix array indexes for versions
The indexes were wrongly positionned and were pointing to the previous
one instead of the one that failed to be converted to an int.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-11-26 22:47:32 +01:00
Sébastien Han 2c8535d51c ceph: fix mds and rgw upgrade
Checking for isUpgrade is irrelevant since we need to restart the
deployment because the the spec has changed, the only thing that might
change is whether or not we perform upgrade checks.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1775624
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-11-26 22:47:14 +01:00
Sébastien Han 7fe410a747 ceph: add build version support
Rook now supports a build versions with a format of:

ceph version 14.2.4-64

Where -64 represents the 64th version of that package.
This is needed in order to properly detect upgrades.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-11-26 17:09:08 +01:00
Sébastien Han 929853b652 ceph: remove ROOK_VERSION from the mgr pod
Because of this, the mgr would be restarted if the operator image
change. This must not happen.
Added unit tests for cephMgrOrchestratorModuleEnvs() as well.

Closes: https://github.com/rook/rook/issues/4361
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-11-26 15:40:36 +01:00
Sébastien Han 088548a7f3 Merge pull request #4360 from travisn/upgrade-log-msg
Clarify log message for Ceph upgrades
2019-11-25 23:31:53 -08:00
Travis Nielsen a376263d8d Merge pull request #4344 from leseb/crash-priv
ceph: add missing pod sec context for crash
2019-11-25 10:27:39 -07:00
Travis Nielsen 87e2b09453 ceph: clarify log message for Ceph upgrades
Some log messages indicate when the upgrade checks will be
performed. If the Ceph image hasn't changed, the upgrade checks
are skipped. The messages were confusing if running a Rook
upgrade.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2019-11-22 09:03:03 -07:00
Elise Gafford 32e5d09336 ceph: remove CSI resources on deletion of last cluster
We create CSI resources when we create the first Ceph cluster.
This change deletes all CSI resources when we delete the last Ceph
cluster.

Partially resolves: #4234
Signed-off-by: Elise Gafford <egafford@redhat.com>
2019-11-22 10:33:39 -05:00
Blaine Gardner e947187dd4 Merge pull request #4352 from Madhu-1/csi-v1.2.2
CSI: update ceph-csi from v1.2.1 to v1.2.2
2019-11-21 14:57:08 -07:00
Elise Gafford 3adcb67755 ceph: add removeCallbacks hook to Operator and ClusterController
In order to remove Ceph-CSI resources after deletion of the last
Ceph cluster, the operator must be able to perform post-processing
actions on cluster deletion. This change creates a hook for the
addition of post-deletion operator callback functions.

Partially resolves: #4234
Signed-off-by: Elise Gafford <egafford@redhat.com>
2019-11-21 11:11:25 -05:00
Elise Gafford 35336bc03f ceph: add ownerRefs to CSI resources
In order to facilitate the deletion of CSI resources, this patch
adds ownerReferences to all CSI deployments, daemonsets, and
services. This ownerRef refers to the CSI ConfigMap in all cases.

Partially resolves #4234
Signed-off-by: Elise Gafford <egafford@redhat.com>
2019-11-21 11:07:25 -05:00