Commit Graph
5036 Commits
Author SHA1 Message Date
Travis Nielsen 1591ba843e Merge pull request #3607 from obnoxxx/logic-flow-createReplicationCrushRule
ceph:pools: polish logic flow a bit in createReplicationCrushRule()
2019-08-13 13:22:21 -06:00
travisn 9c73bfc603 ceph mds: properly trim the daemon name
The daemon name always needs to have the prefix rook-ceph-mds-
removed from the deployment name in order to translate to the
daemon name. The daemon name is not dependent on the namespace.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-13 07:23:00 -06:00
travisn 113da4a94f update the default ceph version from 14.2.1 to 14.2.2
The Nautilus v14.2.2 release was out last week. This is the new
default version for Rook in the documentation and manifests.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-13 07:23:00 -06:00
travisn be391de73c resolve changes from merge conflict in upgrade changes
The upgrade changes for #2901 added the check for the correct version
of the ceph image before continuing with an upgrade. This commit is
to refactor that change to work with the new code path to validate
the ceph version.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-13 07:23:00 -06:00
travisn 98d0a59c91 ceph: create cluster during onUpdate event if needed
If the cluster is not successfully initialized during the onAdd event,
the cluster will not be in a properly initialized state. The admin
will likely need to update the CR, in which case the onUpdate event would
be triggered. In this case we need to call the same code path as the
onAdd event to properly initialize the cluster.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-13 07:23:00 -06:00
travisn 9a3dc52a11 ceph: minimum version allowed is mimic 13.2.4
With the 1.1 release we should not be creating bluestore OSDs
with rook's legacy partitioning scheme. All new bluestore OSDs
should be created with ceph-volume. Therefore, the miminum
version allowed is a version of mimic supporting ceph-volume.

This commit also adds consistent version checking between
the Add and Update methods for the operator handling the
CR events.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-13 07:22:59 -06:00
travisn 258a66554f ceph: remove unnecessary CR validation
Range checks for CR values are done statically in the CRD
for the number of mons. There is no need to check in the code
if the mon count is out of range.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-13 07:17:38 -06:00
Guangming Wang adf975c3c2 edgefs: cleanup pod.go comment, fix typos
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-08-13 21:00:54 +08:00
Michael Adam 9c2c3c5d55 ceph:pools: polish logic flow a bit in createReplicationCrushRule()
This is not changing the behavior of the code but making the
flow of logic in the createReplicationCrushRule() function consistent
by removing an else branch. This was just a reflex when I was reading
the code.

Signed-off-by: Michael Adam <obnox@redhat.com>
2019-08-13 13:50:20 +02:00
John Mulligan 521680d100 ceph csi: disable csi if server version is too low
Previously, if csi was not supported by the k8s version the csi set-up
code was skipped but csi was "left on". This change ensures that if
csi is not supported the csi enablement flags are set to false so
that other code that needs csi support will not run.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-13 06:42:22 -04:00
John Mulligan 55b871060f ceph csi: add additional error handling for csi related functions
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-13 06:42:22 -04:00
John Mulligan 7c5bd58878 ceph csi: ensure the required namespace env var is set
Return an error if the function that updates the csi config map
can not determine a valid namespace for the config map.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-13 06:42:22 -04:00
John Mulligan 12c48ba375 ceph: refactor csi related code into a new file in csi package
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-12 16:41:26 -04:00
John Mulligan 9f6c0ba2c5 csi: prevent trivial conflicts between ceph csi instances with a prefix
Add a prefix to the csi drivername when ceph csi is deployed by rook.
This aims to prevent trivial conflict between csi instances when two
rook operators are deployed into the same cluster. By default the
prefix is the "<rook-namespace>." but can by customized on the cli
and via environment vars.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-12 16:41:26 -04:00
John Mulligan 2b1ae54b84 ceph csi: clean up how templates are expressed
Avoid using global values that are not used anywhere in the code.
Split the object used to express the ceph csi templates into two
so only values that are set globally need to be managed globally,
all other values can be stored in the temporary local struct.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-12 16:41:26 -04:00
John Mulligan 08219a4492 ceph: update a cross-cluster csi configmap when mons change
Instead of requring csi instances for every ceph cluster that rook
manages, maintain one config map for all ceph clusters. This allows
for one set of csi drivers per rook operator.
The config is intialized as empty when Ceph CSI components are first
created and then updated every time a cluster's mons change.
As before clusters are identified by the k8s namespace the ceph cluster
is running in.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-12 16:41:26 -04:00
John Mulligan 17fad8e958 ceph: plumb a mutex for csi config map updates through the application
Create a mutex at the rook operator level that will be used when
updating the shared-between-clusters config map that Ceph CSI consumes.
Pass the mutex down to the function that will update the CM.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-12 16:41:26 -04:00
John Mulligan 76abdc2ae4 csi: set csi global vars to false by default
Thes values being defaulted "on" cause issues with some of the units
tests but add no additional value to the normal rook ceph binaries
because they are immediately overwritten by the values set on the
command line (and env).

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-12 16:41:26 -04:00
John Mulligan 6920bb2915 ceph: add a new utility function for updating csi config map content
Add a new function that, given existing config string, key, and current
mons, will return an updated version of the Ceph CSI config string
having updated the data with the new mons.
Add a unit test function for the update function.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-12 16:41:26 -04:00
rohan47andAshish Ranjan d2f52aebe5 Adds support for storageClassDeviceSet in rook-ceph operator
- Added code to support StorageClassDeviceSet spec provided in the cluster-on-pvc.yaml
- The code reads the StorageClassDeviceSet spec and creates pvc based on the ‘count’ field for each device set.
- OSD prepare job is started for each PVC which activates the ceph-volume on each PVC
- Finally OSD is started on each of the PVC device.

