Commit Graph
6310 Commits
Author SHA1 Message Date
Sébastien Han f02ae4a3e3 Merge pull request #7196 from leseb/bz-1926617-2
ceph: fix wrong payload path
2021-02-10 17:23:06 +01:00
Sébastien Han 1f4649f327 ceph: fix wrong payload path
Wrong file was used...

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-02-10 17:01:39 +01:00
Sébastien Han 8a14ff5bd9 Merge pull request #7193 from leseb/bz-1926617
ceph: expose vault curl errors
2021-02-10 16:54:46 +01:00
Sébastien Han 1adebcd4d1 ceph: expose vault curl errors
If the Vault server returns an error, we must report it in the init
container. With this we can properly debug a failing init container.

Resulting container log:

```
oc logs rook-ceph-osd-0-dc6d4d4d-445dg -c encryption-kms-get-kek                                                                                                                                                                                                         ⏎
['error performing token check: Vault is sealed']%
```

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-02-10 12:45:16 +01:00
Sébastien Han 88cf490f00 ceph: silence the curl call
We don't need to output the progress.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-02-10 11:37:17 +01:00
Satoru Takeuchi 3b9b1dc3c7 Merge pull request #7185 from cybozu-go/ceph-replace-setting-controller-reference-with-utility-function
ceph: replace setting controller reference with utility function
2021-02-10 09:52:08 +09:00
Sébastien Han fd0716a026 Merge pull request #7173 from leseb/fix-7168
ceph: add cephfilesystemmirrors CRD to 1.15
2021-02-09 16:31:25 +01:00
Travis Nielsen 543edbc762 Merge pull request #7180 from leseb/scale-rbd-mirror
ceph: use deployment replicas instead of more deployments for rbd-mirror
2021-02-09 08:20:41 -07:00
Travis Nielsen 0dec1babd2 Merge pull request #7170 from leseb/bz-1922954
ceph: return an error if PVC is not clean
2021-02-09 08:01:11 -07:00
Sébastien Han db4306b485 Merge pull request #7172 from leseb/bz-1925055
ceph: always override existing block for blkdevmapper
2021-02-09 15:49:04 +01:00
Sébastien Han 6dc15eb649 ceph: always override existing block for blkdevmapper
When the blkdevmapper init container initializes we must override any
existing special block. This will prevent re-using a different disk on
the OSD on PVC scenario.

Adding "--remove-destination" to the cp line will remove each existing
destination file before attempting to open it.
We **MUST** do this otherwise in environment where PVCs are dynamic, restarting the deployment will cause conflicts
When restarting the OSD, the PVC block might end up with a different Kernel disk allocation
For instance, prior to restart the block was mapped to 8:32 and when re-attached it was on 8:16
The previous "block" is still 8:32 so if we don't override it we will try to initialize on a disk that is not an OSD or worse another OSD
This is mainly because in https://github.com/rook/rook/commit/ae8dcf7cc3b51cf8ca7da22f48b7a58887536c4f we switched to use HostPath to store the OSD data
Since HostPath is not ephemeral, the block file must be re-hydrated each time the deployment starts

The test uses "==" instead of numbers since the stat command will print
an hex number and thus we won't always get integer, e,g: major/minor
value 202:13312 will be return ca:3400.

Example run of the new init container:

+ PVC_SOURCE=/set1-data-168h7m
+ PVC_DEST=/var/lib/ceph/osd/ceph-0/block
+ CP_ARGS=(--archive --dereference --verbose)
+ '[' -b /var/lib/ceph/osd/ceph-0/block ']'
++ stat -c %t%T /set1-data-168h7m
+ PVC_SOURCE_MAJ_MIN=ca6100
++ stat -c %t%T /var/lib/ceph/osd/ceph-0/block
PVC's source major/minor numbers changed
removed '/var/lib/ceph/osd/ceph-0/block'
'/set1-data-168h7m' -> '/var/lib/ceph/osd/ceph-0/block'
+ PVC_DEST_MAJ_MIN=ca4000
+ [[ ca6100 == \c\a\4\0\0\0 ]]
+ echo 'PVC'\''s source major/minor numbers changed'
+ CP_ARGS+=(--remove-destination)
+ cp --archive --dereference --verbose --remove-destination /set1-data-168h7m /var/lib/ceph/osd/ceph-0/block

Test procedure:

$ oc -n rook-ceph scale deployment rook-ceph-osd-0 --replicas=2
deployment.apps/rook-ceph-osd-0 scaled

Now we have 2 OSDs and one is crashlooping, which is expected:

