Commit Graph
327 Commits
Author SHA1 Message Date
Travis Nielsen 802549d33d Merge pull request #2226 from tsullens/nfs-validate-spec
nfs: update operator for spec validation
2018-11-01 19:36:08 -06:00
travisn 6cfd2ee11a port 7000 for the luminous dashboard and 8443 for mimic and above
Signed-off-by: travisn <tnielsen@redhat.com>
2018-11-01 11:49:37 -06:00
travisn 906add05ce consume the ceph images from the ceph/ceph repo
Signed-off-by: travisn <tnielsen@redhat.com>
2018-11-01 11:49:37 -06:00
travisn f5b09a5ca5 enable the orchestrator modules on nautilus
Signed-off-by: travisn <tnielsen@redhat.com>
2018-11-01 11:49:37 -06:00
travisn f2d59bedaa reject unsupported versions and allow overriding the version
Signed-off-by: travisn <tnielsen@redhat.com>
2018-11-01 11:49:37 -06:00
travisn 06a2461cac cleanup some errors in integration tests
Signed-off-by: travisn <tnielsen@redhat.com>
2018-11-01 11:49:36 -06:00
travisn b2a0dc77fa automatically detect the major version of the Ceph image
Signed-off-by: travisn <tnielsen@redhat.com>
2018-11-01 11:49:36 -06: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
travisn ceb47f260d set default ceph version to luminous
Signed-off-by: travisn <tnielsen@redhat.com>
2018-11-01 11:49:36 -06:00
travisn 94a7a0d4bc run daemons with the ceph image instead of rook
Signed-off-by: travisn <tnielsen@redhat.com>
2018-11-01 11:49:35 -06:00
tsullens c5bc090974 nfs: update operator for server spec validation
adding validation of NFSServerSpec and unit tests
in accordance with issues #2036 and #2037

Signed-off-by: tsullens <tsullens@mix.wvu.edu>
2018-10-30 19:41:17 -04: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
Travis Nielsen a2bbb67c0b Merge pull request #2211 from travisn/initialize-mons-on-restart
Allow mons to scale up or down
2018-10-17 21:48:25 -06:00
Travis Nielsen 224330764c Merge pull request #2190 from johnae/support-alternate-libmodules-dir
Support alternate libmodules dir
2018-10-17 15:22:06 -06:00
John Axel Eriksson dd7860fb8e Support additonal agent mounts and alternate lib/modules host path.
The background is that there are at least two distributions with very
different host fs layouts. Those would be NixOS and GNU Guix.

For example, on NixOS, /lib/modules does not exist, it can instead
be found at /run/current-system/kernel-modules/lib/modules where
/run/current-system/kernel-modules is a symlink into /nix/store.

Within the modules directory, again on NixOS, there are more links
into the /nix store.

So to support alternate host fs layouts it is now possible to specify
the lib/modules host path and in addition specify extra mounts.

Signed-off-by: John Axel Eriksson <john@insane.se>
2018-10-17 21:03:44 +02: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
travisn cfa0f43f61 check available nodes for mons only when necessary
Signed-off-by: travisn <tnielsen@redhat.com>
2018-10-17 10:59:43 -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
Travis Nielsen 0c32013739 Merge pull request #2210 from SUSE/ceph-mds-enable-downsizing
ceph mds: allow mds deployment scale-down
2018-10-13 07:45:39 -06: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
Jeff Layton 6bab32b6f9 Ensure that $ROOK_CLUSTER_NAME is set for mgr daemon
We need this environment variable in the main container, not the init
container, as it's used by the rook ceph-mgr module.

Also fix up the env var counts in the testcase.

Fixes: ca71b7a311 (Ceph mgr: Set up config in init container)
Signed-off-by: Jeff Layton <jlayton@redhat.com>
2018-10-11 12:46:36 -04:00
travisn b43f0056ed rgw: generate config in init container
Signed-off-by: travisn <tnielsen@redhat.com>
2018-10-09 21:43:24 -06:00
Travis Nielsen 7de9624e91 Merge pull request #2153 from SUSE/ceph-mds-use-init-container
Ceph mds/file: Set up config in init container
2018-10-08 11:24:14 -06:00
Alexander Trost 010c6747ab Fix MergeResourceRequirements() func
Resources are now correctly merged when "not set".

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2018-10-06 17:49:03 +02: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 7d97b6ad76 osd: use the node hostname labels instead of node names
Signed-off-by: travisn <tnielsen@redhat.com>
2018-10-01 08:09:06 -06:00
travisn 08f795f8b3 sanitize underscores in the volume name
Signed-off-by: travisn <tnielsen@redhat.com>
2018-09-26 10:36:36 -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
Noah Watkins e015a21cbd ceph: expose node,pod,ns names to ceph daemons
Ceph expects to be able to reason about physical hardware / nodes.
Before this patch the NODE_NAME that was available referred to the pod
name. This patch exposes the underlying node name, pod, and pod
namespace for the ceph daemons to consume.

