Commit Graph
1019 Commits
Author SHA1 Message Date
Sébastien Han fc27fbdff5 Merge pull request #3409 from noahdesu/pvc-binding-size-suffix
ceph: adjust M-to-Mi rounding in PV creation
2019-07-09 09:38:04 +02:00
Noah Watkins e7ae2b6abd ceph: adjust M-to-Mi rounding in PV creation
Example of failure scenarios:

   - requested PVC 500M = 500,000,000 bytes
   - PV is created as:
        (500M / 2**20)Mi = "476"Mi
        But 476Mi = 476 * 2**20 = 499122176 < 500M

From the k8s documentation:

   Claims will remain unbound indefinitely if a matching volume does not
   exist. Claims will be bound as matching volumes become available. For
   example, a cluster provisioned with many 50Gi PVs would not match a
   PVC requesting 100Gi. The PVC can be bound when a 100Gi PV is added
   to the cluster.

which is inline with the behavior observed in which a 500M PVC is never
bound. However, the documentation also states:

   If a PV was dynamically provisioned for a new PVC, the loop will
   always bind that PV to the PVC. Otherwise, the user will always get
   at least what they asked for

which suggests that an _explicit_ binding can be created, and perhaps
something has changed with respect to this binding that has caused the
failures in newer versions of k8s.

fixes: #3391
fixes: #2922

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-07-08 10:20:03 -07:00
Umanga Chapagain 732f3030d0 integrate prometheus based monitoring with rook-ceph
> add new field to cluster spec
> deploy servicemonitor
> deploy prometheusRule

Signed-off-by: Umanga Chapagain <chapagainumanga@gmail.com>
2019-07-08 11:40:17 +05:30
Dmitry Yusupov 1f1f58ac1e Merge pull request #3375 from dyusupov/master
support for rook Device.FullPath
2019-07-05 07:40:47 -07:00
Sébastien Han 05c9b0253e Merge pull request #3388 from leseb/panic-cr-update
ceph: controller: fix panic on cr update
2019-07-05 16:28:55 +02:00
Umanga Chapagain 25e4275082 Rook: Added NodeAffinity to agent and discovery daemon
Previously, Rook Agent and Discovery DaemonSet deployment didn't allow
adding nodeAffinity. This commit adds nodeAffinity spec to daemonSet
deployment, which can be configured through environment variables in
operator deployment yaml.

+ Support multiple LabelKey, each with multiple LabelValue
+ Support multiple LabelKey with no value

Signed-off-by: Umanga Chapagain <chapagainumanga@gmail.com>
2019-07-05 13:48:09 +05:30
Sébastien Han f183ad2bb1 ceph: controller: fix panic on cr update
If we are running a Ceph cluster that has an unsupported version and if
we have set allowUnsupported: false, a newly bootstrap operator will
fail to start. To fix this, the user will update the CR and set
allowUnsupported: true, however at this point clusterInfo hasn't been
initialized so the operator will panic because we were referencing a nil
pointer.

To fix this, we re-populate clusterInfo if necessary and things go
smoothly.

Closes: https://github.com/rook/rook/issues/3137
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-04 16:21:17 +02:00
Sébastien Han 6d62005472 ceph: osd: fix cli arg
Somehow during startup the arg got misinterpreted by ceph-osd and was
failing with:

2019-06-19 15:23:09.098967 I | exec: Running command: ceph-osd --foreground --id 0 --osd-uuid feceb7d7-3148-4a0d-af7a-753ba2f21a92 --conf /var/lib/rook/osd0/rook-ceph.config --cluster ceph --default-log-to-file false --ms-learn-addr-from-peer false
2019-06-19 15:23:09.135921 I | unrecognized arg false
failed to start osd. Failed to complete '': exit status 1.

Now we concatenate the whole flag to avoid that.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-04 16:19:57 +02:00
Dmitry Yusupov 5ffe2f037c support for rook Device.FullPath
Signed-off-by: Dmitry Yusupov <dmitry.yusupov@nexenta.com>
2019-07-03 23:06:58 -07:00
Kiefer Chang 7a4f5c9bda Ceph: fix error when creating monmap
Adjust keyring template because ceph-mon in Octopus fails to
parse keyring file which has leading indention.