rook-ceph-osd-0-66964f6d-2cwqq                              0/1     Init:CrashLoopBackOff   4          2m12s
rook-ceph-osd-0-66964f6d-pmhlq                              1/1     Running                 0          6m7s

The logs from the failing container is pretty clear:

+ PVC_SOURCE=/set1-data-168h7m
+ PVC_DEST=/var/lib/ceph/osd/ceph-0/block
+ CP_ARGS=(--archive --dereference --verbose)
+ '[' -b /var/lib/ceph/osd/ceph-0/block ']'
++ stat -c %t%T /set1-data-168h7m
+ PVC_SOURCE_MAJ_MIN=ca6100
++ stat -c %t%T /var/lib/ceph/osd/ceph-0/block
+ PVC_DEST_MAJ_MIN=ca6100
+ [[ ca6100 == \c\a\6\1\0\0 ]]
+ CP_ARGS+=(--no-clobber)
+ cp --archive --dereference --verbose --no-clobber /set1-data-168h7m /var/lib/ceph/osd/ceph-0/block
inferring bluefs devices from bluestore path
/home/jenkins-build/build/workspace/ceph-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos8/DIST/centos8/MACHINE_SIZE/gigantic/release/15.2.8/rpm/el8/BUILD/ceph-15.2.8/src/os/bluestore/BlueStore.cc: In function 'int BlueStore::expand_devices(std::ostream&)' thread 7f2a52d18240 time 2021-02-09T13:27:46.011397+0000
/home/jenkins-build/build/workspace/ceph-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos8/DIST/centos8/MACHINE_SIZE/gigantic/release/15.2.8/rpm/el8/BUILD/ceph-15.2.8/src/os/bluestore/BlueStore.cc: 7090: FAILED ceph_assert(r == 0)
2021-02-09T13:27:46.010+0000 7f2a52d18240 -1 bluestore(/var/lib/ceph/osd/ceph-0) _lock_fsid failed to lock /var/lib/ceph/osd/ceph-0/fsid (is another ceph-osd still running?)(11) Resource temporarily unavailable
 ceph version 15.2.8 (bdf3eebcd22d7d0b3dd4d5501bee5bac354d5b55) octopus (stable)
 1: (ceph::__ceph_assert_fail(char const*, char const*, int, char const*)+0x158) [0x7f2a48e236e4]

 Acquiring the lock fails, so the OSD won't run.
 Now we scale back down:

$ oc -n rook-ceph scale deployment rook-ceph-osd-0 --replicas=1
deployment.apps/rook-ceph-osd-0 scaled

And we can see the last created OSD (the one crash looping) disappears:

rook-ceph-osd-0-66964f6d-2cwqq                              0/1     Terminating   5          3m6s
rook-ceph-osd-0-66964f6d-pmhlq                              1/1     Running       0          7m1s

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-02-09 14:28:39 +01:00
Satoru Takeuchi bdfabba75c ceph: replace setting controller reference with utility function
Some settinc controller reference code can be replaced
with `controllerutil.SetControllerReference`. It's better to use it
since it provides ownerReference verification.

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2021-02-09 12:03:38 +00:00
Sébastien Han 7c928f4196 ceph: return an error if PVC is not clean
With 5f57b6fd3a, we introduced a
regression in the validation code.
If the OSD PV comes from another cluster, GetCephVolumeRawOSDs must
return an error.
The prepare job will crash loop but at least with a useful and
comprehensive message.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-02-09 11:28:08 +01:00
Sébastien Han 04f5bd0e53 ceph: use deployment replicas instead of more deployments
For the rbd-mirror daemon, We now rely on the "replica" setting in the Deployment spec when the
desired instance count is higher than 1 instead of creating another
deployment.
So now, we don't need to the number of deployments anymore and let
kubernetes handles the number of pods.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-02-09 10:32:42 +01:00
Sébastien Han 5966f09376 Merge pull request #7160 from leseb/rm-crash-pod-when-ceph-pods-are-gone
ceph: remove crash collector if ceph pod moved
2021-02-09 10:08:16 +01:00
Sébastien Han df683a0c57 ceph: add cephfilesystemmirrors CRD to 1.15
Add the cephfilesystemmirrors definition for CI runs where the
Kubernetes version is 1.15 and extension v1 extensions are not
supported.