Co-authored-by: rohan47 <rohgupta@redhat.com>
Co-authored-by: Ashish Ranjan <aranjan@redhat.com>
Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2019-08-12 09:24:13 -06:00
Travis Nielsen 1af377ae12 Merge pull request #3592 from ethan-daocloud/patch-3
mgr.go: logging error message typo
2019-08-12 07:30:49 -06:00
ethan f8760a31e3 mgr.go: logging error message typo
mgr.go: make error message more clean by split words

Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
2019-08-11 09:59:20 +08:00
Travis Nielsen a3bdccefb6 Merge pull request #3581 from jmolmo/issue-3564
Memory limit checked if it really exists
2019-08-09 10:58:45 -06:00
Noah Watkins 05cd7ae700 ceph: when mons use pvc mount volume at subpath
when the root of a filesystem mode pvc is mounted as the base data directory
for the monitor it will not be empty: `lost+found` from ext4 will be present.
this causes the mon mkfs to fail because it expects an empty directory.

the solution is to mount under a directory in the source volume.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-08-08 16:30:04 -07:00
Noah Watkins d49fd57252 ceph: chown with init container
the life cycle post-start hook is used to chown the ceph daemon log
directory. however, hooks are not guaranteed to run before a container
entry point.

"Kubernetes sends the postStart event immediately after the Container is
created. There is no guarantee, however, that the postStart handler is
called before the Container’s entrypoint is called"

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-08-08 16:29:29 -07:00
Juan Miguel Olmo Martínez 0db62c86d2 Allow to launch pods when memory request is set (but no memory limit) in cluster CRD file
With this change the memory limit is only checked if it has been set
explicitely in the cluster CRD file.
This allow the pod to be created following the Burstable QoS strategy.

Before this change an error was raised (error trying to get the memory
limit) in the spec.CheckPodMemory function and the pod with only a 'memory request' set, was not able to start.

Resolves: #3564

Signed-off-by: Juan Miguel Olmo Martínez jolmomar@redhat.com
Signed-off-by: Juan Miguel Olmo Martínez <jolmomar@redhat.com>
2019-08-08 11:52:55 +02:00
Travis Nielsen 0a79c82543 Merge pull request #3562 from travisn/enable-csi-driver
Enable the ceph-csi driver by default
2019-08-07 11:53:17 -06:00
travisn da8332a223 automatically create the csi secret with the cluster
The CSI driver requires the ceph key for administrating
the cluster. The key is stored in a secret and specified in the
storage class. The operator will now automatically generate
a secret named rook-ceph-csi that can be specified by
default in the storage class instead of requiring the
admin to create it.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-07 10:01:29 -06:00
travisn 7b0a7fbfeb allow the discovery daemon to be optional
The discovery daemon is only necessary to be run when
OSDs are being created on raw devices and detect when
new devices are added to the cluster. If OSDs do not need
to be configured on devices, the discovery daemonset
has no need to be started.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-07 10:01:29 -06:00
travisn af72af0633 add option to disable flex driver
The flex driver does not need to be started if
only the CSI drivers are going to be used. Therefore,
we allow the admin to stop launching the rook flex
agent with the setting ROOK_ENABLE_FLEX_DRIVER in
operator.yaml

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-07 10:01:26 -06:00
travisn 0a3fbf62f3 enable the ceph-csi driver by default
CSI is now the preferred storage driver for Rook.
By default both the CSI and flex drivers will be started
by the operator. In a future release the flex driver
will be deprecated, but for now is still supported.

