Commit Graph
382 Commits
Author SHA1 Message Date
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
Sébastien Han 2bd017102b ci: add retry when deleting rbd image
Sometimes the image still has watchers so let's retry the deletion.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-04-15 09:12:57 +02:00
Sébastien Han d16cebea70 ci: modify upgrade to master
We now install 1.2 by default, then we upgrade from 1.2 to 1.3 and 1.3
to master.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-04-15 09:12:57 +02: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
Travis Nielsen c4e712bbd2 tests: convert cli params to env vars
The command line flags parsing inside an init() method was causing
issues at runtime when trying to add certain new features, which
is a limitation of the flag parsing. We now move away from using
any command line flags in the tests and only use environment variables
to simplify adding new parameters to the tests.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-04-14 07:29:18 -06:00
Satoru Takeuchi 6a09cc0177 ceph: remove unnecessary lvremove in test
LVs in a VG are removed with vgremove. So lvremove before vgremove
is not necessary.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2020-04-13 14:49:05 +09:00
Satoru Takeuchi 7e4f32790d ceph: prevent pre-exisiting lvms from wipe
Ceph integration test tries to wipe all lvms including
the ones that are not related to this test.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2020-04-07 14:09:00 +00: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
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
Santosh Pillai 1673291589 ceph: Integration Tests: moving GetCleanupPod() and GetCleanupVerificationPod() methods out of CephManifests interface
The CephManifests interface is intended for manifests that install the product (RBAC, CRDs, operator, etc). These cleanup methods are more about test code. The test code needs to behave the same whether it is a normal install or an upgrade. We don't need to version it differently for upgrades between the CephManifestsMaster and CephManifestsV1_1 implementations

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2020-04-03 13:54:52 +05:30
Santosh Pillai e1a76bfb96 ceph: Cluster CleanupPolicy: Delete correct mon directories under the dataDirHostPath
In case of multiple clusters, we don't want to delete all the mon directories under the dataDirHostPath during cluster cleanup.
This PR deletes the mon directory only if the montior secret key matches.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2020-04-03 10:01:36 +05:30
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
Travis Nielsen 360e5552b6 ceph: run integration tests against octopus
With the release of Octopus we need to run the integration tests
on Octopus in order to have validation as a supported platform.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-30 13:32:47 -06:00
Santosh Pillai 2bfd7c42bc ceph: cleanup cluster.Spec.DataDirHostPath on cluster deletion
In order to ensure proper clean up of all the rook-ceph data when the cluster is deleted, we need to clean up the dataDirHostPath (var/lib/rook)

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2020-03-30 19:36:01 +05:30
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
Travis Nielsen bef11804b8 flex: enable flex driver in the integration tests
The flex agent was mistakenly disabled in the CSI config change
in this PR: https://github.com/rook/rook/pull/5032. The agent must
be enabled for integration tests.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-27 16:26:22 -06:00
Sébastien Han 6f70c9bd5a Merge pull request #5101 from cybozu-go/check-lv-availability
ceph: check LV availability by "ceph-volume lvm list"
2020-03-27 16:43:48 +01:00
Travis Nielsen cf7a910df6 Merge pull request #5062 from travisn/test-14.2.8
Run Ceph integration tests on latest nautilus
2020-03-27 09:21:28 -06:00
Travis Nielsen 9cecf9e4d5 ceph: better attempt in integration tests to wipe the disks
The integration tests are failing to run when the disks
are not properly cleaned up and the bluestore label
is still found. Now we run sgdisk to more completely
zap the disk.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-27 07:51:10 -06:00
Travis Nielsen eb1e4beff8 ceph: run integration tests on latest nautilus
Run the tests on latest nautilus with the tag ceph/ceph:v14 so we
are constantly testing on the latest release.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-27 07:48:54 -06:00
morimoto-cybozu ab83738aac ceph: fix device path passed to "ceph-volume inventory"
This commit fixes the argument for "ceph-volume inventory".
When a device "/dev/mapper/foo" is being checked for its availability,
the argument should not be "/dev/foo" nor "/dev/dm-1".

Signed-off-by: morimoto-cybozu <kenji_morimoto@cybozu.co.jp>
2020-03-27 11:24:47 +00: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
Sébastien Han a044b27650 ci: fix MockExecuteCommandWithOutput mock definition
With the recent exex update we missed this one.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-03-25 17:24:30 +01:00
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
Sébastien Han ca0a30f38d ceph: convert Filesystem 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/4940
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-03-19 23:34:58 +01:00
Travis Nielsen e8f9cfcb71 exec: always write commands to debug log
Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-19 07:49:54 -06:00
Travis Nielsen f2ecaa2bda exec: remove the unused actionName param
The helpers for executing a process have long required an actionName
param which is not being used. Now we remove the old param
while also cleaning up various other usages of the exec
package.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-19 07:49:53 -06:00
Travis Nielsen 84b8cdcf75 exec: simplify the exec package from unused methods and logging
The methods and arguments to the exec methods are not all used anymore.
This cleans up the methods to only what is necessary to improve
the readability and maintainability.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-19 07:49:53 -06:00
Travis Nielsen 18b0e7d295 ceph: scrub ceph commands to write actions to the log
The ceph commands are now only written to the log in debug mode.
For commands that change the system state we now ensure that
a useful log entry is written. If all the details of the ceph
commands are needed, debug logging should still be enabled.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-19 07:49:53 -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 ce1fedf884 ci: only list the images in the needed pool during cleanup
The pool cleanup only needs to happen for an individual pool.
No need to query the block images in all pools. One of the rgw
pools is periodically causing a hang when it is queried,
but there is no need to query for it when we are cleaning
up the pool tests.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-17 15:28:17 -06:00
Sébastien Han e3b3aa7702 ci: bump upgrade to 1.2.6
Let's upgrade from 1.1.9 to 1.2.6

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-03-17 15:12:41 -06: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 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
Travis Nielsen dabf0b6618 yugabyte: tests should use image built by rook
The integration tests for yugabyte were pointing to an image
outside of the rook repo. Since that image changed unexpectedly
it broke the rook integration tests. The tests need to use
the image built by rook.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-11 17:44:05 -06:00
Sébastien Han fd33d64b4f ci: do not hide pool deletion error
Print the error if any.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-03-06 14:35:23 +01:00
Travis Nielsen 5ea5674f71 ceph: gather operator logs on pool test failure
The operator logs are necessary for troubleshooting why the
pools may still exist at the end of the integration tests.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-05 15:39:41 -07:00
Travis Nielsen 4ce9b45ffd ceph: remove dead test code for cluster purging
Cluster purging is no longer called, therefore can be removed.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-05 15:39:39 -07:00
Sébastien Han 9a5bd4f9d5 ci: add more verbosity
If pools are found, let's print them.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-03-05 12:37:44 -07: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
Travis Nielsen 8493f9bc64 ceph: nautilus tests run on 14.2.7 instead of latest release
The CI is failing currently in the OSD-on-pv scenario due to a change
in v14.2.8. Until that is resolved, we need to unblock the tests
by running against v14.2.7.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-03-05 12:01:47 -07:00