Commit Graph
110 Commits
Author SHA1 Message Date
Sébastien Han 93b2448619 ceph: refactor rgw bootstrap
This commit does multiple things:

* remove support for AllNodes where we would deploy one rgw per node on
all the nodes.
* a transition path is implemented in the code so that if someone has an
existing deployment, daemonsets will be removed and replaced by an
deployments.
* when using "instances", each rgw deployed has its own key which makes
Ceph reporting the exact number of rgw running, see:

```
[root@rook-ceph-operator-775cf575c5-bh4sr /]# ceph -s
  cluster:
    id:     611fcf39-0669-4864-9a12-debb35c0397a
    health: HEALTH_OK

  services:
    mon: 3 daemons, quorum a,b,c (age 12h)
    mgr: a(active, since 12h)
    osd: 3 osds: 3 up (since 12h), 3 in (since 12h)
    rgw: 3 daemons active (my.store.a, my.store.b, my.store.c)

  data:
    pools:   6 pools, 600 pgs
    objects: 235 objects, 3.8 KiB
    usage:   3.0 GiB used, 84 GiB / 87 GiB avail
    pgs:     600 active+clean
```

Closes: https://github.com/rook/rook/issues/2474, https://github.com/rook/rook/issues/2957 and https://github.com/rook/rook/issues/3245
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-06-14 17:55:15 +02:00
Jose A. Rivera f3a1512983 Read node labels for provider topology
Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
2019-05-14 13:18:00 -05:00
Alexander Trost 7cf8e99a8c ceph-op: Remove taint check in "is node scheduable" func
This removes the unnecessary check for taints on nodes in the
`GetNodeSchedulable()` function. This fixes that even though the user
has specified `tolerations` for, e.g., `NoSchedule` taints, that would
be ignored and the node(s) directly be "marked" as unschedulable.

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2019-05-02 18:05:46 +02:00
Kaushal M 5e8375e921 ceph: Delete and recreate rook-ceph-detect-version job
The ceph controller will delete and recreate the detec-version job, when
an already existing job is found. This helps avoid cluster creation from
getting hung up on waiting for an already existing/stale job to finish.

Fixes #3081.

Signed-off-by: Kaushal M <kshlmster@gmail.com>
2019-04-30 18:19:56 +05:30
travisn bc87b440fb update to the k8s 1.14 client libraries
Signed-off-by: travisn <tnielsen@redhat.com>
2019-04-18 07:51:41 -06:00
travisn 91e9a5cd04 reference K8s1.13 and client-go 1.10 and the external provisioner for flex
Signed-off-by: travisn <tnielsen@redhat.com>
2019-04-18 07:51:41 -06:00
Blaine Gardner 966aef8681 ceph mds: update keyring before deployment update
Because the deployment update-and-wait function waits for the deployment
to be ready, and that cannot happen due to the keyring not
having been updated yet. The keyring has its
owner set to the deployment so that no special keyring handling must
be done, but it must be created after the deployment UID is known.
Change the order of operations so that the existing deployment's UID can
be retrieved if it exists and the keyring created/updated before the
update-and-wait function is called.

This order-of-operations issue currently only applies to the mds. Other
daemons whose keyrings are owned by the replication controller do not
use the update-and-wait function.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-04-15 12:26:46 -06: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
Blaine Gardner a80082988d ceph: remove osds only when certain
Make the Ceph operator more cautious about when it decides to remove
nodes from the Rook-Ceph cluster which are acting as osd hosts.

When `useAllNodes` is set to `true` we assume that the user wants to
have the most hands-off experience. Node removals are allowed when a
node is delted from Kubernetes and when a node has its taints/affinities
modified by the user (but not by automatic k8s modification as much as
possible).

When `useAllnodes` is set to `false` the only time a node is removed is
if it is removed from the Ceph cluster definition.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-04-11 09:41:54 -06:00
Blaine Gardner 9c0369f264 k8sutil: extract granular node validity functions
Node validity is not always as simple as a true/false. Refactor each
validity test into its own function for operators that wish to check
validity more granularly. Ceph will use these changes.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-04-10 12:43:43 -06:00
Blaine Gardner 35e2fbe4e0 optest: wait longer for deployment image
The Ceph upgrade test is the only one which uses the
`WaitForDeploymentImage` method, and it has to be configured to wait
longer after upgrade at this point. Since the wait time is still
hard-coded, this method is moved to the operator's test dir to make
it clear that the method is suitable only for tests currently.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-04-08 10:30:32 -06:00
Blaine Gardner feff587992 ceph: mon service forwards default bind port 6789
The Ceph mon flag `--public-bind-addr` does not keep the same port as
the previous daemon run when the port is left off the flag's value. A
port is undesired since that could interfere with Nautilus' msgr2
protocol, so instead configure the mon's services to forward the default
bind port on pods (6789) to the mon endpoint's port. The endpoint port
will be 6789 for new mons, but it may be 6790 for legacy clusters.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-04-03 15:53:56 -06:00
travisn 6ec255e269 Avoid silent failure during upgrade integration test
Signed-off-by: travisn <tnielsen@redhat.com>
2019-04-02 17:48:47 -06:00
Sébastien Han fa61c0441b ceph: pod: expose resource limits and requests
We now expose resource as environment variable in the pod.
They will be used by Ceph to report as a daemon metadata.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-03-15 11:45:29 +01:00
Stefan Haas 1f1dbc7461 issue #2208 OSDs not automatically started when adding nodes to existing cluster
Signed-off-by: Stefan Haas <shaas@suse.com>
2019-03-14 18:54:40 +01: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
Blaine Gardner 4eb4fb7aa6 ceph mds: configure completely from operator
Configure the Ceph mds daemon completely from the operator a la the
recent changes to the Ceph mon and mgr operators.

