Commit Graph
3195 Commits
Author SHA1 Message Date
Michael Fritch fbf9f95378 docs: Add Clarity to Ceph CRDs
- Improve readability of 'Replicated' and 'Erasure Coded' sections
- Clarify replicated sample requires 1 OSD located on 3 different nodes
- Add whitespace to 'Pool Settings' section
- Add link to the k8s 'StorageClass' concept
- Rename instances of 'object store' as literal
`CephObjectStore`
- Rename instances of 'object store user' as literal
`CephObjectStoreUser`
- Other minor verbiage and syntax clean-up

Signed-off-by: Michael Fritch <mfritch@suse.com>
2019-08-13 10:24:19 -06:00
Sébastien Han d7716aba47 Merge pull request #3373 from phlogistonjohn/jjm-csi-one-per-operator
Ceph-CSI: maintain one csi configuration per operator
2019-08-13 14:04:21 +02:00
John Mulligan a756d5a039 ceph csi: add back missing import
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-13 06:42:22 -04:00
Madhu Rajanna 471562c753 Resource cleanup in csi tests
Added code to delete secret, cephfs
and rbd pools and to delete cephfs
and rbd storage class.

delete rbd and cephfs pod,pvc

skip CSI test if kube version is less than 1.13.0

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-08-13 06:42:22 -04:00
John Mulligan 6ea24c8b39 ceph csi: use namespace prefix in the storageclass test yaml
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-13 06:42:22 -04:00
John Mulligan c22c9f10c3 ceph csi: add temp filesystem for keys to csi test templates
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-13 06:42:22 -04:00
John Mulligan 0a6ee2e072 ceph csi: add missing config map to csi test templates
Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-13 06:42:22 -04: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
Travis Nielsen e6da8ab08f Merge pull request #3601 from Madhu-1/sc-xfs
Add xfs fstype as default type in storageclass
2019-08-12 23:40:48 -06: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 4f9333bff7 ceph csi: switch templates to new cross-cluster config map
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
Sébastien Han ae39f3050b Merge pull request #3566 from giorgio076/patch-1
ceph: Update Pod Security Policy definition
2019-08-12 17:51:17 +02:00
Travis Nielsen 1bb8a5dcd9 Merge pull request #3451 from rohan47/pvc_for_osd
OSD:  Support for arbitrary PersistentVolumes as backing storage
2019-08-12 09:47:22 -06:00
Ashish Ranjanandrohan47 157975d7bf Updated documentations and release notes for StorageClassDeviceSets
- Updated Ceph Cluster CRD docuementation on how to use StorageClassDeviceSets to create OSD on PVC with examples CRD
- Updated the release notes with the new StorageClassDeviceSets functionality.

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:25:41 -06:00
Ashish Ranjanandrohan47 22c3495136 added yaml files for StorageClassDeviceSet
- Added cluster-on-pvc.yaml manifest file which describes StorageClassDeviceSet spec that a user can use to create OSD on PVC.

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:14 -06: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
Blaine Gardner 87e6b998d2 Merge pull request #3558 from krig/doc-fixes
Documentation (Ceph): Fix typos and formatting
2019-08-12 09:07:53 -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
Madhu Rajanna 0abacc8738 Add xfs fstype as default type in storageclass
we have seen better performance in device format and
mounting by setting the fstype to xfs
from default ext4.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-08-12 13:55:25 +05:30
Kristoffer Grönlund 71e51bf0a0 Documentation (Ceph): Fix typos and formatting
Mostly minor spelling mistakes and formatting cleanups.

Signed-off-by: Kristoffer Grönlund <kgronlund@suse.com>
2019-08-12 10:08:20 +02: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
Travis Nielsen 207dad2523 Merge pull request #3594 from noahdesu/mon-pvc-root-dir-fix
ceph: fix monitor pvc storage on ebs
2019-08-08 23:23:14 -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 9e1a9f6274 Merge pull request #3567 from travisn/osd-cluster-rbac
Add CephCluster RBAC to the OSD service account
2019-08-07 15:04:22 -06:00
travisn 1d22146080 add CephCluster RBAC to the osd service account
In order for the osd service account to reference the
cephcluster CR in the owner references, OpenShift requires
access to the CephCluster CRD. This adds the minimal changes
needed to appease OpenShift.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-07 11:59:52 -06: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 63e6029e82 remove csi default settings from yaml
The version of the csi driver to be installed that is officially
supported is the default baked into rook. If a different version
needs to be specified, it is officially unsupported. Therefore,
we leave the csi driver version settings unspecified in operator.yaml
so we can officially support the defaults.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-07 10:00:55 -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
Dmitry Yusupov 8b3379f3c2 Merge pull request #3561 from sabbot/Additional-validation
Add validation and extra columns to EfgeFS CRDs
2019-08-06 10:43:43 -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
giorgio076 dcd7c85a16 ceph: fix PSP allowedHostPaths syntax
If you try to uncomment items under 'allowedHostPaths:' and load the file you get an error.
Correct with right syntax, allowedHostPaths need pathPrefix

Signed-off-by: giorgio076 <51814334+giorgio076@users.noreply.github.com>
2019-08-06 08:13:26 +02: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
Travis Nielsen ec3102a6e7 Merge pull request #3475 from noahdesu/ceph-mon-pv-design
design: ceph mon pv design
2019-08-02 22:07:52 -06:00
travisn bdeddd4995 add CephCluster RBAC to the osd service account
In order for the osd service account to reference the
cephcluster CR in the owner references, OpenShift requires
access to the CephCluster CRD. This adds the minimal changes
needed to appease OpenShift.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-02 17:00:26 -06:00