Commit Graph
743 Commits
Author SHA1 Message Date
Renan Campos ad9dcb0c05 ceph: periodically prune crash entries older than user-provided days
Rook's crashcollector pod posts entries to the ceph cluster when a crash occurs.
Over time the number cluster may hold crash entries needlessly.
To clean up old crash entries, this PR adds a field to the ceph cluster CR for the user to specify the number of days a crash entry should be kept for.
Providing a value for the field keepXDays creates a cronjob that runs every day at midnight, calling "ceph crash prune <keepXDays>".

Closes: https://github.com/rook/rook/issues/6332
Signed-off-by: Renan Campos <rcampos@redhat.com>
2020-11-24 17:06:18 -05:00
Sébastien Han f86f8300f9 Merge pull request #6568 from aruniiird/upgrade-dependencies-for-operator-sdk-1.x
Bump Controller Runtime version to 0.6
2020-11-19 17:45:18 +01:00
Travis Nielsen 54560250e9 Merge pull request #6497 from sp98/osd-pdb-reconciler
ceph: OSD PDB reconciler changes
2020-11-18 17:30:24 -07:00
Arun Kumar Mohan 65d16bfc94 ceph: manual changes needed for kubernetes api updates
Fetched latest lib-bucket-provisioner changes as well.

Signed-off-by: Arun Kumar Mohan <amohan@redhat.com>
2020-11-18 21:14:01 +05:30
Sébastien Han 4545ddc11f Merge pull request #6666 from leseb/fix-6580
ci: fix device intermittent failure
2020-11-18 15:39:15 +01:00
Sébastien Han a08e08104b Merge pull request #6553 from leseb/mirroring-snap-sched
ceph: add snapshot scheduling for mirrored pools
2020-11-18 15:34:55 +01:00
Santosh Pillai 8602b9c116 ceph: osd pdb reconciler changes
-creates a single PDB (max-unavailable=1) for all OSDs.  This PDB allows one OSD to go down at a given time.
-When a drain is detected, blocking PDBs (max-unavailable=0) will be created for each failure domain that is not being drained and the main PDB (max-unavilable=1) will be deleted. This will allow all the OSDs in the currently drained failure domain to be removed while blocking the deletion  of OSDs in other failure domains.
-Once the PGs are healthy again, the blocking PDBs will be deleted and the main PDB will be restored.
-Add PG healthcheck timeout
-Delete any legacy node drain pods and blocking OSD PDBs

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2020-11-18 18:25:07 +05:30
Sébastien Han 38e475601b ci: probe the device and wait for udev
When we are done creating the partitions it's good to give the kernel
some time to reprobe the device and for udev to finish syncing up.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-11-18 12:16:14 +01:00
Sébastien Han dcd84e63ac ci: use sudo test if the device is a block
Permissions on the disk might changed due to the partitions being
created. So the CI user is not able to read the device correctly.

Closes: https://github.com/rook/rook/issues/6580
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-11-18 12:15:57 +01:00
Sébastien Han afc7ecff31 ceph: add snapshot scheduling for mirrored pools
Now, we can schedule snapshots on pools from the CephBlockPool CR when
the pool is mirrored.
It can be enabled like this:

```
mirroring:
  enabled: true
  mode: pool
  snapshotSchedules:
    - interval: 24h # daily snapshots
      startTime: 14:00:00-05:00
```

Multiple schedules are supported since snapshotSchedules is a list.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-11-18 09:50:09 +01:00
subhamkrai 49a3511532 ci: manifests changes to run gh action
to run the integration test there needs
to be a few changes in manifests like using
`deviceFilter` and other related changes.

Signed-off-by: subhamkrai <srai@redhat.com>
2020-11-18 09:31:07 +05:30
subhamkrai a2d3d1d8a4 ceph: update snapshotterVersion to v3.0.0
in the integration test we still use
snapshotteVersion v2.1.0 but it's expected to
use v3.0.0.

