Commit Graph
578 Commits
Author SHA1 Message Date
Sébastien Han f27fd207ce ceph: convert the CephCluster controller to the controller-runtime
This is the final conversion to controller-runtime conversion. This time the
CephCluster CRD has been converted to use the controller-runtime
library.
The controller incorporates all the previous watchers too, so the Node
and hot-plug configmap are been watched too.
Only the operator setting configmap is not being watcher since it's not
related to the CephCluster CRD.
Not only the patch converts to controller-runtime but also tries to
re-organize the tree of the repo to actually make the code more
readable and have better functions/methods/tests separations.

Closes: https://github.com/rook/rook/issues/4939
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-04-28 09:40:35 +02:00
Blaine Gardner 2bf340ff0b ceph: append 00 to rook-privileged PSP name
Adding seccomp annotations to the PSP has made Kubernetes start choosing
the recommended Kubernetes "default" PSP over the Rook privileged PSP,
causing operator start errors. Append 00 (double zero) to the beginning
of the PSP name to make sure it is one of the first PSPs checked by
Kubernetes and will be matched before the "default" one.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2020-04-24 10:21:19 -06:00
Travis Nielsen af09c308df Merge pull request #5297 from binoue/update-helm-chart
ceph: update helm chart manifests
2020-04-23 13:40:50 -06:00
Travis Nielsen 946673f3e1 Merge pull request #5305 from travisn/cluster-test-example
Restore the cluster-test.yaml example
2020-04-23 10:16:35 -06:00
Travis Nielsen 5789c2b197 Merge pull request #5289 from Madhu-1/csi-v2.1.0
CSI: update cephcsi to v2.1.0
2020-04-23 07:49:23 -06:00
binoue 18cde4596c ceph: update helm chart manifests
Currently, helm chart is little outdated and has differences with
example/common.yaml.
This commit modifies both manifests to use same resources.

Signed-off-by: binoue <banji-inoue@cybozu.co.jp>
2020-04-23 14:21:32 +09:00
Travis Nielsen 9d01f92d2c ceph: restore the cluster-test.yaml example
The cluster-test.yaml example is useful for small test clusters
where only one mon is required and certain settings can be disabled
when not running in production.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-04-21 15:41:39 -06:00
Travis Nielsen f8ffd2c2eb ceph: toolbox job for running a ceph script
As another option to run Ceph commands, a script can be executed
with Ceph commands as if running in the toolbox, but will instead
run in a job where the logs can be collected and analyzed
separately. This would be useful where automation is in place to collect
information about the cluster periodically or upon some failure
that is detected, without requiring an interactive shell.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-04-20 15:48:59 -06:00
Madhu Rajanna 5684c4cc37 CSI: update cephcsi to v2.1.0
cephcsi v2.1.0 is released and doesnot need any deployment
template changes. This PR updates the cephcsi image
version to v2.1.0

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-04-20 14:58:25 +05:30
Sébastien Han 7c994441c3 ceph: make admin key optional for external cluster
Currently, we need to configure the Ceph external Admin keyi
in the Rook deployment to be able to connect to an external Ceph cluster.
If we wanted to run in a multi-tenant fashion
were several K8s/Rook clusters wanted to connect to the same external ceph cluster,
each K8s deployment would have the access to the External Ceph Admin key
and could potentially access or delete the Data
from pools that belong to other k8s/Rook Clusters.

Now the admin key is optional but the helper script create-external-cluster-resources.sh
will help create the necessary keys/users to connect to that cluster.

Closes: https://github.com/rook/rook/issues/4917 and https://github.com/rook/rook/pull/5227
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-04-20 09:59:04 +02:00
Travis Nielsen 348690ea64 ceph: update defaults to the ceph v14.2.9 release
With the release of ceph v14.2.9 we set the default examples to this version.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-04-17 12:54:06 -06:00
Travis Nielsen 1c1591c847 Merge pull request #5261 from cybozu-go/missing-requiresafereplicasize
Ceph: Add requireSafeReplicaSize in CephObjectStore CRD
2020-04-16 10:44:46 -06:00
zoetrope babb55cc15 ceph: add requireSafeReplicaSize to CRD
add requireSafeReplicaSize field to CRD in upgrade-from-v1.2-crds.yaml and ceph_manifets.go

