Commit Graph
1452 Commits
Author SHA1 Message Date
Sébastien Han b7fd64074c ceph: osd spec: tune osd memory target
If the spec of the OSD daemon contains resource limits, especially
memory.limit we will use that value for setting the osd memory target
value so the bluestore OSD knows the amount of memory available for its
cache.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-03-15 11:45:29 +01: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
Noah Watkins 1ee7cdfa8b ceph: refactor dashboard retry logic to use helper
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-03-14 14:52:44 -07:00
Noah Watkins 8ebf9ac722 ceph: retry dashboard credentials setup
may need retry if manager hasn't fully loaded its modules.

fixes: #2809

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-03-14 14:51:50 -07:00
travisn 3548418774 print the diff for changes to the cluster crd
Signed-off-by: travisn <tnielsen@redhat.com>
2019-03-14 13:10:52 -06:00
travisn c1628141aa minimize args to mon creation in the operator
Only the args necessary have traditionally been passed to the mon package.
This has led to many properties in the mon struct, whereas we will
now simply pass the cluster crd spec to simplify.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-03-14 13:10:52 -06:00
travisn 2fd1f7345d Trigger an orchestration on any crd update and only allow a single orchestration of mons at a time
The orchestrations need to be triggered on any update to the crd.
Users today restart the operator for various scenarios when the
operator could take care of it automatically. If unsupported options
are updated, they should just be ignored.

There are two goroutines that are working with the mons.
The first is an orchestration that is triggered by the operator
at startup, or when the cluster crd is updated. The second
is the health check that triggers periodically by default every
45 seconds. These goroutines must not try to make updates at the
same time. A mutex is added so one will block if the other is
still active. The mutex is only active for the duration of working
with mons, and not an entire orchestration of mgr, osd, etc

Signed-off-by: travisn <tnielsen@redhat.com>
2019-03-14 13:10:12 -06:00
Travis Nielsen a05ce45280 Merge pull request #2693 from SUSE/SH_#2208
#2208 OSDs not automatically started when adding nodes to existing cluster
2019-03-14 13:01:29 -06: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
Alexander Trost 6140661766 Merge pull request #2817 from jarrpa/ceph-job-placement
Allow Ceph detect version Job to accept placement
2019-03-13 20:28:51 +01:00
Blaine Gardner 6f22781961 ceph rbd-mirror: update deployment if exists
Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-03-13 12:43:46 -06:00
Jose A. Rivera a211a3cd26 Allow Ceph detect version Job to accept placement
Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
2019-03-13 11:18:17 -05: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
Travis Nielsen dcd24d3cca Merge pull request #2738 from SUSE/rgw-all-in-operator
Ceph rgw: configure completely from operator
2019-03-07 14:35:28 -07:00
Blaine Gardner 7827ea8ff0 ceph mon: use new spec test framework
Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-03-07 08:13:07 -07: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
Travis Nielsen a145f4dcb7 Merge pull request #2703 from travisn/osds-per-device-with-filter
Clean up provisioning of OSDs on devices
2019-03-04 07:58:56 -07:00
Travis Nielsen 816d698655 Merge pull request #2742 from noahdesu/dmcrypt
ceph: share host ipc namespace with provision pod
2019-03-01 13:21:05 -07:00
Noah Watkins 6597531ed0 ceph: share host ipc namespace with provision pod
this is needed as cryptsetup in the pod and udev on the host coordinate
via a semaphore that must be visible in both contexts.

note that additionally the host needs to have dmcrypt compiled with udev
synchronization, which at least one minikube version does not have.

fixes: #923

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-03-01 10:50:19 -08:00
Travis Nielsen eaf6b97b59 Merge pull request #2702 from SUSE/mds-all-in-operator
ceph mds: configure completely from operator
2019-03-01 06:59:15 -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
Jeff Layton c0910dab2c ceph: retry "ceph orchestrator set backend rook" if command returns EINVAL
Use similar method as that used by the dashboard initialization code.

Fixes: https://github.com/rook/rook/issues/2617
Signed-off-by: Jeff Layton <jlayton@redhat.com>
2019-02-27 10:55:24 -05:00
Jeff Layton 56abc00b78 ceph: fix invalidArgErrorCode definition
We should probably not hardcode this value here, and instead use
whatever the syscall module thinks this is.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
2019-02-27 10:53:10 -05:00
travisn bdc3cf8146 osd: fix the device filter and improve device provisioning reliability
All devices detected by the discovery pod were being passed to the OSD provisioning pod
thus not always honoring the desired device list that should be provisioned.
Now the provisioning pod will be given the desired state from the crd,
then apply that state depending on the actual devices detected.
Also added a helper to ensure OSDsPerDevice is always valid.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-02-26 16:11:25 -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
Travis Nielsen 8420538e5f Merge pull request #2629 from SUSE/mgr-all-in-operator
Ceph mgr: configure completely from operator
2019-02-12 08:47:48 -07:00
travisn b72c6436ef handle ceph mon failover more gracefully
Signed-off-by: travisn <tnielsen@redhat.com>
2019-02-11 17:35:28 -07:00
Blaine Gardner 03ea5f0a7c ceph mgr: configure completely from operator
Configure the Ceph mgr daemon completely from the operator a la the
recent changes to the Ceph mon operator.