Signed-off-by: subhamkrai <srai@redhat.com>
2020-11-16 12:10:50 +05:30
Pete Birley 152a05c85e ceph: update to helm 3 for the rook chart
This updates the chart to make use of helm3 which has been released
for some time, and also permits CRDs to be installed pror to other objects
allowing the chart to be deployed at the same time as CRs for rook objects.

Co-authored-by: Pete Birley <pete@port.direct>
Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-11-11 14:41:24 -07:00
Travis Nielsen 61539b6699 Merge pull request #6559 from BlaineEXE/upgrade-test-1.5
ceph: upgrade test Rook only from v1.4 to master
2020-11-11 10:13:39 -07:00
Travis Nielsen 6142efe14b Merge pull request #6579 from subhamkrai/nfs-log
ceph: change nfs-ganesha log level
2020-11-11 10:09:52 -07:00
subhamkrai 7d1b5f7416 ceph: change nfs-ganesha log level
this commit allows changing the default
log level from nfs.yaml file by adding
new command.

Signed-off-by: subhamkrai <srai@redhat.com>
2020-11-11 20:34:07 +05:30
Blaine Gardner 2f034824cb ceph: upgrade test Rook only from v1.4 to master
Since Rook no longer supports legacy filestore devices, there is
no need to keep testing upgrades from v1.2 all the way to master.
We can now just test v1.4 to master.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2020-11-10 15:44:05 -07:00
Travis Nielsen b9f692a56e ceph: disable the discovery daemon by default
The discovery daemon is not needed in most scenarios, therefore we disable it
by default. More and more clusters are moving to the cluster-on-pvc scenario
which certainly does not need the local discovery. Even where clusters are not
running on PVCs, the discovery is not needed since the device discovery is again
performed in the osd prepare job.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-11-10 13:16:52 -07:00
Travis Nielsen f1287bdb19 ceph: skip csi tests on k8s 1.13
The csi tests require 1.14 or newer to run

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-11-06 11:16:32 -07:00
Travis Nielsen c029b1513d ceph: remove nullable attribute from pre-1.16 schema
The nullable attribute was causing the integration tests to fail
on 1.13 and earlier where it is not supported in the schema.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit cc8f406ce9)
2020-11-06 10:47:26 -07:00
Travis Nielsen 556de488c0 nfs: skip running tests on older than k8s 1.14
NFS tests are not supported on older than K8s 1.14.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit 4adc54e6f1)
2020-11-06 10:47:26 -07:00
Sébastien Han e3d032dbc1 Merge pull request #6489 from travisn/stretch-mons
ceph: Stretch cluster configuration
2020-11-06 15:16:39 +01:00
Mateusz Gozdek 8ba3762fa4 docs: fix bunch of typos
Found by running the following command:

codespell -S .git,*.png,*.jpg -L \
aks,keyserver,atleast,dne,ser,ist,files\',ba,dum,iam,te -f -H

Signed-off-by: Mateusz Gozdek <mgozdekof@gmail.com>
2020-11-06 10:01:04 +01:00
Travis Nielsen b91f4211c9 ceph: configure a stretched cluster
In clusters where only two datacenters (or similar failure domains)
are available, a different mon and osd approach is needed to deal
with the network partitions or some other reason for one of the failure
domains going down. The Ceph stretched cluster makes the mons aware
of the failure domains by configuring one as the arbiter in a third
zone, while keeping two replicas of the data in each of the data
zoens.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-11-05 09:17:52 -07:00
subhamkrai b80d83fcfa ceph: some fields in FS CRD are missing
this commit add the missing `deviceClass` field
in filesystem CRD with replication of pool spec.