Closes: https://github.com/rook/rook/issues/7168
Signed-off-by: Sébastien Han <seb@redhat.com>
2021-02-09 09:50:16 +01:00
Sébastien Han b9e91b600d ceph: remove crash collector if ceph pod moved
If Ceph pods were evicted onto other nodes, there is no reason for the
crash collector to remain on those nodes. So let's remove it.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-02-09 09:48:16 +01:00
Travis Nielsen 19627a7498 Merge pull request #7179 from varshar16/fs-not-reqd-nfs-deployments
ceph: filesystem is not required for nfs server deployment
2021-02-08 12:15:24 -07:00
Varsha Rao baa79cf4c3 ceph: filesystem is not required for nfs server deployment
nfs server requires valid pool for storing nfs-ganesha recovery objects. Only
when filesystem exports are created, filesystem should be configured first.

Signed-off-by: Varsha Rao <varao@redhat.com>
2021-02-08 20:13:14 +05:30
Sébastien Han 09b72e4c4a Merge pull request #7169 from travisn/remove-yugabytedb
build: Remove YugabyteDB operator
2021-02-08 09:08:37 +01:00
Travis Nielsen 043f947321 build: remove yugabytedb operator
The YugabyteDB team has decided to move support of their operator
to a new repo at https://github.com/yugabyte/yugabyte-operator.
The operator in Rook is no longer needed. Further usage of
the YugabyteDB operator is recommended at the new location.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-02-06 00:03:41 -07:00
Travis Nielsen a1b3682d9d Merge pull request #7162 from onedr0p/patch-1
ceph: add helm resource-policy keep annotation for CRDs in helm chart
2021-02-04 12:48:47 -07:00
Travis Nielsen 7282505c48 Merge pull request #7152 from travisn/ceph-dashboard-init
ceph: Remove obsolete init containers from mgr that were used to init the binding addresses
2021-02-04 11:05:29 -07:00
ᗪєνιη ᗷυнʟ 64a0fbc91c ceph: set helm resource policy keep annotation on CRDs in Helm chart
When uninstalling the helm chart do not remove the CRDs, instead
document the way to remove the CRDs after the user uninstalls
the chart.

Closes: https://github.com/rook/rook/issues/6617
Signed-off-by: Devin Buhl <devin.kray@gmail.com>
2021-02-04 12:26:46 -05:00
Travis Nielsen f1b37db67d Merge pull request #7158 from varshar16/fix-dashboard-doc-url
ceph: update dashboard doc url to latest
2021-02-04 10:00:02 -07:00
Travis Nielsen 7dc36e0f46 ceph: use localhost for the mgr endpoint binding instead of podIP
The pod IP address is no longer needed for port binding for the dashboard
and prometheus endpoints anymore in the mgr modules. The default binding
to localhost will be sufficient. This will allow the endpoints to be more
reliable in some environments where today the podIP is not working.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-02-04 08:44:05 -07:00
Travis Nielsen 3399d2fb9c Merge pull request #7151 from travisn/mgr-bind-local
ceph: Bind mgr modules to all interfaces instead of pod ip
2021-02-04 07:50:34 -07:00
Travis Nielsen b3129fd5cf ceph: bind mgr modules to all interfaces instead of pod ip
Binding the dashboard and prometheus to all interfaces instead of the pod ip
will ensure that they are listening properly. Binding to the pod ip was only
a short term solution that was intended to be removed with Nautilus, which
is already Rook's min supported version.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-02-04 07:08:59 -07:00
Varsha Rao 380f87b0b4 ceph: update dashboard doc url to latest
ceph dashboard doc url in the doc is of older version. This patch updates it
with the latest doc url.

Signed-off-by: Varsha Rao <varao@redhat.com>
2021-02-04 18:45:37 +05:30
Sébastien Han 3a2e618ec4 Merge pull request #7112 from sp98/check-orchestration-cancellation
ceph: check for orchestration cancellation while waiting for all OSDs  to start.
2021-02-04 11:36:04 +01:00
Santosh Pillai f5808185e0 ceph: check for orchestration cancellation while OSDs are pending
completeOSDsForAllNodes() method waits for 20 minutes for all the OSDs to start on all the nodes. This PR checks if
cluster deletion request was sent while waiting for OSDs to start. If yes, then completeOSDsForAllNodes() method will returnwithout waiting for 20 minutes.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2021-02-04 14:49:37 +05:30
Sébastien Han bdb7b1eb05 Merge pull request #7123 from subhamkrai/intermittent-test-failures
ceph: Intermittent integration test failures due to admission controller
2021-02-04 09:48:21 +01:00
subhamkrai 9be70baf5f ci: intermittent integration test failures due to admission controller
integration test was failing frequently due to some
intermittent failures.
```
Error from server (InternalError): error when creating
"STDIN": Internal error occurred: failed calling webhook.
```
(This error is not coming from us most probably)
This is kind of workaround so we get green build
as we still don't know the root cause.

