Commit Graph
37 Commits
Author SHA1 Message Date
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
Sébastien Han 241296be8a ceph: rgw add liveness probe check
We now check if the pod responds on http port 80.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-06-05 14:35: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
travisn 9dcddb5bed ceph: upgrade all daemons during ceph upgrade
The CephCluster CR contains settings that are needed by other
CRs to configure the Ceph daemons. When the CephCluster CR
is updated, the updates will now be passed on to each of the
CR controllers to ensure the daemons are updated properly
without requiring an operator restart.

When calling the controllers from another controller,
we ensure that only a single goroutine is handling
CRs at any given time to prevent contention across
multiple CRs of the same type.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-04-23 13:36:45 -06:00
Blaine Gardner f4e2be50a6 ceph spec: add ceph-version label to controllers
Add a 'ceph-version' label to application controllers in the same manner
as the prior 'rook-version' label to help with upgrades.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-04-18 15:09:33 -06:00
Alexander Trost 0c6eb7aa3d crds: Set annotations pods, deployments and so on
Allow the user to set annotations in the CRDs of the following operators which will then be set on
the resulting Pods (Deployments, StatefulSets and so on).
Operators:
* Cassandra
* Ceph
* CockroachDB
* EdgeFS
* Minio
* NFS

The Annotations related structures have been added to the
rook.io/v1alpha2 pkg.

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2019-04-16 20:47:05 +02:00
Sébastien Han d4c48bb293 ceph: expose /var/log/ceph to the host
It's quite convinient to expose /var/log/ceph so that we can decide to
activate logs locally on the machine and see what's going on.
This is only a placeholder when a daemon is stuck crashlooping and we
want to allow administrator to gather log files.
We still do not log on file but this can be activated via a config
option passed to the centralized config option store.

For some daemons, which typically do not store any data (rgw, rbd-mirror
and mds) we had to propagate dataDirHostPath from the cluster spec to
each creation call so that the bindmount can happen.

Fixes: https://github.com/rook/rook/issues/2881
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-04-15 10:47:09 +02:00
Blaine Gardner 685a8df08d ceph: add 'rook-version' label to controllers
Add a `rook-version` label to all controller resources used by Ceph:
deployments, daemonsets, and jobs. Labels are added to controller
resources only and not to the pod templates within because changing pod
templates causes updates due to the label change. The controller
resources themselves are not updated with the label addition and
therefore don't cause an unnecessary upgrade.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-04-12 13:56:31 -06:00
Alexander Trost 8bc26d9096 k8sclient: Update all operators to use apps/v1
All usages of k8s go client are now also using the versioned `AppsV1() `
call for the client.

Updated MySQL and Wordpress, and Kube Registy examples to use apps/v1
Deployments.

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2019-04-12 09:25:42 +02:00
Travis Nielsen b15391819b Merge pull request #2910 from SUSE/mon-port-upgrade-fix-2854
ceph: fix for masked upgrade failures and getting integrations running again
2019-04-08 17:11:32 -06:00
Keith Schincke 878ef8ff00 Issue 2660: Deleting CephObjectStoreUser does not delete secret
When deleting a CephObjectStoreUser the deleteUser function
attempts to delete the stored secret using the wrong name. This
patch updates deleteUser to use the same fmt.Sprintf call used in
the createUser function.

Updated CI to delete the correct CRD and check the secret is deleted.

Signed-off-by: Keith Schincke <keith.schincke@gmail.com>
2019-04-05 10:52:15 -05:00
Blaine Gardner 5c41da6705 ceph rgw: more robust update for selector change
Upgrading a Ceph objectstore was failing the upgrade test because the
existing method for handling the case where update errors occurred
because labels and label selectors have changed was not robust enough.
Make this more robust by attempting delete-and-create if a normal update
does not work on an rgw deployment.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-04-04 09:02:09 -06:00
Noah Watkins 379cb98689 ceph: replace release name with fine-grained version
The basic idea here is to replace the release name in the ClusterInfo
object with the fine grained version information queried at runtime.
This patch also removes the Name field from the cluster spec, which was
also runtime determined and was redundant with ClusterInfo relase name.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-03-18 12:57:29 -07:00
Sébastien Han 871054e887 ceph: implement pod restriction on memory
If someone sets limits to pod, we want to ensure the possible
experience, so we want to make sure that people do not configure
inapropriate values for certain daemons.
We decide to fail if the memory.limit is too low.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-03-15 17:35:44 +01:00
Blaine Gardner c12aa6c7c5 ceph rbd-mirror: configure entirely in operator
In the form of mon, mgr, mds, and rgw, convert the rbd-mirror to be
configured completely from the operator. This is a straightforward
conversion with one functional addition: the rbd-mirror daemon stores
*no* data and has no default data dir, so the concept of a `Dataless`
daemon is here introduced.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-03-13 09:54:09 -06:00
Blaine Gardner 086fa8231c rgw: configure entirely in operator
Configure the Ceph rgw daemon completely from the operator a la the
recent changes to the Ceph mon, mgr, and mds operators.