Fixes: https://github.com/rook/rook/issues/3384
Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
2019-07-03 16:14:34 +08:00
Travis Nielsen 72afc709aa Merge pull request #3353 from sabbot/handle-crd-update
EdgeFS Rolling Upgrade support
2019-07-02 10:43:24 -06:00
Anton Skriptsov 8d0866b20e upgrade service's crds
Signed-off-by: Anton Skriptsov <sabbotagge@gmail.com>
2019-07-01 13:19:03 -07:00
travisn 9d7474467c set the fully qualified apiVersion for OwnerReferences
OwnerReferences are now created with the fully qualified apiVersion
such that the references will work properly on OpenShift.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-07-01 06:55:08 -06:00
travisn 8226d577f6 remove obsolete check for setting the resource ownerreferences
The check for whether to set the OwnerReferences is no longer
necessary. When passing the correct value to the apiVersion,
the OwnerReferences can be successfully set for OpenShift.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-07-01 06:55:07 -06:00
Blaine Gardner 004f795a79 Merge pull request #3326 from krig/rook-binary-location
ceph: Look for binaries on PATH if not found
2019-06-25 09:51:45 -06:00
Travis Nielsen e663624827 Merge pull request #3324 from Madhu-1/csiv1.1.0
update rook to use ceph-csi canary image
2019-06-25 08:24:21 -06:00
Sébastien Han bc50971b75 Merge pull request #3268 from noobaa/guy-init-context
Refactor operator context init and allow to run local
2019-06-25 14:20:42 +02:00
Madhu Rajanna 71f369303e update rook to use ceph-csi canary version
ceph-csi canary version is close to ceph-csi v1.1.0
release

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-06-25 17:15:46 +05:30
Alexander Trost 9b7eff4ab2 Merge pull request #3321 from phantooom/rui.zou/fix-3141
Minio: throw validatefunc err msg
2019-06-24 18:39:27 +02:00
Sébastien Han d3845e7f75 ceph: stop enforcing crush tunable
This requirement is long gone and was reported in 2017. Clients should
have been updated by then, so there is no reason to set the CRUSH
tunable to such an old client. Actually, we should let Ceph run its own
tunable. They can always be changed later. Also, this was really
restrictive and applied on every orchestration and thus would override
any other config done by an administrator. Even worse, this will trigger
data movement back and forth...

Closes: https://github.com/rook/rook/issues/3138
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-06-24 09:47:32 +02:00
Kristoffer Grönlund b3ba6b40fd ceph: Look for binaries on PATH if not found
Similarly to #2675, try to find the rook binary
on PATH in case it isn't found in /usr/local/bin/rook.

Distributions generally disallow installing files
into /usr/local, as it is reserved for non-system
installations by the FHS.

Signed-off-by: Kristoffer Grönlund <kgronlund@suse.com>
2019-06-21 19:15:56 +02:00
Guy Margalit 2ce2382676 Refactor operator context init and allow to run local
Signed-off-by: Guy Margalit <guymguym@gmail.com>
Co-Authored-By: Sébastien Han <seb@redhat.com>
Co-Authored-By: Travis Nielsen <tnielsen@redhat.com>

This change is meant to allow running operators locally on a developer machine.
The idea is to allow faster development cycles by reducing the time and complexity of building -> deploying -> debugging on cluster.

For operators that rely only on kubernetes API this works easily - see cockroachdb and minio examples in development-flow doc.

The change includes:

- rook.NewContext() - Refactored to remove repeating initialization code that was copy-pasted in most of the operators in order to create the clusterd.Context and the Clientsets. Also it detects the mode of working in-cluster vs external and sets up the external mode with standard user config (~/.kube/config) and a job executor.
- rook.GetOperatorImage() - Refactor this repeating code in many operators to detect the operator pod image. Also added a global flag --operator-image that developers can use to override this when running locally.
- rook.TerminateOnError() - Added a convenient function.
2019-06-19 20:47:55 +03:00
xiaorui.zou 0ab2309911 Minio: throw validatefunc err msg
Signed-off-by: xiaorui.zou <xiaorui.zou@gmail.com>
2019-06-19 16:08:35 +08:00
Travis Nielsen 818ad9c7ca Merge pull request #2939 from travisn/delay-system-daemons
Delay starting the Rook system daemons until a CephCluster CR is created
2019-06-18 16:52:12 -06:00
Travis Nielsen 1d35f26302 Merge pull request #3313 from leseb/osd-sdn
ceph: osd: fix startup on sdn
2019-06-18 16:13:52 -06:00
Travis Nielsen 9df4b24197 Merge pull request #3117 from rohan47/osd_marked_out
Clean up the OSD after the OSD is marked "out"
2019-06-18 08:13:35 -06:00
Sébastien Han b2f2ff6b9d ceph: osd: fix startup on sdn
This commit adds a new flag to the osd startup so that on msgr2 (default
on Nautilus and above) the osd is able to find the IP address in the
container to bind to.