Signed-off-by: subhamkrai <srai@redhat.com>
2021-02-04 09:42:29 +05:30
Travis Nielsen fd8bab8b62 Merge pull request #7128 from sp98/skip-pdb-reconcile
ceph: skip reconcile on PDBs are created, deleted and when on different namespace
2021-02-03 12:09:07 -07:00
Santosh Pillai b780e5b5c0 ceph: skip pdb reconcile on create and delete events
This PR makes create and delete events on pdb a no-op. Update event only triggers reconcile if its the main OSD pdb and allowed disruptions is 0.
This prevents controller to reconcile on pdb events namespaces outside rook ceph.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2021-02-03 22:43:20 +05:30
Travis Nielsen 2e8482dada Merge pull request #7056 from leseb/silence-hamless-errors
ceph: silence harmless errors when the operator is not initialized
2021-02-03 09:59:24 -07:00
Sébastien Han 27c63c587a Merge pull request #7147 from Madhu-1/fix-csi-enc
ceph: Add new cmd argument and RBAC for csi rbd provisioner
2021-02-03 17:35:32 +01:00
Sébastien Han 2d75135579 ceph: embed the buffer in the error
Somehow the combined output does not contain the stderr in the errorn
only in the buffer.
For example:

err = "error exit 1"
buf = "Error EBUSY: not enough monitors would be available () after stopping mons [a]"

So we now embed the buf in the error so that the caller does not need to
print the buffer as well as the error.
Also, the caller can more easily decide to ignore the error by
instropecting the string.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-02-03 17:28:47 +01:00
Sébastien Han b189e91bfe ceph: use errors pkg instead of fmt
This one was a leftover.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-02-03 17:28:47 +01:00
Sébastien Han 8d033efb5a ceph: silence harmless errors
If the ceph cli outputs an error with "error calling conf_read_file"
this means that the operator has not written its ceph configuration
file. Thus ceph cli commands will fail, so we can just ignore that since
the operator will soon write this file in its initialization sequence.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-02-03 17:28:44 +01:00
Madhu Rajanna 81248f1dce ceph: add configmap get RBAC for rbd provisioner
rbd provisioner need to access the configmap
in different namespaces.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2021-02-03 21:28:00 +05:30
Madhu Rajanna 3cf9f7147e ceph: pass extra-create-metadata to csi-provisioner
when extra-create-metadata is passed to csi-provisioner
it passes few information like namespace name,pvc
name to the cephcsi driver which is required for
rbd encryption.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2021-02-03 21:27:37 +05:30
Sébastien Han 2bc5fbf84f Merge pull request #7142 from leseb/unit-test-ouside-gopath
ceph: do not force go path in unit tests
2021-02-03 09:11:15 +01:00
Sébastien Han dea3273eaf ceph: do not force go path in unit tests
Do not force unit tests to be run while the rook repo is in the GOPATH.
Now that Rook uses go modules, this is no longer necessary. Allow this
by creating a helper function that unit tests can use that return the
on-host path to the `rook` project root.

Followup of https://github.com/rook/rook/pull/7119/commits/15a487cd5aa5d4dc59bc15ef610cb182257d9287

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-02-03 08:56:41 +01:00
Travis Nielsen 39059a32a2 Merge pull request #7133 from travisn/log-collector-name
ceph: Simplify the log-collector container name
2021-02-02 14:28:37 -07:00
Blaine Gardner d4c71ff46a Merge pull request #7132 from travisn/object-device-class
ceph: Add deviceClass to the object store schema
2021-02-02 14:15:57 -07:00
Travis Nielsen 5371c943ca ceph: simplify the log-collector container name
The log-collector container name was exceeding the 63-char limit
if the parent CR name was too long. The container name just needs
to be unique to the pod spec, so we simplify it to remove the parent
name and avoid hitting the limit in the pod spec.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-02-02 12:42:53 -07:00
Travis Nielsen 81b398f6b6 ceph: add deviceClass to the object store schema
The deviceClass was missing from the object store CRD schema,
disallowing the device class from being specified on
the object store pools.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-02-02 12:13:23 -07:00
Travis Nielsen 87ac8c8561 Merge pull request #7109 from varshar16/update-ceph-nfs-pool-recom
ceph: update nfs ganesha pool recommendation
2021-02-02 11:26:28 -07:00
Travis Nielsen ad66fbe4a7 Merge pull request #6866 from jshen28/do-not-detect-csi-version-if-disabled
ceph: skip csi detection if CSI is disabled
2021-02-02 10:09:55 -07:00