Signed-off-by: subhamkrai <srai@redhat.com>
2020-11-05 20:14:11 +05:30
Madhu Rajanna 5de2ded83c ceph: update required rbac for csi
as we are approaching the rook 1.5 release, we
are making a required RBAC changes for cephcsi ahead
of cephcsi release to provide smooth upgrade experience
for the users without any RBAC changes in rook minor release.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-11-04 12:32:08 +05:30
Travis Nielsen d674dcd88c ceph: tests use v14.2.12 due to broken osds in v14.2.13
The ceph v14.2.13 release has breaking changes for the ceph-volume batch
scenario that is preventing non-pvc OSDs from being created. In the short
term we will pin the tests to v14.2.12 and separately we will need to
address the changes needed and/or wait for a fix from ceph.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-11-03 09:30:07 -07:00
Travis Nielsen 44bf443dca Merge pull request #6495 from LalitMaganti/preserve-fs
ceph: add option to preserve filesystem on CRD deletion
2020-10-30 16:56:38 -06:00
Lalit Maganti c6aec79c4f ceph: add option to preserve filesystem on CRD deletion
Due to #6492, preservePoolsOnDelete is not useful at all for CephFS;
after the filesystem is deleted, the leftover pools cannot be
reassocaited with a newly created filesystem without wiping all
metadata. The only way we can actually preserve data is keeping around
the entire filesystem.

This commit implements a `preserveFilesystemOnDelete` option which work
similar to the existing pool preservation option but instead keeps the
whole CephFS while taking it down and removing all MDSes.

This commit also changes all documentation to refer to this new option
with the intent of essentially deprecating `preservePoolsOnDelete`. IMO,
keeping around `preservePoolsOnDelete` is actively harmful because it
lulls users into thinking their data will be safe but, in reality,
recovering from this situation is highly complex and has large potential
for data loss.

Signed-off-by: Lalit Maganti <lalitm@google.com>
2020-10-30 17:04:18 +00:00
Sébastien Han 3403776c3e ci: add more osd on pvc scenario
Add the following scenario:

* simple osd on pvc
* osd on pvc with db device
* osd on pvc with wal device
* encrypted simple osd on pvc
* encrypted osd on pvc with db device
* encrypted osd on pvc with wal device

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-10-30 16:17:10 +01:00
Sébastien Han ea1d71cbfb ceph: add vault kms support for osd encryption
When the Ceph cluster runs on PVC and the OSDs are encrypted we can
store LUKS's Key Encryption Key inside a Key Management System. Today,
Rook only supports HashiCorp Vault: https://www.vaultproject.io/

The CephCluster has now a new "security" field which will plug onto the
KMS. Here is an example:

security:
  kms:
    tokenSecretName: <name of the secret containing a Vault token, used
    to authenticate>
    connectionDetails: < a map of strings containing connection
    information>

Refer to the ceph-cluster-crd documentation to lear more.

Closes: https://github.com/rook/rook/issues/6105
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-10-30 16:16:33 +01:00
Travis Nielsen 22a1630249 Merge pull request #5483 from cloudandheat/feature/configurable-crush-root
ceph: make root= CRUSH label value configurable
2020-10-29 10:21:02 -06:00
Jonas Schäfer 7ace6ac255 ceph: make root= CRUSH label value configurable
The CRUSH map does not allow duplicate values (nor keys) for the
labels. That means that if the currently hardcoded label value
`default` occurs anywhere else in the tree (for example, because
some of the topology labels provided by the cloud provider use it),
the cluster cannot sucessfully spawn.

By giving the user control over the label value used for the root
CRUSH map label, it is possible to adapt the cluster to this
situation.

To be able to actually use the `default` value, the root=default
node which is created by default by ceph itself has to be removed;
since that node is accompanied by a replicated crush rule, we have
to remove that rule, too.

The integration tests are modified to sometimes use the custom
crushRoot (based on an arbitrary criterium) to get coverage across
the various suites. Separate tests could be added, but were not
deemed necessary at this point.

Fixes #4993.

Signed-off-by: Jonas Schäfer <jonas.schaefer@cloudandheat.com>
2020-10-29 09:22:41 +01:00
subhamkraiandtravisn 1b2c15041f ceph: update deprecated CRD apiextensions.k8s.io/v1beta1 to v1
the apiextensions.k8s.io/v1beta1 version of CustomResourceDefinition
is deprecated in Kubernetes v1.16 and will no longer be supported from
v1.19. For now, we changing only for ceph and it's related documented.