This requires this Ceph patch https://github.com/ceph/ceph/pull/28589
and is already present in Octopus.

Closes: https://github.com/rook/rook/issues/3140
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-06-18 10:19:19 +02:00
travisn c6c4a9b42a ceph: delay starting the system daemons until a cluster is created
When the operator first starts, the only operation needed
is to watch for new cephcluster crds to be created and
start the discovery to find available devices. The flexvolume
agent, the csi driver, and the volume provisioning can all be delayed
starting until the first cluster is created.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-06-17 15:44:33 -06:00
Travis Nielsen 8da2221296 Merge pull request #3283 from leseb/rgw-refactor
ceph: refactor rgw bootstrap
2019-06-14 15:17:58 -06:00
Travis Nielsen 488fe64815 Merge pull request #3281 from phantooom/master
Fix onDelete func panic
2019-06-14 11:59:35 -06:00
rohan47 a420db69fe osd: Clean the osds that are out and safe-to-destroy
- When an osd is marked out, and it is safe to be destroyed then delete the osds deployment.
- Removed osdGracePeriod
- Updated unit tests to test osd marked out action

Signed-off-by: rohan47 <rohgupta@redhat.com>
2019-06-14 22:50:33 +05:30
Sébastien Han 93b2448619 ceph: refactor rgw bootstrap
This commit does multiple things:

* remove support for AllNodes where we would deploy one rgw per node on
all the nodes.
* a transition path is implemented in the code so that if someone has an
existing deployment, daemonsets will be removed and replaced by an
deployments.
* when using "instances", each rgw deployed has its own key which makes
Ceph reporting the exact number of rgw running, see:

```
[root@rook-ceph-operator-775cf575c5-bh4sr /]# ceph -s
  cluster:
    id:     611fcf39-0669-4864-9a12-debb35c0397a
    health: HEALTH_OK

  services:
    mon: 3 daemons, quorum a,b,c (age 12h)
    mgr: a(active, since 12h)
    osd: 3 osds: 3 up (since 12h), 3 in (since 12h)
    rgw: 3 daemons active (my.store.a, my.store.b, my.store.c)

  data:
    pools:   6 pools, 600 pgs
    objects: 235 objects, 3.8 KiB
    usage:   3.0 GiB used, 84 GiB / 87 GiB avail
    pgs:     600 active+clean
```

Closes: https://github.com/rook/rook/issues/2474, https://github.com/rook/rook/issues/2957 and https://github.com/rook/rook/issues/3245
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-06-14 17:55:15 +02:00
John Mulligan 431f504cd4 ceph: create and maintain a config map for ceph csi to consume
Create and maintain a config map that meets the requirements of
the ceph csi such that Rook can maintain the contents of config
map with up-to-date mon information to be used later by csi.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-06-14 10:45:41 -04:00
Sébastien Han f6f1aa772f rgw: remove legacy code
This code can be removed since 1.0 shipped.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-06-14 16:28:17 +02:00
Sébastien Han cba9a359a0 ceph: upgrade apply osd nautilus flag
When OSDs are running on Nautilus we always disable old osd features and
aplpy the onces for Nautilus as described in the upgrade doc.
During an upgrade or the next time an orchestration will be called the
command will be applied. The command is idempotent so we can run it each
time.
This can be backported for 1.0.3

Closes: https://github.com/rook/rook/issues/2960
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-06-13 22:15:15 +02:00
xiaorui.zou b3cd67f871 Fix onDelete func panic
onDelete obj in some case will return DeletedFinalStateUnknown type, we need use assert.

Signed-off-by: xiaorui.zou <xiaorui.zou@gmail.com>
2019-06-13 09:31:53 +08:00
Ashish Ranjan 5a19ab9545 ceph: enhance server to search for rookflex
Signed-off-by: Ashish Ranjan <ashishranjan738@gmail.com>

