forked from rook/rook
The raw-disk-with-object, osd-with-metadata-device, and pvc canary jobs used loopback devices to supply an extra block device beyond the single spare disk a GitHub runner provides. Loop devices behave differently from real block devices -- Rook gates them behind ROOK_CEPH_ALLOW_LOOP_DEVICES and special-cases them in the OSD daemon -- so exercising core scenarios on them is less realistic than using real SCSI disks. Provision the extra device(s) over iSCSI (LIO) instead, reusing the existing create_extra_disk helper: it now creates N LUNs, the new find_extra_block_devs and find_second_block_dev helpers enumerate them, and deploy_cluster gains a two_raw_disks mode. The three jobs now run entirely on real disks, and the canary CI no longer creates loop devices or relies on the loop-device test helpers. Signed-off-by: Joshua Hoblitt <josh@hoblitt.com>
73 lines
1.7 KiB
Bash
Executable File
73 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Copyright 2021 The Rook Authors. All rights reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
set -ex
|
|
|
|
#############
|
|
# VARIABLES #
|
|
#############
|
|
# The argument is a device path (/dev/...); create a single volumeMode: Block PV
|
|
# backed by that whole device, for use as an extra OSD by a PVC-based cluster.
|
|
device=$1
|
|
sudo lsblk
|
|
|
|
#############
|
|
# FUNCTIONS #
|
|
#############
|
|
|
|
# add_block_dev_pvc <device-path> <name-suffix>
|
|
# Create one volumeMode: Block PersistentVolume backed by the given device.
|
|
function add_block_dev_pvc() {
|
|
local path=$1
|
|
local name=$2
|
|
local storage=6Gi
|
|
|
|
cat <<eof | kubectl apply -f -
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolume
|
|
metadata:
|
|
name: local-vol-$name
|
|
labels:
|
|
type: local
|
|
spec:
|
|
storageClassName: manual
|
|
capacity:
|
|
storage: "$storage"
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
persistentVolumeReclaimPolicy: Retain
|
|
volumeMode: Block
|
|
local:
|
|
path: "$path"
|
|
nodeAffinity:
|
|
required:
|
|
nodeSelectorTerms:
|
|
- matchExpressions:
|
|
- key: rook.io/has-disk
|
|
operator: In
|
|
values:
|
|
- "true"
|
|
eof
|
|
}
|
|
|
|
########
|
|
# MAIN #
|
|
########
|
|
add_block_dev_pvc "$device" "$(basename "$device")"
|
|
|
|
kubectl get pv -o wide
|