Signed-off-by: subhamkrai <srai@redhat.com>
Co-authored-by: travisn <tnielsen@redhat.com>
Signed-off-by: subhamkrai <srai@redhat.com>
2020-10-29 06:26:10 +05:30
Satoru Takeuchi 9621671e5e ci: remove an unnecessary code
Remove a workaround code of old-Jenkins-file-is-used-in-CI problem.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2020-10-21 11:08:58 +00:00
Thomas Bechtold 7eae8086e4 ceph: use get.helm.sh instead of storage.googleapis.com
To be able to switch to helm v3, helm itself needs to be downloaded from
get.helm.sh. The old location from googleapis.com will only contain
helm v2 binaries. See [1].

[1] https://helm.sh/blog/get-helm-sh/

Signed-off-by: Thomas Bechtold <tbechtold@suse.com>
2020-10-20 14:47:09 +02:00
ZhenLiu94 b83c8e9942 build: fix error when building rook in centos7
if I don't delete arg 'z' in 'tar -zxvf', compile process while return compilation fails in centos7.

Signed-off-by: ZhenLiu94 <zhenliu94@163.com>
2020-10-20 16:31:46 +08:00
Travis Nielsen 9b40f17ec4 Merge pull request #6328 from subhamkrai/test-gosec
ci: enable gosec linter in golangci-lint
2020-10-19 10:00:13 -06:00
subhamkrai cb0ca66a6b ci: enable gosec linter in golangci-lint
golangci-lint linter gosec showing more errors
than gosec gh. This commit resolve
new errors. And, removing
nosec comments from autogenerated files.

Signed-off-by: subhamkrai <srai@redhat.com>
2020-10-19 11:50:06 +05:30
Satoru Takeuchi a188a80289 ci: clarify the supported vm-driver of minikube scripts
We can't use vm-drivers other than "docker" or "none" in minikube
scripts. It's because there is no device for OSD.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2020-10-15 20:11:31 +00:00
tenzen-y 356f21569f ci: cleanup base directory code
Fix the following minor bugs.

- The wrong description of TEST_BASE_DIR environment variable.
- baseTestDir() don't handle error properly

Signed-off-by: tenzen-y <toyonomajyutushi@yahoo.co.jp>
Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2020-10-15 14:14:23 +00:00
Takashi IIGUNI 27c7146526 ci: simplify helm path setting
Download the pre-defined helm by default to make the integration test simpler.
As a result, we can make PATH/TEST_HELM_PATH environment variable optional.
In addition, the default helm path can be simplified that doesn't include arch and os.

Signed-off-by: Takashi IIGUNI <iiguni.tks@gmail.com>
Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2020-10-15 10:09:00 +09:00
Sébastien Han b70b098405 ceph: add support for stretched cluster crush rule
The pool spec has now a new property called "replicasPerFailureDomain"
which essentially represents the number of replicas to store in each
failure domain.
Assuming the failure domain is a datacenter (if the cluster is
stretched) then you will have 2 replicas per datacenter where each
replica ends up on a different host. This gives you a total of 4
replicas and for this, the "size" must be set to 4.

Closes: https://github.com/rook/rook/issues/5591
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-10-13 16:33:34 +02:00
Satoru Takeuchi 90c03c814a ci: fix tests/README to use proper test command
In local environment, We should use `go test` than the test binary
under "_output/".

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2020-10-09 22:20:09 +00:00
Satoru Takeuchi a198c44a47 ci: export findRookRoot
Export findRookRoot() because it's useful to run any scripts
besides deploy_admission_controller_test.sh. In addition,
remove the unnecessary argument of findRookRoot().

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2020-10-09 15:49:00 +00:00
Satoru Takeuchi 9cd42a17a4 ci: fix an intermittent failure of ceph flex suite
Sometimes CephFlexSuite fails with the following backtrace.

