Commit Graph
214 Commits
Author SHA1 Message Date
Sébastien Han 0785962e09 ceph: update mon configmap for external cluster
With this change, the admin can specify a single mon and the operator
will add any other mons to both ClusterInfo and the configmap of mon
endpoints.

It will periodically check for changes too and update both ClusterInfo
and the configmap accordingly.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Sébastien Han 18bf541c00 ceph: remove redundant debug log
GetMonStatus is called by checkHealth in health.go and is already
printing GetMonStatus's response so there is no need to print it twice.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Sébastien Han 46cdf15936 ceph: config: apply the correct msgr2 prefix
External clusters might only listen on msgr2, so we must acknowledge
that and set the correct prefix to 'v2:' instead of 'v1:' on the
operator's ceph config file.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-08-22 17:19:33 +02:00
Travis Nielsen 27cad9d008 Merge pull request #3606 from sp98/sed_to_golang
Replace "sed" commands with native golang file handling
2019-08-19 12:03:43 -06:00
Santosh Pillai b1c9ad97ae replace "sed" commands with native golang file handling
- OSD backed by PVC required updating the lvm.conf file which was done by executing the 'sed' commands.
- This patch removes the 'sed' command and uses golang utlities to update the lvm.conf file.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2019-08-19 12:38:56 +05:30
Michael Vollman 46f8012268 ceph: fix per osd metadata support
When setting metadataDevice per OSD the check that c-v is properly using
the metadata device is failing because it is only looking at the global
md setting which is nil and not the per OSD setting.

Signed-off-by: Michael Vollman <michael.b.vollman@gmail.com>
2019-08-15 07:22:00 -04:00
Travis Nielsen 1591ba843e Merge pull request #3607 from obnoxxx/logic-flow-createReplicationCrushRule
ceph:pools: polish logic flow a bit in createReplicationCrushRule()
2019-08-13 13:22:21 -06:00
travisn 9c73bfc603 ceph mds: properly trim the daemon name
The daemon name always needs to have the prefix rook-ceph-mds-
removed from the deployment name in order to translate to the
daemon name. The daemon name is not dependent on the namespace.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-13 07:23:00 -06:00
travisn 9a3dc52a11 ceph: minimum version allowed is mimic 13.2.4
With the 1.1 release we should not be creating bluestore OSDs
with rook's legacy partitioning scheme. All new bluestore OSDs
should be created with ceph-volume. Therefore, the miminum
version allowed is a version of mimic supporting ceph-volume.

This commit also adds consistent version checking between
the Add and Update methods for the operator handling the
CR events.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-13 07:22:59 -06:00
Michael Adam 9c2c3c5d55 ceph:pools: polish logic flow a bit in createReplicationCrushRule()
This is not changing the behavior of the code but making the
flow of logic in the createReplicationCrushRule() function consistent
by removing an else branch. This was just a reflex when I was reading
the code.

Signed-off-by: Michael Adam <obnox@redhat.com>
2019-08-13 13:50:20 +02:00
rohan47andAshish Ranjan d2f52aebe5 Adds support for storageClassDeviceSet in rook-ceph operator
- Added code to support StorageClassDeviceSet spec provided in the cluster-on-pvc.yaml
- The code reads the StorageClassDeviceSet spec and creates pvc based on the ‘count’ field for each device set.
- OSD prepare job is started for each PVC which activates the ceph-volume on each PVC
- Finally OSD is started on each of the PVC device.

Co-authored-by: rohan47 <rohgupta@redhat.com>
Co-authored-by: Ashish Ranjan <aranjan@redhat.com>
Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2019-08-12 09:24:13 -06:00
Michael Vollman f3ef680298 ceph: Add support for per OSD metdataDevices
Add ceph-volume support for per OSD metdataDevices

