mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-10 00:10:20 +00:00
deploy: deploy erasure coded pool
deploy erasure coded pool during rook
deployment to allow usage and testing
in erasure coded pools.
Signed-off-by: Yug Gupta <yuggupta27@gmail.com>
(cherry picked from commit c339d43272
)
This commit is contained in:
parent
890fb4c46a
commit
89f6db4c3d
@ -4,6 +4,7 @@ ROOK_VERSION=${ROOK_VERSION:-"v1.6.2"}
|
|||||||
ROOK_DEPLOY_TIMEOUT=${ROOK_DEPLOY_TIMEOUT:-300}
|
ROOK_DEPLOY_TIMEOUT=${ROOK_DEPLOY_TIMEOUT:-300}
|
||||||
ROOK_URL="https://raw.githubusercontent.com/rook/rook/${ROOK_VERSION}/cluster/examples/kubernetes/ceph"
|
ROOK_URL="https://raw.githubusercontent.com/rook/rook/${ROOK_VERSION}/cluster/examples/kubernetes/ceph"
|
||||||
ROOK_BLOCK_POOL_NAME=${ROOK_BLOCK_POOL_NAME:-"newrbdpool"}
|
ROOK_BLOCK_POOL_NAME=${ROOK_BLOCK_POOL_NAME:-"newrbdpool"}
|
||||||
|
ROOK_BLOCK_EC_POOL_NAME=${ROOK_BLOCK_EC_POOL_NAME:-"ec-pool"}
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
@ -110,6 +111,22 @@ function delete_block_pool() {
|
|||||||
rm -f "./newpool.yaml"
|
rm -f "./newpool.yaml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function create_block_ec_pool() {
|
||||||
|
curl -o block-pool-ec.yaml "${ROOK_URL}/pool-ec.yaml"
|
||||||
|
sed -i "s/ec-pool/${ROOK_BLOCK_EC_POOL_NAME}/g" block-pool-ec.yaml
|
||||||
|
kubectl_retry create -f "./block-pool-ec.yaml"
|
||||||
|
rm -f "./block-pool-ec.yaml"
|
||||||
|
|
||||||
|
check_rbd_stat "${ROOK_BLOCK_EC_POOL_NAME}"
|
||||||
|
}
|
||||||
|
|
||||||
|
function delete_block_ec_pool() {
|
||||||
|
curl -o block-pool-ec.yaml "${ROOK_URL}/pool-ec.yaml"
|
||||||
|
sed -i "s/ec-pool/${ROOK_BLOCK_EC_POOL_NAME}/g" block-pool-ec.yaml
|
||||||
|
kubectl delete -f "./block-pool-ec.yaml"
|
||||||
|
rm -f "./block-pool-ec.yaml"
|
||||||
|
}
|
||||||
|
|
||||||
function check_ceph_cluster_health() {
|
function check_ceph_cluster_health() {
|
||||||
for ((retry = 0; retry <= ROOK_DEPLOY_TIMEOUT; retry = retry + 5)); do
|
for ((retry = 0; retry <= ROOK_DEPLOY_TIMEOUT; retry = retry + 5)); do
|
||||||
echo "Wait for rook deploy... ${retry}s" && sleep 5
|
echo "Wait for rook deploy... ${retry}s" && sleep 5
|
||||||
@ -198,6 +215,12 @@ create-block-pool)
|
|||||||
delete-block-pool)
|
delete-block-pool)
|
||||||
delete_block_pool
|
delete_block_pool
|
||||||
;;
|
;;
|
||||||
|
create-block-ec-pool)
|
||||||
|
create_block_ec_pool
|
||||||
|
;;
|
||||||
|
delete-block-ec-pool)
|
||||||
|
delete_block_ec_pool
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo " $0 [command]
|
echo " $0 [command]
|
||||||
Available Commands:
|
Available Commands:
|
||||||
|
Loading…
Reference in New Issue
Block a user