Commit Graph
3904 Commits
Author SHA1 Message Date
Yannis Zarkadas 367d485407 cassandra: sidecar implementation
Implementation of the cassandra sidecar logic.
This sidecar helps us inject our custom values during startup
and provides HTTP liveness and readiness checks.
In the future it will also be used for:
- Shutting Down / Decommissioning a cassandra instance
- Backups
- Restores

Signed-off-by: Yannis Zarkadas <yanniszarkadas@gmail.com>
2018-12-05 12:47:26 +02:00
Yannis Zarkadas c8c38d8584 cassandra: controller implementation
Control logic for the cassandra controller.
The controller exists in a separate StatefulSet, watches
Kubernetes Objects for changes and acts on those changes to
achieve the desired state.

Signed-off-by: Yannis Zarkadas <yanniszarkadas@gmail.com>
2018-12-05 12:46:33 +02:00
Yannis Zarkadas 0ccc04cccd cassandra: controller scaffolding, image build and manifests
Scaffolding of a Kubernetes controller using the informer-workqueue
pattern.
Dockerfiles and Makefiles to build the cassandra operator image.
Manifests to deploy the Cassandra operator and create a Cluster CRD.

Signed-off-by: Yannis Zarkadas <yanniszarkadas@gmail.com>
2018-12-05 12:44:29 +02: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
Travis Nielsen 2af0be2cec Merge pull request #2317 from jtlayton/filesystem
Allow filesystem specifications without pools
2018-12-04 15:14:59 -07: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
Blaine Gardner 290b496069 ceph mon/mgr/mds units: verify updated deployments
Verify that the expected deployments are updated in the Ceph mgr,
and mds unit tests.

This also allows those unit tests to pass at all since
UpdateDeploymentAndWait was blocking the unit tests from finishing due
to unexpected behavior of generated `Deployment.Update` unit test mock.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2018-12-04 11:35:06 -07:00
Blaine Gardner 3d89c78508 ceph: Update deployments on rook img update
Use the `UpdateDeploymentAndWait` method used by the osd operator to
update the deployments for mgrs, mdses, and rgws when the Rook
orchestrator image is updated.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2018-12-04 11:33:40 -07: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 dcd9e1e0ff ceph mds: allow filesystem specifications that have no pools
design/external-management.md says that we should allow specifying
Filesystems that have no pools. When this is done, the CRD should
interepret that as a request to just manage the MDS daemons without
creating a new filesystem.

Don't fail the verification if there are no data pools in the spec,
and just skip creating a new filesystem if that's the case.

Also, add a testcase for this usage.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2018-12-01 20:40:06 -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 10fa2d9325 Merge pull request #2001 from jcsp/wip-mgr-rbac
Set service account on ceph-mgr pod
2018-12-01 00:58:20 -07:00
travisn ea03f58048 rbac: rename service account rook-ceph-cluster to rook-ceph-osd
Signed-off-by: travisn <tnielsen@redhat.com>
2018-11-30 13:39:58 -07:00
travisn 16c2a56591 add ceph mgr roles to the tests and helm chart
Signed-off-by: travisn <tnielsen@redhat.com>
2018-11-30 13:39:58 -07:00
travisn 69fba00f6b remove --set-uid option from ceph-authtool calls
Newer versions of ceph have deprecated this option, and the commands
will fail if you try to pass it in.

Signed-off-by: travisn <tnielsen@redhat.com>
2018-11-30 13:24:46 -05:00
John Spray cff953696c Set service account on ceph-mgr pod
This is to enable the `rook` ceph-mgr module to drive
the Rook and k8s APIs, exposing functionality via
its own CLI and GUI.

The service account gets access to two different roles:
one for the items that are within the cluster's namespace,
and one for reading configmaps in the rook-ceph-system namespace,
which is needed for reporting available devices.

Signed-off-by: John Spray <john.spray@redhat.com>
2018-11-30 10:50:20 -07:00
travisn fdd64bb95a enable rbd mirror daemon in the cluster crd
Signed-off-by: travisn <tnielsen@redhat.com>
2018-11-28 08:29:57 -07:00
Alexander Trost f46efa452c Merge pull request #2282 from galexrt/pera_fix
Use truncated node name for missed sections
2018-11-27 16:30:21 +01: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
Ben Zieglmeier 6d04bbf430 ceph: Add CRD for Object Store User
Add the ability to create and manage object store users with CRDs

Signed-off-by: Ben Zieglmeier <benjamin.zieglmeier@target.com>
2018-11-21 15:15:05 -06: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
Travis Nielsen 0560c02544 Merge pull request #2265 from travisn/set-ceph-version-on-update
Set ceph version when cluster crd is updated
2018-11-14 16:13:37 +05:30
Jared Watts 2274f78683 Fixes for running Ceph, CockroachDB, and Minio demos
- Add cluster domain to minio spec
- Remove port configuration from minio spec
- Include unused packages for codegen related repos
- Update Minio version to pick up latest fixes
- Helper to load cockroachdb demo images into minikube

Signed-off-by: Jared Watts <jbw976@gmail.com>
2018-11-08 10:52:49 -08:00
travisn fa613d2fb3 set ceph version when cluster crd is updated
Signed-off-by: travisn <tnielsen@redhat.com>
2018-11-06 17:14:36 -07:00
Travis Nielsen 9a09773dda Merge pull request #1915 from laevilgenius/dashboard_url_prefix
Add urlPrefix setting for ceph dashboard
2018-11-06 15:45:20 -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
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