The drivers can be disabled with an environment
variable in the operator deployment in operator.yaml.
If users are only using one driver or the other there is
no need to enable both drivers.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-07 10:00:41 -06:00
Dmitry Yusupov 1f8bd1f431 Merge pull request #3571 from ethan-daocloud/patch-2
logging message typo fix
2019-08-06 10:44:36 -07:00
sabbot 11160a8720 Add validation and extra columns to EfgeFS CRDs
Signed-off-by: sabbot <sabbotagge@gmail.com>
2019-08-06 19:26:00 +03:00
ethan 524c508f3b logging message typo fix
Signed-off-by: ethan <guangming.wang@daocloud.io>
2019-08-05 22:13:33 +08:00
Travis Nielsen 7fb43d72eb Merge pull request #3546 from noahdesu/mon-pvc
ceph: base monitor storage of pvc
2019-08-02 22:25:57 -06:00
Noah Watkins 4173c5544e ceph: base monitor storage of pvc
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-08-02 10:30:23 -07:00
Michael Vollman f3ef680298 ceph: Add support for per OSD metdataDevices
Add ceph-volume support for per OSD metdataDevices

Signed-off-by: Michael Vollman <michael.b.vollman@gmail.com>
2019-08-02 07:41:45 -04:00
Noah Watkins 7ef4ff63ac ceph: check that empty zone contains valid nodes
a helper flag indicating the exitence of an empty zone (empty = no
monitor pods) is computed when checking the health of the cluster in
order to determine if mons from overloaded zones have some new location
they can be scheduled. the computation of this flag did not check that
the empty zone contains valid nodes that pods can be scheduled on to.
this lead to a mon creation loop.

fixes: #3545

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-07-31 14:34:24 -07:00
Noah Watkins df20c7da17 ceph: shush device discovery log messages
fixes: #3483

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-07-31 14:34:24 -07:00
AllenZMC 4616f17a26 fix word ressource to resource
Signed-off-by: czm <zhongming.chang@daocloud.io>
2019-07-31 20:53:33 +08:00
Blaine Gardner 1b6fe840f6 Merge pull request #3460 from umangachapagain/servicemonitor-fix
fix Prometheus permissions and servicemonitor configurations
2019-07-30 11:05:12 -06:00
Blaine Gardner 9f7dbb85d8 Merge pull request #3527 from SUSE/remove-osd-copybins
ceph: osd use copy-binaries top level cmd
2019-07-30 09:41:03 -06:00
Travis Nielsen e5779f79d5 Merge pull request #3533 from ethan-daocloud/patch-1
cleanup: fix log message mis-spelled words
2019-07-29 11:14:37 -06:00
Blaine Gardner 55a726fda9 ceph: osd use copy-binaries top level cmd
Replace usage of the custom osd copybins command with the new top-level
copy-binaries command introduced with cmd-reporter.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-07-29 09:23:45 -06:00
Travis Nielsen d50c9ef3bf Merge pull request #3530 from renekalff/fix-k8s-ownerreferences
Ceph (and EdgeFS?) cluster is being deleted after K8S cluster restart or api/etcd issues
2019-07-26 18:33:16 -06:00
René Kalff 25780878eb Make the ownerreference name match the cluster name referenced
In order to cleanup all cluster resources in case of cluster deletion
all resources have an ownerreference to the cluster crd instance.
Because the name of the reference was incorrectly set to the name of the
namespace the cluster resources can unintentionally be deleted by the
kubernetes garbage collector after a kubernetes cluster anomaly.

Signed-off-by: René Kalff <r.kalff@intermax.nl>
2019-07-26 18:33:38 +02:00
ethan 3a6bef33df cleanup: fix log message mis-spelled words
Signed-off-by: ethan <guangming.wang@daocloud.io>
2019-07-26 16:40:48 +08:00
Umanga Chapagain d30c06860d fixes permissions and servicemonitor configurations
this adds the access for rook to create monitoring resources
across namespaces and provides servicemonitor config to
monitor the current service being created

Signed-off-by: Umanga Chapagain <chapagainumanga@gmail.com>
2019-07-26 10:53:18 +05:30
Nick McKinney d9aec6bad6 Allow control over K8s service type via CRD
Signed-off-by: Nick McKinney <nmckinney@breakpoint-labs.com>
2019-07-25 15:49:18 -04:00
Blaine Gardner 6d2ef93669 Merge pull request #3443 from SUSE/nfs-refactor
Ceph NFS: use new config
2019-07-25 09:39:50 -06:00