Create the mds deployments first and then
create the keyring secrets for them with their owner reference as the
corresponding deployment. This will mean that the secrets do not need to
be micromanaged. When the deployment is deleted, the secret is also
deleted. This has not been necessary for the mons or the manager since
the mons share a keyring with a lifespan of the cluster, as does the
mgr, which currently has single-mgr support only.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-02-28 12:31:43 -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
Huamin Chen 3806baffe1 add ceph csi deploy options
Signed-off-by: Huamin Chen <hchen@redhat.com>
2019-02-12 21:20:41 -05:00
Blaine Gardner ec416cdd92 ceph mons: set up entirely in operator
Make the Rook config-init unnecessary for mons, and remove that init
container. Perform all mon configuration steps in the operator, and set
up the mon pods and k8s environment such that only Ceph containers are
needed for running mons.

This should help streamline changes to the mons, as there will be no
need to change the `daemon/mon` code or `cmd/rook/ceph` code with mon
changes in the future.

This work starts to lay the groundwork for supporting the
`design/ceph-config-updates.md` design.

Notable new bits:

Create a keyring secret store helper for storing dameon keyrings, and
use it to store the mon keyring. Mon pods mount the keyring into a
k8s secret-backed volume.

Create a configmap store for the Ceph config file which can be mounted
into pods/containers directly to /etc/ceph/ceph.conf. Also store
individual mon_host and mon_initial_members values which can be mapped
into pods as environment variables and used in Ceph commandline flags,
enabling the mon pods to have the most up-to-date information about the
mon cluster when restarting and without need for operator intervention.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-02-05 06:19:59 -07:00
Blaine Gardner 78d4719125 ceph: no longer create fallback osd
Rook's behavior should not be to create a default OSD in dataDirHostPath
when no devices are present on a node. Any preexisting fallback osd
should be kept as long as no dirs or disks have been specified to keep
the legacy behavior for those clusters running with these osds in place.
The legacy deletion behavior is also kept, removing the osd as soon as
any dir or device is specified other than the dataDirHostPath dir.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-02-01 09:41:32 -07:00
Travis Nielsen d0cd8cec72 Merge pull request #2099 from travisn/nfs-ganesha-crd
Ceph NFS Ganesha CRD
2019-01-15 15:21:08 -07:00
travisnandjtlayton 37a005b71e nfs: configure and start daemons when the nfs crd is created
Co-authored-by: jtlayton <jlayton@redhat.com>
Signed-off-by: travisn <tnielsen@redhat.com>
2019-01-15 13:48:58 -07:00
travisn feb33de24b tests: upgrade test is from v0.9 instead of v0.8
Signed-off-by: travisn <tnielsen@redhat.com>
2019-01-14 23:06:19 -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
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 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 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
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
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
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
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
travisn c0af417b00 osd: delete legacy deployment with -id in the name
Signed-off-by: travisn <tnielsen@redhat.com>
2018-09-04 14:15:18 -05: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 51e60b7b4d tests: upgrade integration test from 0.8.1 to master
Signed-off-by: travisn <tnielsen@redhat.com>
2018-08-23 16:43:10 -06: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
Travis Nielsen 5e4fba2aec Merge pull request #1952 from SUSE/simple-linting
Fix spellcheck and trailing space/newline issues
2018-07-27 14:02:00 -06: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
Huamin Chen c6f463d0e7 validate storage nodes before preparing osds
Signed-off-by: Huamin Chen <hchen@redhat.com>
2018-07-26 17:18:47 +00:00
Alexander Trost faddfb0184 Truncate too long name for ObjectMeta.Name
Resolves #1907

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2018-07-20 10:35:20 +02:00
travisn 021e8e7a9e osd: watch provisioning status for all nodes and start osds as each node is ready
Signed-off-by: travisn <tnielsen@redhat.com>
2018-07-05 16:08:31 -06:00