The pod spec for the mgr changed quite a bit, and instead of updating
the unit tests of questionable use, some additional unit test tools
applicable to any Ceph daemon have been added and used with the mgr. The
mgrs unit tests should now be more useful and get in the way of devs
less, and they can be used by other daemons later.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-02-11 14:35:01 -07:00
travisn 3a64288356 avoid a duplicate volume for a directory and dataDirHostPath
Signed-off-by: travisn <tnielsen@redhat.com>
2019-02-05 22:26:50 -07: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 918fffcc71 ceph mon op: split large files for readability
The mon operator code is fairly substantial. Separate large files into
more smaller ones with a good separation of names. This will be
important for trying to move all the mon code into the operator.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-02-05 06:18:00 -07:00
Blaine Gardner e13956c0bf ceph mon: set public-bind-addr from commandline
Set each Ceph mon's `public bind addr` from the commandline instead of
by inserting it into the config file. This eliminates an extra step from
initializing mon configs.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-02-05 06:06:35 -07:00
Sébastien Han 712af5de11 ceph: check num mon for hostnetworking
We now refuse to start more than one monitor on the same machine if
hostnetworking is enabled.
Supporting this creates a lot more complexity from the rook side. Also
having 3 monitors running on the same machine is not a production setup.

This means multi-cluster support on the same machine
is not possible anymore when hostnetworking is enabled.

Resolves: https://github.com/rook/rook/issues/2604
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-02-04 09:52:35 +01: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
Alexander Trost 8e263cd9c3 Merge pull request #2577 from leseb/rm-monmap
mon: do not generate nor inject a monmap
2019-01-28 19:14:01 +01:00
Sébastien Han ff2bc6509f mon: do not generate nor inject a monmap
Given that we have mon_host and mon_initial_members sections in our
ceph.conf, building a monitor map is not needed. During the monitor mkfs
a monmap will get generated on the fly based on the section mentioned
above.

One benefit from that commit is a potential speed improvement as we have
removed the container that was generating the map from the monitor
initialization sequence.

Resolves: https://github.com/rook/rook/issues/2576
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-01-28 16:55:31 +01:00
Sébastien Han 49363ccbbd operator: ceph - utils fix endpoint comment
The Endpoint has a format such as ip:port and the comment was implying
something like hostname:port. Thus fixing the comment with the right
value.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-01-28 10:53:10 +01:00
Travis Nielsen 42582b8669 Merge pull request #2516 from travisn/mon-port-6789
Use the default mon port of 6789 instead of 6790
2019-01-21 11:16:11 -07:00
travisn 9afbe36ae6 set mgr privs for access to the rbd mirroring settings
Signed-off-by: travisn <tnielsen@redhat.com>
2019-01-19 21:29:19 -07:00
travisn c2f354680e mons: use the default port of 6789 instead of 6790
Signed-off-by: travisn <tnielsen@redhat.com>
2019-01-17 14:37:58 -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
Noah Watkins e9a9509313 ceph: support dashboard ssl on/off
fixes: #2433

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-01-09 12:08:51 -08:00
Noah Watkins e66ad7463b ceph: support custom dashboard port
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-01-09 12:08:49 -08:00
Travis Nielsen 2da22001d6 Merge pull request #2414 from travisn/retry-dashboard-cert
Retry creating self signed cert if module is not ready
2018-12-21 07:43:42 -07:00
travisn b770b80a88 mgr: retry creating self signed cert if module is not ready
Signed-off-by: travisn <tnielsen@redhat.com>
2018-12-20 16:07:00 -07:00
travisn 261aae3f46 mgr: set the server_addr for the dashboard and prometheus modules
Signed-off-by: travisn <tnielsen@redhat.com>
2018-12-20 12:08:37 -07:00
travisn 620c61b8b5 ceph: properly detect the image version during upgrade
Signed-off-by: travisn <tnielsen@redhat.com>
2018-12-13 22:08:53 -08:00
Alexander Trost 51a6de0151 mgr: use Recreate update strategy
Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2018-12-07 19:38:45 -07:00