fixes: #2078

Signed-off-by: Noah Watkins <nwatkins@redhat.com>
2018-09-24 13:26:24 -07: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 7a5fe8498c Ceph op: Add test package, container tests
Add a 'test' package to the Ceph operator and define a test to verify
that containers produced by Rook-Ceph match what is expected. Because
this is for 'containers' and not strictly for 'ceph containers', this
could be moved a level up to the operator test package; however, if
other backends wish to use the container tests, they will likely need to
make modifications, and there is concern that this might make the Ceph
tests brittle.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2018-09-21 09:58:32 -06:00
Blaine Gardner e3d24106d9 Ceph op: Add spec package, shared vol/mnt defns
Add a package called 'spec' to the Ceph operator to store resource
definition specs that are shared by all Ceph daemons.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2018-09-21 09:58:32 -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
Travis Nielsen 9ce83f9267 Merge pull request #2131 from travisn/start-before-check-quorum
Wait for mon pods to start before checking for quorum
2018-09-18 11:40:23 -06:00
travisn d02325c41d mon: wait for pods to start before checking for quorum
Signed-off-by: travisn <tnielsen@redhat.com>
2018-09-17 13:41:15 -06:00
Travis Nielsen 8afeaf110e Merge pull request #2095 from SUSE/ceph-mon-decouple-rook-ceph-versions-w-init-container
Ceph mon: initialize mon config in init container
2018-09-17 11:19:00 -06:00
Travis Nielsen bcb71378d6 Merge pull request #1995 from rtnpro/support-storageclass-reclaimpolicy
Support storageclass reclaimpolicy
2018-09-14 11:02:47 -06:00
Travis Nielsen ae4e3369ca Merge pull request #2111 from rootfs/relist-cm
reset resource version if watch channel closed
2018-09-14 08:25:39 -06:00
Ratnadeep Debnath ed089777bd Added unit tests for ceph provisioner to assert if reclaimPolicy is set properly.
Signed-off-by: Ratnadeep Debnath <rtnpro@gmail.com>
2018-09-14 10:05:36 +05:30
Ratnadeep Debnath 7ae2149961 Add support for storageclass' reclaimPolicy when creating PV.
Signed-off-by: Ratnadeep Debnath <rtnpro@gmail.com>
2018-09-14 10:05:34 +05:30
Huamin Chen 1c225185b6 adjust cluster and osd provision timeout
Signed-off-by: Huamin Chen <hchen@redhat.com>
2018-09-13 11:21:11 -04: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 92f91ab156 golang 1.11 support
Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
2018-09-12 10:53:53 -07:00
Huamin Chen 9ec37d5c00 reset resource version if watch channel closed
Signed-off-by: Huamin Chen <hchen@redhat.com>
2018-09-11 13:27:26 -04:00
travisn 6a335ebe8a mon: refactor mon naming for use by other daemons
Signed-off-by: travisn <tnielsen@redhat.com>
2018-09-06 11:46:45 -06:00
Blaine Gardner 4be911c5b1 Ceph: include daemons as <dmn>daemon
To help with code readability, include daemons from `pkg/daemon/ceph`
as `<dmn>daemon "github.com/rook/rook/pkg/daemon/ceph/<dmn>`. This will
make it easier to understand code lines without needing to scroll up to
check the includes, as there are mon/mds/mgr/osd/rgw packages for
daemons as well as operator and cmd.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2018-09-06 09:40:00 -06:00
Travis Nielsen 02accb5d62 Merge pull request #2081 from SUSE/ceph-refactor-mon-config
Ceph: Refactor daemon/mon module's config and keyring generation into cephconfig module
2018-09-05 22:03:06 -06:00