This commit enables server to search for `rookflex` binary instead of assuming it to be present in `/usr/local/bin/`.

Fixes: https://github.com/rook/rook/issues/2486
2019-06-12 23:36:09 +05:30
Sébastien Han 0317de9096 rgw: change default frontend on nautilus
As per: ceph/ceph#26599, Beast is now the
default fronted for rados gateway.
Newly created cluster as of Nautilus will use it by default.

Re-added version of 03587352d5
Resolves: #2707
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-06-07 23:10:11 +02:00
Travis Nielsen f2c49ea034 Merge pull request #3165 from d-luu/resource_comparer
ceph: added comparer for resource quantity when checking cluster changes
2019-06-07 11:15:33 -07:00
Travis Nielsen 40ea3e65a2 Merge pull request #3274 from dyusupov/master
Enable proper usage of metadataOnly property
2019-06-07 10:45:03 -07:00
Sébastien Han 6438d9907e ceph: retry on detecting ceph version
Sometime the kube engine needs a bit of time to return the logs of a
given job and fails to read the stream.
Retrying up to detect the Ceph version seems reasonnable to
overcome this issue.

Fixes: https://github.com/rook/rook/issues/3227
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-06-07 18:13:38 +02:00
Travis Nielsen 6d1ccadd4b Merge pull request #3256 from noahdesu/device-hotplug-update
discover: handle false-positives observed by users
2019-06-07 08:55:00 -07:00
Travis Nielsen c0276802f5 Merge pull request #2564 from travisn/toplevel-fsgroup
Set fsgroup on the top level of the mount
2019-06-07 08:53:59 -07:00
Noah Watkins 3966f163ed discover: handle false-positives observed by users
the only exception to a naive device list comparison had been to ignore
drive UUID information which was unreliable when a device wasn't
formatted / partitioned. however various users have reported different
type of false positives that resulted in orchestration being run
continuously due to the wrong observation that devices were changing.

this patch fixes the cases we have observed and attempts to be slightly
more conservative in the calculation.

1. the devlinks is ignored. when a device is setup for lvm, for example,
the devlinks will be updated with different paths that point to the
device in addition to its standard paths addressable by pci address.

2. in the lvm case, the "model" field and "filesystem" field may also
change.

3. we ignore devices with devlinks that contain "usb" to avoid issues
when using usb drives.

4. be smart about detecting device availability. if a device transitions
from a non-empty (or has-partitions) state to an empty (or unpartitioned)
state then orchestration is triggered. this like observing that a device
is now available (e.g. in the allDevices case). however, when a device
transistions from empty to non-empty, then this is ignored as while it
is a change, it's generally a change associated with the new consumption
of the device.

fixes: #3059
fixes: #3185
fixes: #3131

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-06-07 08:22:08 -07:00
Sébastien Han d3c8d5612b ceph: add resource limit check for rbdmirror
The memory check was missing and will be trigger if resources limit are
configured for the rbdmirror pod.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-06-07 15:06:16 +02:00
Sébastien Han 24abbddf14 ceph: fix pod memory check
This commit fixes the second test case where limit and request are
either identical or different but still we use limit as a value.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-06-07 15:06:16 +02:00
Dmitry Yusupov 41d92cee3e enable proper values for metadataOnly property
Signed-off-by: Dmitry Yusupov <dmitry.yusupov@nexenta.com>
2019-06-06 21:12:04 -07:00
travisn fd341ae928 ceph: set the fsgroup only on the top level of the mount
If setting the fsgroup recursively on a shared filesystem mount is
not desirable, the fsgroup capability on the flex driver
should first be disabled in the operator env vars. Now the driver
will apply the fsgroup only at the top level instead of
recursively for the entire shared filesystem.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-06-06 17:17:29 -07:00
DL186038 d22886da37 ceph: added resource quantity comparer when checking cluster changes
the resource struct has non-exportable fields which panics when
doing the diff comparison

Signed-off-by: d-luu <david@davidluu.info>
2019-06-06 15:39:50 -05:00
rohan47 a380ca7dc1 fixed ceph pg dump pgs_brief json deserialization
Signed-off-by: rohan47 <rohgupta@redhat.com>
2019-06-06 21:54:37 +05:30