Signed-off-by: zoetrope <a.ikezoe@gmail.com>
2020-04-16 15:18:00 +09:00
Suraj Deshmukh 2f6205b2f6 PSP: Add seccomp annotations
This commit adds seccomp annotations to the PSP shipped with Rook
Operator. In this way the operator when deployed will be more secure and
will only be allowed the syscalls defined the runtime's seccomp profile.

Signed-off-by: Suraj Deshmukh <surajd.service@gmail.com>
2020-04-15 20:10:30 +05:30
zoetrope f00092de73 ceph: Add requireSafeReplicaSize in CephObjectStore CRD
Add requireSafeReplicaSize field in CephObjectStore CRD.

Closes: https://github.com/rook/rook/issues/5260
Signed-off-by: zoetrope <a.ikezoe@gmail.com>
2020-04-15 17:01:16 +09:00
Sébastien Han c1b8a7aa9e ceph: extract rbd-mirror to its own crd
Previously, the rbd-mirror daemon was integrated into the `CephCluster`
CRD. This wasn't really practical since we would have to wait for the
whole orchestration to be done to actually set it up. The same goes for
any CR update. Let's say you want to change the number of daemons, Rook
would go through mons, mgrs and osds until it get to rbd-mirror.
This triggers an undesired full orchestration.

With its own CRD this component just gains a lot more flexibility.

Closes: https://github.com/rook/rook/issues/5084
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-04-15 09:12:56 +02:00
Dmitry Yusupov afd8398a6b Merge pull request #5165 from dyusupov/master
edgefs: support for SMB CRD
2020-04-03 14:18:14 -07:00
Dmitry Yusupov 4920202c10 edgefs: support for SMB CRD
Signed-off-by: Dmitry Yusupov <dmitry.yusupov@nexenta.com>
2020-04-03 13:15:14 -07:00
Travis Nielsen 948c0328bd Merge pull request #5162 from travisn/csi-v2.0.1
Enable the Ceph CSI v2.0.1 driver by default in Rook
2020-04-03 13:31:59 -06:00
Travis Nielsen b8e0d8902c Merge pull request #4077 from leseb/rook-multus
ceph: add multus support
2020-04-03 11:14:08 -06:00
Travis Nielsen b1825db09d ceph: install CSI driver v2.0.1 by default
With the release of the CSI v2.0.1 driver, this should now be the
default driver deployed by Rook. The minimum driver version
supported is still v2.0.0

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-04-03 11:08:19 -06:00
Chu Yong Mark Lee a018d89d9c csi: Update cephcsi driver to v2.0.1
Update cephcsi driver to v2.0.1 to allow nodes with
Ceph persistent volumes to shutdown cleanly. This requires
an additional bind mount (/run/mount) in cephfsplugin
and rbdplugin templates.

Signed-off-by: Chu Yong Mark Lee <markleechuyong@gmail.com>
2020-04-03 11:05:41 -06:00
Sébastien Han 20d1543507 ceph: add multus support
You can now use Rook along with Multus. Multus must be up and running
and the right ressources must exist such as NetworkAttachmentDefinition
CR.
The Cluster CR spec has new fields to work with multus:

network:
  provider: multus (or 'host' for hostNetworking)
  selectors:
    public: NetworkAttachmentDefinition name
    cluster: NetworkAttachmentDefinition name

If only a single NetworkAttachmentDefinition is provided Rook will use
both anyway for the Ceph traffic.

Please refer to the doc to learn more.

Closes: https://github.com/rook/rook/issues/4716
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-04-03 18:00:15 +02:00
Rohan CJ ecef80eda5 Ceph: Use both "apps" and "extensions" for deployment RBAC.
Some versions of k8s can optionally enable extensions after deprecation.
This could lead to rbac denials when trying to perform operations on deployments

Signed-off-by: Rohan CJ <rohantmp@gmail.com>
2020-04-03 19:10:45 +05:30
Satoru Takeuchi e4812f36d0 ceph: remove unnecessary whitespaces in the example
Fix the following error message due to unnecessary whitespaces.

```console
$ kubectl create -f cluster-on-pvc.yaml
error: error parsing cluster-on-pvc.yaml: error converting YAML to JSON: yaml: line 85: mapping values are not allowed in this context
```

