osd: handle removal of encrypted osd deployment

This is handling a tricky scenario where the OSD deployment is manually
removed and the OSD never reconvers. This is unlikely to happen, but
still OSD should be able to run after that action. Essentially after a
manual deletion, we need to run the prepare job again to re-hydrate the
OSD information so that the OSD deployment can be deployed.
On encryption, it is a little bit tricky since ceph-volume list again
the main block won't return anything, so we need to target the encrypted
block to list.
There is another case this PR does not handle, which is the removal of
the OSD deployment and then the node is restarted. This means that the
encrypted container is not opened anymore. However, opening it requires
more work like writing the key on the filesystem (if not coming from the
Kubernete secret, eg,. KMS vault) and then run luksOpen. This is an
extreme corner case probably not worth worrying about for now.

Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit 05775b068d)
This commit is contained in:
Sébastien Han authored and mergify-bot committed 2021-12-21 15:15:18 +00:00
1 parent 0158da1feb
commit 7b1a08d427
8 files changed
+126 -30

No files matched your search

@@ -294,6 +294,11 @@ jobs:
kubectl -n rook-ceph get secrets
sudo lsblk
- name: test osd deployment removal and re-hydration
run: |
kubectl -n rook-ceph delete deploy/rook-ceph-osd-0
tests/scripts/github-action-helper.sh wait_for_ceph_to_be_ready osd 2
- name: collect common logs
if: always()
uses: ./.github/workflows/collect-logs
@@ -622,7 +627,7 @@ jobs:
- name: wait for ceph cluster 1 to be ready
run: |
mkdir test
mkdir -p test
tests/scripts/validate_cluster.sh osd 1
kubectl -n rook-ceph get pods