Commit Graph
748 Commits
Author SHA1 Message Date
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
travisn 3142c3e5cb simplify CR status updates for ceph and edgefs
The status messages on the CRs had much duplicated code
for logging an error if the status update failed.
Now any failures around the status update are logged
consistently within the updateClusterStatus method
so there is no need to return an error and duplicate
the error handling everywhere.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-07-24 12:52:30 -06:00
Sébastien Han e52efdb8d4 ceph: mgr fix startup
Because the manager is running under the 'ceph' user the cephfs
subvolume plugin can not create directories anymore. It fails with a
permission denied because of the usage of the 'ceph' user, root is need
here, hence the special startup line to go over this.

Closes: https://github.com/ceph/ceph-csi/issues/486
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-24 17:47:43 +02:00
Dmitry Yusupov e454b12af3 Merge pull request #3505 from sabbot/EdgeFS-3492
Add mgr pod liveness probe
2019-07-23 12:41:26 -07:00
Anton Skriptsov 3952874ae1 Add mgr pod liveness probe
Signed-off-by: Anton Skriptsov <sabbotagge@gmail.com>
2019-07-23 11:25:19 -07:00
Alexander Trost 93716bcde8 fix usage of Infof in CephClusterController (#3502)
fix usage of Infof in CephClusterController
2019-07-23 19:22:45 +02:00
Alexander Trost 07fbea0fd9 fix usage of Infof in CephClusterController
Currently the ClusterController logs out a message like:
```
Cluster %s is not ready. Skipping orchestration.rook-ceph
```
without the "placeholders" fullfilled. This is because the code uses the
logger.Info() instead of logger.Infof() function.
This change fixes that to use Infof and therefore corrects the log
message.

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2019-07-23 16:08:16 +02:00
Sébastien Han fdaf3bfc9c ceph: run pod with privileged
Before each pod starts, the daemon changes the ownership of
/var/log/ceph which is bindmounted on a hostPath.

On OpenShift envionments, the container must be privileged in order to
successfully change the owernship.

Closes: https://github.com/rook/rook/issues/3485
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-23 07:43:10 +02:00
Dmitry Yusupov dc85c5083c Merge pull request #3482 from dyusupov/master
make getModifiedRookImagePath be generic and use it for isgw too
2019-07-22 11:51:44 -07:00
Dmitry Yusupov a3d02fb6ea make getModifiedRookImagePath be generic and use it for isgw too
Signed-off-by: Dmitry Yusupov <dmitry.yusupov@nexenta.com>
2019-07-22 10:07:22 -07:00
Blaine Gardner 50e824ebad Ceph: Add unit tests for nfs-ganesha spec
Ganesha isn't a true "Ceph" daemon, so some of the sharable pod spec
testing functionality is teased out of the operator/ceph/test library
and a simple operator/test library is created. The ceph/test library is
updated to use the operator/test library when possible/appropriate.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-07-22 11:06:04 -06:00
Blaine Gardner e75254f412 ceph: add missing DaemonDataPathMap unit test
Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-07-22 11:06:04 -06:00
Blaine Gardner aa0d3346f2 ceph nfs: refactor to use new config pattern
Refactor the Ceph NFS (Ganesha) daemon to use the new config pattern.

Use of a custom Rook binary to run NFS has been removed in favor of
instead running the required DBUS process as a sidecar. The effect here
is that the NFS Ganesha container itself may fail and restart a few
times before the DBUS sidecar is running.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-07-22 11:06:04 -06:00
Blaine Gardner d774fec858 Merge pull request #3470 from rohantmp/fixTopologyAware
Fix: topologyAware does not pick up failure domains.
2019-07-22 10:19:28 -06:00
Travis Nielsen e176dd1001 Merge pull request #3487 from leseb/oc-privileged
ceph: mon: init chown for openshift
2019-07-22 08:14:19 -06:00
xieyanker 7672582e0a Correct typo about skipVolumeForDirectory's code comment
Signed-off-by: xieyanker <xjsisnice@gmail.com>
2019-07-22 19:05:14 +08:00
Sébastien Han c2b85ba33c ceph: mon: init chown for openshift
OpenShift environment requires privileged containers when interacting
with the host filesystem, typically via dataDirHostPath.
The init container that changes the ownership of dataDirHostPath was
missing the privileged flag and users were getting permission denied
errors on the chown command.

Fixes: https://github.com/rook/rook/issues/3485
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-22 11:07:29 +02:00
Rohan CJ 747619180c Fix: toplogyAware does not pick up failure domains.
Properly initialize c.validStorage, and ensure that it is used
for provision config from then on.

Signed-off-by: Rohan CJ <rohantmp@gmail.com>
2019-07-19 18:38:16 +05:30