Closes: #5149
Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2020-04-02 21:36:22 +00:00
Travis Nielsen c79325f92c Merge pull request #5138 from cybozu-go/support-topology-spread-constraints
ceph: support topoplogySpreadConstraints
2020-04-02 12:00:45 -06:00
Satoru Takeuchi 06b10e248c ceph: support topoplogySpreadConstraints
Support topologySpreadConstraints to spread OSD pods among failure
domains as even as possible.

https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/

Without this feature, the number of OSD pods would be different
between the failure domains very much. At worst, there is
a possibility that a failure domain has many OSDs and other
failure domains have no OSDs. It can partly be mitigated
with podAntiAffinity. However, it only works if there are at most
one OSD per node. For more detail, please refer to the following
document.

https://github.com/rook/rook/blob/master/cluster/examples/kubernetes/ceph/cluster-on-pvc.yaml#L59

Closes: https://github.com/rook/rook/issues/4387
Signed-off-by: Hiroshi Muraoka <h.muraoka714@gmail.com>
Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2020-04-02 16:40:58 +00:00
Blaine Gardner 9d41b38095 Ceph: upgrade docs: update upgrade docs for v1.3
Update both documents and `upgrade-from-v1.2*.yaml` files for Rook v1.3
release.

Of note:
- note when the upgrade to CSI driver v2.0 should be updated
- note that CSI image envs can be removed to have Rook use defaults
- update Ceph version upgrade section
- update supported Ceph version info
- update CRDs before upgrade b/c new 'status' fields
- remove special CSI update info left from v1.2

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
(cherry picked from commit 2ccff83d94)
2020-04-02 10:26:00 -06:00
ShyamsundarR de97b6a1d6 ceph: Add ability to specify compression mode for pools
This commit enables configuring a compression_mode for pools
that takes the values as specified for bluestore OSD
compression_mode values,
https://docs.ceph.com/docs/master/rados/configuration/bluestore-config-ref/#inline-compression

Signed-off-by: ShyamsundarR <srangana@redhat.com>
2020-04-01 14:24:30 -04:00
Elise Gafford 2ca0d8f93d ceph: add cleanupPolicy to cephcluster spec
In order to perform full automation of cephcluster deletion safely
and protect against catastrophic data loss, the end user must be
able to signify that they intend to irrecoverably delete the data
in their cluster. The cleanupPolicy field of the cluster spec is
intended to communicate this. This patch does not implement
automated deletion, but only creates the spec field and the
safety feature of halting orchestration other than deletion on a
cluster with a set cleanup policy value.

Partially-fixes: #3222
Signed-off-by: Elise Gafford <egafford@redhat.com>
2020-03-30 19:11:54 +05:30
Adler Fleurant 70e7f39db0 ceph: Removed 2nd env variable ROOK_HOSTPATH_REQUIRES_PRIVILEGED
It is not necessary to have 2 same environment variables and not desired as
changing only one may lead to the second variable being applied with unexpected
value. It is better to have only 1 ROOK_HOSTPATH_REQUIRES_PRIVILEGED environment
variable.

Closes: https://github.com/rook/rook/issues/5107
Signed-off-by: Adler Fleurant <Adler.Fleurant@PicoChange.com>
2020-03-30 07:50:30 -04:00
Umanga Chapagain 0e932c15eb Ceph: add CSI configurations to ConfigMap
This commit adds all the CSI configurations to ConfigMap.
This configMap can be used in combination with Env Vars
to configure Ceph CSI drivers in rook.

Signed-off-by: Umanga Chapagain <chapagainumanga@gmail.com>
2020-03-27 15:17:30 +05:30
Travis Nielsen da3bf49b61 Merge pull request #5043 from cybozu-go/remove-unnecessary-napespace-fields
remove unnecessary namespace fields
2020-03-20 17:18:21 -06:00
Satoru Takeuchi a5ea2858c9 manifests: remove unnecessary namespace fields
There are many namespace fields in ClusterRole{,Binding}. However,
ClusterRole{,Binding} are not namespaced. So we can remove these.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2020-03-18 15:58:31 +00:00
Travis Nielsen 5702d29a3c Merge pull request #5033 from leseb/clarify-block-pool
ceph: update pool.yaml with more options
2020-03-18 08:28:24 -06:00
Sébastien Han 9f7745e8e7 ceph: update pool.yaml with more options
Expose:

* crushRoot
* deviceClass