Signed-off-by: Michael Vollman <michael.b.vollman@gmail.com>
2019-08-02 07:41:45 -04:00
Blaine Gardner 55a726fda9 ceph: osd use copy-binaries top level cmd
Replace usage of the custom osd copybins command with the new top-level
copy-binaries command introduced with cmd-reporter.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-07-29 09:23:45 -06:00
Blaine Gardner 6d2ef93669 Merge pull request #3443 from SUSE/nfs-refactor
Ceph NFS: use new config
2019-07-25 09:39:50 -06:00
Michael Vollman bd58df9d3b ceph: fail when metadataDevice not used by cephvol
fail when metadataDevice is specified but ceph-volume batch does not
automatically use the metadataDevice as the block.db. (#3092)

Signed-off-by: Michael Vollman <michael.b.vollman@gmail.com>
2019-07-23 07:23:51 -04:00
Blaine Gardner aa0d3346f2 ceph nfs: refactor to use new config pattern
Refactor the Ceph NFS (Ganesha) daemon to use the new config pattern.

Use of a custom Rook binary to run NFS has been removed in favor of
instead running the required DBUS process as a sidecar. The effect here
is that the NFS Ganesha container itself may fail and restart a few
times before the DBUS sidecar is running.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-07-22 11:06:04 -06:00
Sébastien Han 05d8d23f18 ceph: upgrade: pass daemonType and Name directly
We do not determine the daemon type and name by string parsing anymore
but passing that info directly in the update call, it's more reliable.
Also removing a bunch of unused functions.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-17 00:58:31 +02:00
Sébastien Han c24ae45eca ceph: upgrade, don't check osd if aio
If we detect all OSDs are running on the same host, we don't perform any
checks for upgrade.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-17 00:41:40 +02:00
Sébastien Han 7eb7e8a192 ceph: upgrade: always retrieve cluster version
Do not consider clusterInfo Ceph version since it's the one picked by
the spec image.
The CephVersion provided here needs to be the current running version
of Ceph for when it is later passed to OkToStop and checked with
IsAtLeast. If you are upgrading from a pre 14.2.1 version to a
version 14.2.1 or newer, IsAtLeast will incorrectly return true and
then fail trying to run mon ok-to-stop on a mon pod running a pre 14.2.1 version.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-17 00:39:18 +02:00
Sébastien Han bd7df53b18 ceph: refuse to upgrade an un-healthy cluster
If the cluster shows a state of HEALTH_ERR, Rook will refuse to upgrade
it if the image version changed.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-17 00:39:15 +02:00
Sébastien Han 9824bd2ff9 ceph: improve upgrade procedure
When a cluster is updated with a different image version, this triggers
a serialized restart of all the pods. Prior to this commit, no safety
check were performed and rook was hoping for the best outcome.

Now before doing restarting a daemon we check it can be restarted. Once
it's restarted we also check we can pursue with the rest of the
platform. For instance, with monitors we check that they are in quorum,
for OSD we check that PGs are clean and for MDS we make sure they are
 all active.

Fixes: https://github.com/rook/rook/issues/2889
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-17 00:37:43 +02:00
Blaine Gardner 5fc99a6266 Merge pull request #3369 from SUSE/cmd-reporter
Add cmd-reporter daemon; use it to get ceph version
2019-07-11 16:05:14 -06:00
Sébastien Han a4168fc8f8 Merge pull request #3414 from leseb/do-not-create-cm
ceph: stop creating initial crushmap
2019-07-09 09:39:15 +02:00
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
Sébastien Han 5a2cd41d25 ceph: keyring: stop using auid 0
This setting is long gone in Ceph and not used anymore, so let's not
create it for new cluster.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-08 12:11:05 +02:00
Sébastien Han ccf2110007 ceph: stop creating initial crushmap
This commit does:

* remove dead code SetCrushTunables()
* stop creating initial crushmap

There is no need to create an initial crushmap, since Ceph natively does
that for us.
We don't delete the existing configmap containing the initial crush map
of already deployed cluster, perhaps people are using for whatever
reason. It does not harm to keep it around.

Closes: https://github.com/rook/rook/issues/3138
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-08 12:07:46 +02:00
Blaine Gardner 5411fe4cde daemon: create new cmd-reporter daemon
cmd-reporter runs a command and puts the results of the command into a
ConfigMap defined by its `--config-map-name` commandline flag.
cmd-reporter is intended to be run as a Kubernetes job where an
operator needs to run a single command and get return information back
from the command which is more than just success/failure.

The ConfigMap returned includes `stdout`, `stderr`, and `retcode` data
from the command. The ConfigMap may be preexisting, in which case
cmd-reporter will overwrite the return information in the ConfigMap.
cmd-reporter labels the ConfigMap with `app=cmd-reporter`, and if the
ConfigMap already has an app label which is different, cmd-reporter
fails without modifying the ConfigMap so as not to overwrite another
application's data in the event of a ConfigMap name+namespace collision.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-07-05 12:03:58 -06: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
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
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
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 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
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
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
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
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
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
Santosh Pillai ec2e6ea888 use ceph fsid to filter ceph volume OSDs
- Updated getCephVolumeOSDs method to use fsid filter while retriving devices.
- This solves "failed to fetch mon config (--no-mon-config to skip)" error when multiple ceph clusters are running on same Node

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2019-06-05 12:05:56 +05:30
Alexander TrostandMaksim Nabokikh 1d004e5b4a ceph: add metrics for flexvolume driver (#3128)
ceph: add metrics for flexvolume driver

Co-authored-by: Maksim Nabokikh <maksim.nabokikh@flant.com>
2019-05-19 13:50:15 +02:00
Santosh Pillai 7d5afa29b8 added device class pool property
- Updated code to use deviceClass property when a pool is created for both "replicated" and "erasure code".
- Updated "ceph crush rule create-..." command to use "create-replicated" instead of "create-simple"
- Updated unit tests
- Updated (ceph-pool-crd.md) documentation to reflect the changes.
- Updated pending release notes.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2019-05-15 16:45:39 +05:30
Travis Nielsen 0a9b049e17 Merge pull request #3149 from mvollman/metadata-per-osd
ceph: provision OSDs with metadataDevice config
2019-05-10 14:21:03 -04:00
Michael Vollman a839527421 ceph: provision OSDs with metadataDevice config
provision OSDs with ceph-volume when metadtaDevice is set (#3108)
always print ceph-volume report before executing ceph-volume.

Signed-off-by: Michael Vollman <michael.b.vollman@gmail.com>
2019-05-10 11:47:15 -04:00
Maksim Nabokikh cb3b8168a0 ceph: add metrics for flexvolume driver
This allows to export persistent volume metrics.

Signed-off-by: Maksim Nabokikh <maksim.nabokikh@flant.com>
2019-05-07 18:11:42 +04:00
Noah Watkins e33eb98047 ceph: run self-signed cert creation with timeout
fixes: #2784

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-05-06 10:10:05 -07:00
Noah Watkins c2dbb93096 ceph: simplify the ceph command execution interface
this adds a structure to hold various settings related to executing ceph
cli commands, and introduces a common interface for configuring and
running such commands.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-05-06 10:10:05 -07:00
Kaushal M f48f73300f ceph: Check before copying binaries in osd pods
Before performing the copy, the OSD init container now checks
destination path exists. If the destination exists, it skips the copy.

The OSD pods copy the rook and tini binaries into a shared volume using
an init container. In restarting pods, this copy could fail with 'text
file busy'(ETXTBUSY), because the destination file in the shared volume
could be under execution. The restarting pods will enter a
'Init:CrashLoopBackOff' state after this, leaving the ceph cluster
degraded. Skipping the copy will allow the init containers to complete
successfully, allowing the pod to restart.

Fixes #2674.

Signed-off-by: Kaushal M <kshlmster@gmail.com>
2019-05-03 13:08:46 +05:30
travisn 7cdfcc395a write flex settings to config file instead of env vars
The flex settings cannot be passed to the driver with environment variables.
There is no context available for returning the flex settings except
that the flex driver will look in a config file in the same directory.
These settings must be valid or else the driver will return the default
settings.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-04-30 14:50:43 -06:00
travisn 20f6af8a4d remove obsolete flex driver version checks
The flex driver no longer needs to check whether a kubelet
restart is needed or whether the namespace-specific driver
can be supported. The copy of k8s 1.13 types can also
be removed since we have updated to a newer k8s client.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-04-30 14:50:33 -06:00