Create the rgw deployment or daemonset first, and then create the
keyring secret for the object store with its owner reference as the
corresponding deployment or daemonset. When the replication controller
is deleted, the secret is also deleted.

The RGW's mime.types file is now stored in a configmap with a different
file created for each object store. This is primarily just a means to
get the mime.types file into the rgw pod, but the added benefit is that
the administrator can modify the configmap, which could reduce
susceptibility to file type execution vulnerabilities (worst case).

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-03-07 08:02:42 -07:00
travisn 31848e23e7 add the CONTAINER_IMAGE env var to the ceph daemon pods
The mgr orchestrator modules need the container image to run
the ceph image for blinking the lights when a disk is down

Signed-off-by: travisn <tnielsen@redhat.com>
2019-03-04 13:33:41 -07:00
Sébastien Han eb3c424d57 Ceph messengers 2 support
This commit introduces the necessary changes to support the new
messenger feature coming with Ceph Nautilus (currently in development).

What changes? Now the monitor listens on two port:

* old 6789 for messenger v1, which will help us support older client
(e,g: krbd)
* new 3300 for messengers v2, which brings new improvement in the
messaging layer. This new transport layer brings numerous advantages
such as encryption improvement, speed improvement, pluggable nature to
support different network stack than TCP and many more.

We still have one Service IP, however it has 2 ports, see:

```
NAME                      TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)             AGE
rook-ceph-mon-a           ClusterIP   10.106.217.160   <none>        3300/TCP,6789/TCP   4h
rook-ceph-mon-b           ClusterIP   10.99.36.175     <none>        3300/TCP,6789/TCP   4h
rook-ceph-mon-c           ClusterIP   10.108.220.74    <none>        3300/TCP,6789/TCP   4h
````

The `ceph.conf` has changed and we don't force the port when using an IP
address (public addr etc). Ceph, depending on its version will naturally
start the monitors on their right port, 6789.

A new --ceph-version-name CLI argument has been added to the Rook binary
so that when the pod starts it passes the ceph version name and the
configuration of the ceph.conf, as well as daemon startup flags, happen
properly.

Given that the Rook Operator remembers the port of all the monitors it
deployed (through Pod definition), this change is not an issue and will
maintain backward compatibility.

Note that to test this you must build rook with dev container image,
which contains the dev Nautilus version. So you should do something
like:

`make -j4 BASEIMAGE='ceph/daemon-base:latest-master' IMAGES='ceph' build`

Resolves: #2525
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-02-22 00:09:37 +01:00
Huamin Chen 1b21e42a90 convert extensions to apps
Signed-off-by: Huamin Chen <hchen@redhat.com>
2019-02-14 16:06:05 -05:00
Jack Lauritsen ea3e0fca26 fix for enabling tls on rados gateway s3 api:
this mounts secret as volume to rgw container
this adds certificate path to init container

Signed-off-by: Jack Lauritsen <jack.lauritsen@teradata.com>
2019-01-14 18:47:25 -08:00
Alexander Trost 3375db8729 object: use Recreate update strategy
Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2018-12-07 19:38:45 -07:00
travisn 304d6445f2 rgw: update the deployment or daemonset when the pod spec changes
Signed-off-by: travisn <tnielsen@redhat.com>
2018-12-07 15:11:55 -07:00
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
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
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
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
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
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
travisn b43f0056ed rgw: generate config in init container
Signed-off-by: travisn <tnielsen@redhat.com>
2018-10-09 21:43:24 -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
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
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
Jared Watts 189e3eb611 ceph: migration logic for ceph.rook.io/v1alpha1 to ceph.rook.io/v1beta1, update all type references
Signed-off-by: Jared Watts <jbw976@gmail.com>
2018-07-11 09:23:46 -07:00
travisn 89cfccd5a2 enable rook to run on openshift
Signed-off-by: travisn <tnielsen@redhat.com>
2018-07-05 11:20:43 -06:00
Jared Watts f3df68e573 operator, daemon, and cmd updates for supporting multiple storage types
Signed-off-by: Jared Watts <jbw976@gmail.com>
2018-05-18 14:32:20 -07:00