To the example pool.yaml for awareness.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-03-18 15:22:27 +01:00
Sébastien Han 08dad79832 Merge pull request #5038 from travisn/design-docs-cleanup
Design docs cleanup
2020-03-18 10:51:36 +01:00
Sébastien Han f268c897e9 ceph: Convert the Ceph ObjectStore controller to the controller-runtime
The CRD watcher has been replaced by the new controller-runtime
framework.
This brings robustness in our operator, meaning that any resources that
are modified will be reconciled into the desired state.

Closes: https://github.com/rook/rook/issues/4937
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-03-17 15:12:41 -06:00
Travis Nielsen f79bc3d6a0 noobaa: remove design docs due to inactivity
The NooBaa operator was proposed for addition to Rook, but
the team went a different direction and created an independent
operator. Removing the stale docs.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-17 14:30:56 -06:00
Travis Nielsen 2c70e10bd6 docs: add cluster-on-pvc and remove cluster-minimal examples
The cluster-minimal.yaml example is more confusing than helpful. Most users
seem to think that minimal includes a fully working cluster with OSDs.

The cluster-on-pvc.yaml example is frequently used and was missing from the
examples doc.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-16 15:13:56 -06:00
Travis Nielsen 9c5c78cf01 Merge pull request #5025 from jmolmo/blinking_lights
Ceph: Added rook manager module rights for read pod logs
2020-03-16 13:57:13 -06:00
Travis Nielsen 017a560db3 Merge pull request #5021 from samkulkarni20/yb-mem-limits
YugabyteDB: Add resource limits to YugabyteDB pods
2020-03-16 11:12:07 -06:00
Juan Miguel Olmo Martínez c87a01bb8c Ceph: Added rook manager module rights for read pod logs
This is needed to allow the ceph manager rook module to read the output
of the <lsmcli> command used to switch disk identification light on/off on
physical disk devices

[test ceph]

Signed-off-by: Juan Miguel Olmo Martínez <jolmomar@redhat.com>
2020-03-16 18:03:23 +01:00
Sameer Kulkarni 909770a346 YugabyteDB: Add resource limits to YugabyteDB pods
Current YugabyteDB operator code creates Master and TServer pods without any resource requests/limits (specifically CPU and memory).
This causes the operator to run into soft/hard memory limit issue. The fix adds recommended resource requests and limits as defaults to the pods it creates.

Closes: https://github.com/yugabyte/yugabyte-db/issues/3884
Signed-off-by: Sameer Kulkarni <samkulkarni20@gmail.com>
2020-03-14 12:23:14 +05:30
Travis Nielsen 7de388ce92 ceph: grant access to the mgr to delete pods
The Ceph mgr modules need access to restart the daemon pods
when the configuration changes for the daemons.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-13 17:08:27 -06:00
Sébastien Han 14cb46ae39 ceph: bump to 14.2.8
Ceph 14.2.8 just got released so let's use it.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-03-11 19:32:48 +01:00
Sébastien Han 9a8d539d57 ceph: use crd subressource
The .metadata.generation field is updated if and only if the value at the .spec subpath changes.
Additionally, if the spec does not change, .metadata.generation is not updated.
This is a must-have for the controller-runtime work, if we don't have
this, the generation field will always be incremented, resulting in a
endless reconcile loop.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-03-05 12:37:44 -07:00
Stefan Haas b3cc4aeb44 ceph: ceph-csi version detection #3824
Checks the version of the configured ceph-csi image while starting the operator. The operator will fail if the image is not supported.
Added an additional parameter to operator to disable the check e.g. to test not yet supported csi images.

Signed-off-by: Stefan Haas <shaas@suse.com>
2020-02-28 14:14:40 +01:00
Sébastien Han dab9233c8b ceph: add CRD setting for pool size 1
As of Octopus, Ceph will prevent you from creating a pool with a
replica size of 1. Allowing such pool could lead to data loss, so enable
the new option: requireSafeReplicaSize: false if you are **ABSOLUTELY**
certain that is what you want.

Closes: https://github.com/rook/rook/issues/4889
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-02-25 16:28:58 +01:00
Sébastien Han 5ca4880ed0 Merge pull request #4888 from leseb/pvc-hybrid-dev-class
ceph: set crush device class via annotations on PVC
2020-02-25 14:07:22 +01:00