Commit Graph
105 Commits
Author SHA1 Message Date
travisn a29b876337 rename ceph v1 crds with the ceph prefix
Signed-off-by: travisn <tnielsen@redhat.com>
2018-12-05 16:23:55 -07:00
travisn 62f7e5d6ea ceph: update docs, code, and tests to use v1 crd types
Signed-off-by: travisn <tnielsen@redhat.com>
2018-12-05 14:33:11 -07:00
Alexander Trost 18b2da5fc5 Merge pull request #2216 from galexrt/fix_2164
Allow specifying custom Ceph user and secret name for mounting
2018-12-04 23:54:27 +01:00
Alexander Trost ac19f85fbb Allow specifying custom Ceph user and secret name for mounting
Introduce mount security mode for basic multi tenancy

Fixes #2164.

This adds three new parameters/options to StorageClass/flexvolume entry:
* `mountUser`
* `mountSecret`
* `mountSecretNamespace`

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2018-12-04 20:17:15 +01:00
Jeff Layton 9945e6c91b ceph mds: only permanently remove the fs if rook created it
i.e.: only if there was a data pool specified.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2018-12-01 20:40:12 -05:00
Jeff Layton 677efb1a37 ceph mds: lift setting of max active MDS out of CreateFilesystem
This seems a bit misplaced, since CreateFilesystem is all about
doing the initial setup of the filesystem, and the daemons are
managed in a different block of code.

In a later patch, we're going to want to allow the CRD to spin
up MDS' for filesystems that already exist. Lift the code that
sets the MDS count into the caller.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2018-12-01 07:32:46 -05:00
Travis Nielsen b239397033 Merge pull request #2293 from travisn/clean-pg-status
Cluster is clean if PGs are scrubbing
2018-11-27 17:31:14 -07:00
Alexander Trost b12d1e82cf Use truncated node name "everywhere"
Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2018-11-23 10:02:35 +01:00
travisn 232e65f934 cluster is clean if PGs are scrubbing
Signed-off-by: travisn <tnielsen@redhat.com>
2018-11-20 17:01:46 -07:00
Travis Nielsen 12e6cd941d Merge pull request #2257 from lbogdan/fix/rbd-info
ceph: use "rbd info" to get image info after creating it
2018-11-20 13:11:09 -07:00
Andrey Laguta c247e8c0f7 Add urlPrefix setting for ceph dashboard
Signed-off-by: Andrey Laguta <13280256+laevilgenius@users.noreply.github.com>
2018-11-06 02:58:47 +02:00
Bogdan Luca 93e4e8ddcb ceph: use "rbd info" to get image info after creating it
Signed-off-by: Bogdan Luca <luca.bogdan@gmail.com>
2018-11-03 17:19:18 +02:00
travisn 39117a7a0b mgr: configure a self-signed cert and admin user for the dashboard
Signed-off-by: travisn <tnielsen@redhat.com>
2018-11-01 11:49:36 -06:00
Travis Nielsen bf2759e317 Merge pull request #2247 from SUSE/ceph-err-to-stderr
ceph: log to stderr - fix #2239
2018-10-30 08:39:49 -06:00
Blaine Gardner 7454ae38e4 ceph: log to stderr - fix #2239
Fixes #2239

Set Ceph logging to `/dev/stderr`, and run rgw setup commands without
combined output so that logging (no on stderr) isn't captured as part of
the result of commands.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2018-10-29 13:59:22 -06:00
travisn 6d04ed325b periodically refresh the flex drivers
Signed-off-by: travisn <tnielsen@redhat.com>
2018-10-29 12:49:47 -06:00
travisn b02cd099f1 mons: allow scaling up or down the size of quorum
Signed-off-by: travisn <tnielsen@redhat.com>
2018-10-17 11:00:05 -06:00
Travis Nielsen a69396af5b Merge pull request #2222 from travisn/discover-devices-interval
Reduce frequency of device discovery
2018-10-17 10:57:48 -06:00
travisn 01dc5656f3 reduce frequency of device discovery
Signed-off-by: travisn <tnielsen@redhat.com>
2018-10-17 09:56:47 -06:00
Angus Lees 9c95ed5f6f Don't misinterpret command output as string format
Previous code tried to interpret the string output as a `fmt.Sprintf`
string formatter, mangling `%` into `%!(MISSING)`, etc.

Thanks to go, I don't belive these are exploitable (unlike the similar
error in C).