```
--- FAIL: TestCephFlexSuite (584.14s)
    --- PASS: TestCephFlexSuite/TestBlockStorageMountUnMountForDifferentAccessModes (163.66s)
    --- PASS: TestCephFlexSuite/TestBlockStorageMountUnMountForStatefulSets (83.21s)
    --- FAIL: TestCephFlexSuite/TestFileSystem (119.51s)
        ceph_base_file_test.go:487:
                Error Trace:    ceph_base_file_test.go:487
                                                        ceph_base_file_test.go:265
                                                        ceph_flex_test.go:113
                Error:          Expected nil, but got: &errors.errorString{s:"kubectl exec command bash failed on pod rook-ceph-tools in namespace flex-ns. Failed to run: kubectl [exec -n flex-ns rook-ceph-tools -- bash -c mount -t ceph -o mds_namespace=smoke-test-fs,name=admin,secret=$(grep key /etc/ceph/keyring | awk '{print $3}') $(grep mon_host /etc/ceph/ceph.conf | awk '{print $3}'):/ /tmp/testrook] : exit status 32"}
                Test:           TestCephFlexSuite/TestFileSystem
```

It's due to insufficient retry of mount.

There is only one difference between CI logs of both "PASS" cases and "FAIL" cases.

The log of PASS cases:
```
2020-09-30 21:47:03.369019 D | exec: Running command: kubectl exec -n flex-ns rook-ceph-tools -- bash -c mount -t ceph -o mds_namespace=smoke-test-fs,name=admin,secret=$(grep key /etc/ceph/keyring | awk '{print $3}') $(grep mon_host /etc/ceph/ceph.conf | awk '{print $3}'):/ /tmp/testrook
2020-09-30 21:47:03.679359 D | exec: Running command: kubectl exec -n flex-ns rook-ceph-tools -- mkdir -p /tmp/testrook/foo
```

The log of FAIL cases:
```
2020-09-30 21:49:21.591702 D | exec: Running command: kubectl exec -n flex-ns rook-ceph-tools -- bash -c mount -t ceph -o mds_namespace=smoke-test-fs,name=admin,secret=$(grep key /etc/ceph/keyring | awk '{print $3}') $(grep mon_host /etc/ceph/ceph.conf | awk '{print $3}'):/ /tmp/testrook
2020-09-30 21:49:36.592161 I | exec: timeout waiting for process kubectl to return. Sending interrupt signal to the process
2020-09-30 21:49:40.355420 E | utils: Failed to execute: kubectl [exec -n flex-ns rook-ceph-tools -- bash -c mount -t ceph -o mds_namespace=smoke-test-fs,name=admin,secret=$(grep key /etc/ceph/keyring | awk '{print $3}') $(grep mon_host /etc/ceph/ceph.conf | awk '{print $3}'):/ /tmp/testrook] : timeout waiting for the command kubectl to return.
```

Everything looks fine before showing the above-mentioned error in FAIL cases.
In addition, this problem hasn't happened in high-spec local machine
over 10 times.

Related issue: 6358

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2020-10-07 09:36:44 +00:00
subhamkrai 5be7f0ae07 ceph: flex test failing in CI
this commit will add error not found condition
check before assert delete on PVC and
statefulset due to whch flex test was failing.

Signed-off-by: subhamkrai <srai@redhat.com>
2020-10-05 20:00:01 +05:30
Travis Nielsen c13d1edf22 ceph: skip smoke suite on k8s 1.11
The smoke suite relies on the csi driver for all the file and block
tests. In the release branch on k8s 1.11 we only need to run the
flex suite and can skip the smoke suite.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-10-01 15:57:00 -06:00
subhamkrai 0fddfcf307 ceph: handle golangci-lint linter errcheck error
this commit handle golangci-lint linter errcheck.

`errcheck` - Errcheck is a program for checking for
unchecked errors in go programs. These unchecked errors
can be critical bugs in some cases

To see only staticcheck linter output
`golangci-lint run --disable-all -E errcheck`

Signed-off-by: subhamkrai <srai@redhat.com>
2020-09-30 22:24:34 +05:30
Mudit Agarwal c547b36aa0 ceph: update csi sidecar images
This PR makes the changes in csi templates and
upgrade documentation required for updating
csi sidecar images.

Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
2020-09-28 18:58:52 +05:30