Since this seemed to be a common error in the codebase, I did a quick
audit by visually inspecting the results of `git grep 'f([^"]'`.  I
don't have a good suggestion for automated tests to prevent this in
future :(

Example error (look for `(MISSING)`):
```
E0927 05:31:07.618429   11227 driver-call.go:237] Failed to unmarshal output for command: unmount, output: "2018-09-27 05:31:07.191711 I | exec: Running command: df --type ceph /var/lib/kubelet/pods/95461479-c216-11e8-bcf0-02030782ac80/volumes/ceph.rook.io~rook/oe-scratch\n2018-09-27 05:46:43.808596 I | Filesystem                                                 1K-blocks     Used Available Use%!M(MISSING)ounted on\n2018-09-27 05:46:43.808659 I | 10.107.25.147:6790,10.109.173.79:6790,10.104.85.255:6790:/ 151678976 49410048 102268928  33%!/(MISSING)var/lib/kubelet/pods/95461479-c216-11e8-bcf0-02030782ac80/volumes/ceph.rook.io~rook/oe-scratch\n{\"status\":\"Success\"}\n", error: invalid character '-' after top-level value
```

Signed-off-by: Angus Lees <gus@inodes.org>
2018-10-15 15:59:13 +11:00
Blaine Gardner 96f9a9c4ad ceph mds: allow mds deployment scale-down
fix #2193

Fix regression introduced by PR allowing MDS config creation in init
container. This allows the new deployment-based mds clusters to scale
down where currently they can only remain constant or scale up.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2018-10-12 14:53:08 -06:00
travisn b43f0056ed rgw: generate config in init container
Signed-off-by: travisn <tnielsen@redhat.com>
2018-10-09 21:43:24 -06:00
Blaine Gardner ce803fbf9d Ceph mds/file: Set up config in init container
Progress toward issue #2003.
Includes design from design doc PR #1578

Use init containers to create configuration for Ceph mgrs. There is only
one init container in this design. The init container calls the Rook
binary to create Ceph config files which are then shared with the mds
daemon main container.

Once this init is run, the main mds daemon is run. Leaving room to use
the Ceph-versioned image in the future, call `ceph-mds --foreground ...`
to run the Ceph mds.

The refactor to using an init container also necessitated refactoring
the mdses replicaset implementation to a deployment-per-pod
implementation due to a chicken-egg problem. With a single container (in
the before times) the Rook binary was able to call the ceph-mds daemon
with an id generated from the pod name. Since the pod name is not known
before runtime, and the id is one of the few params that must be
specified to Ceph daemons on run, it is necessary to know the id
beforehand; thus the move to a deployment architecture following the
likes of the mon and mgr daemons.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2018-10-05 19:01:12 -06:00
travisn 15f6ee5b14 osd: enable filestore on device scenario to run with ceph image
update osd specs to be consistent with other daemons

Signed-off-by: travisn <tnielsen@redhat.com>
2018-09-26 10:36:16 -06:00
travisn 9416fa8c65 update client-go to 1.11.3
Signed-off-by: travisn <tnielsen@redhat.com>
2018-09-21 15:39:29 -06:00
Blaine Gardner ca71b7a311 Ceph mgr: Set up config in init container
Progress toward issue #2003.
Includes design from design doc PR #1578

Use init containers to create configuration for Ceph mgrs. There is only
1 init container in this design:
 1. Using the Rook image, call the Rook binary to create Ceph config
files shared with the mgr daemgr container.

Once this init is run, the main mgr daemgr is run. Leaving room to use
the Ceph-versioned image in the future, call `ceph-mgr --foreground ...`
to run the Ceph mgr.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2018-09-21 13:11:08 -06:00
Blaine Gardner 78c2cec1ad Add k8s volume/mount tests to operator test pkg
Add functions for helping test Kubernetes volumes and volume mounts.

- Create functions for testing the existence of volumes/mounts by
name in a list of vols/mounts without needing to know the index of
the vol/mount in the list.

- Create functions for printing vols/mounts in a human-readable format
so that tests may output more useful errors.

- Create a test definition for ensuring that all the volumes a pod
provides and all the mounts from each pod container match. For each
volume, there must be at least one container which mounts the volume,
and for each mount, there must be a source volume.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2018-09-21 09:58:31 -06:00
Blaine Gardner 655692e845 Ceph mon: Set up config in init containers
Progress toward issue #2003.
Includes design from design doc PR #1578

Use init containers to create configuration for Ceph mons. There are 3
init containers in this design:
 1. Using the Rook image, call the Rook binary to create Ceph config
files ultimately stored in a k8s EmptyDir which is shared between all
containers in a mon pod.
 2. Leaving room to use the Ceph-versioned image in the future, call
`monmaptool` to generate the monmap, stored in a shared config dir.
 3. Leaving room to use the Ceph-versioned image in the future, call
`ceph-mon --mkfs ...` to set up the mon filesystem on the host's disk.

Once this init is run, the main mon daemon is run. Leaving room to use
the Ceph-versioned image in the future, call `ceph-mon --foreground ...`
to run the Ceph mon.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2018-09-12 17:56:08 -06:00
Ganesh Maharaj Mahalingam b8c7e151bc use return error code instead
Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
2018-09-08 15:23:28 -07:00
Ganesh Maharaj Mahalingam ff9230a10f PVC create resiliency
While creating a PVC, if the operator dies between successfully creating a rbd
image and associating it with a PV, that PVC will never be completed. A
restarted operator will also fail to complete the task as the requested rbd
image already exists. With the assumption that a PVC UID will always be unique,
this patch will try to use the existing volume and complete the PVC request.

Resolves: #2072

Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
2018-09-07 15:34:59 -07:00
Blaine Gardner 3731f06176 Ceph: Refactor mon config/keyring to cephconfig
Create a cephconfig module in Ceph's daemon pkg source, and refactor the
config and keyring generation that exists in the mon package into the
new cephconfig package. The config/keyring generation code is used by
most all daemons and not just mon, so a new package is a more
appropriate place for this.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2018-09-05 10:17:11 -06:00
travisn f840e3574e mon: start a deployment instead of replicaset
Signed-off-by: travisn <tnielsen@redhat.com>
2018-09-01 00:12:42 -06:00
travisn 5f01178e83 mon: set names based on chars instead of integers
Signed-off-by: travisn <tnielsen@redhat.com>
2018-08-30 22:18:53 -06:00
Dennis Chen 25086c01ad Roundup the size of the RBD volume image
Current code will truncate the generated RBD image in some cases,
this PR will round up the size to make sure the final RBD image
generated can cover all the required data space.

Also, corresponding unit test cases added to verify the change.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
2018-08-29 11:10:07 +08:00
travisn 1a86a8cb7b metered loading of flex drivers
Signed-off-by: travisn <tnielsen@redhat.com>
2018-08-24 13:28:57 -06:00
Alexander Trost 614fef7fce Merge pull request #2055 from arm64b/remove-unused-volume-mgr
Remove unused volume manager parameters
2018-08-24 16:40:40 +02:00
Dennis Chen 4a15529db5 Remove unused volume manager parameters
We don't use volume manager argument in NewClusterController()
and NewFlexvolumeServer() functions, so remove the unused volume
manager parameter from those functions.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
2018-08-22 09:49:02 +08:00
Alexander Trost 2080330539 Add dataPool parameter to StorageClass
This change allows block storage to use a given Ceph pool for it's data.

Fixes #1733

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2018-08-17 16:28:08 +02:00
Jared Watts 90fdea4ddd Merge pull request #1947 from arm64b/ceph-volmgr-err-handling
Enhancement of Ceph volume manager kmod detection
2018-08-09 06:25:32 -07:00
Travis Nielsen d331a3e6a4 Merge pull request #1999 from jcsp/wip-mds-caps
Fix client.admin's default MDS capabilities
2018-08-08 08:00:24 -06:00
John Spray 78a53870d1 Reduce mgr mon caps to "profile mgr"
This has been the correct style since luminous.  The
"allow *" version works fine but is more power than
needed.

Signed-off-by: John Spray <john.spray@redhat.com>
2018-08-07 12:53:18 +01:00
John Spray b6eab78d92 Grant mgr OSD and MDS caps
While the mgr can mostly do its job with just
mon caps, modules expect to also have access
to OSD and MDS daemons at will (e.g. for the dashboard
to display the MDS session list)

This change matches what other Ceph deployment tools do.

Signed-off-by: John Spray <john.spray@redhat.com>
2018-08-07 12:53:12 +01:00
John Spray a57434017d Fix client.admin's default MDS capabilities
Signed-off-by: John Spray <john.spray@redhat.com>
2018-08-07 12:46:29 +01:00
travisn 1d928ecd36 osd: init container to initialize config at startup
Signed-off-by: travisn <tnielsen@redhat.com>
2018-07-31 14:39:53 -06:00
Dennis Chen 9cfafaa0a7 Enhancement of Ceph volume manager kmod detection
Current Ceph volume manager code doesn't take the builtin
kernel module into the account, so the `modinfo` will fail
in this case. Also, we need to add error handling code to
make sure the volume manager does work when proceeding to
continue, otherwise we will encounter the `rbd` related issue
in the following step even we have an artificial `agent` pod
in running state.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
2018-07-31 16:56:40 +08:00
Blaine Gardner fe5fb394c7 Fix spellcheck and trailing space/newline issues
Fix some basic spellcheck errors. Also remove trailing spaces and make
sure files have a newline (my editor does automatically).

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2018-07-26 11:36:09 -06:00
Alexander Trost a7d002fe5c operator: Set min_size to dataChunkCount for ec pools
Resolves #1795

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2018-07-19 23:51:26 +02:00
Travis Nielsen 363e5ee58a Merge pull request #1892 from jcsp/wip-osd-remove-idempotent
Fix retry of OSD deletion
2018-07-17 15:47:00 -06:00
John Spray bed1d01e9c Fix retry of OSD deletion
Previously, if this failed mid-way it would then throw
an exception at the first operation when retrying (because it's
trying to reweight an OSD that might not be in the map any more)

Signed-off-by: John Spray <john.spray@redhat.com>
2018-07-17 14:08:23 +01:00
Huamin Chen ac2c949cae omit empty osd objectstore
Signed-off-by: Huamin Chen <hchen@redhat.com>
2018-07-11 17:25:10 -04:00