From 89f6db4c3d621320f4abc5283f678ce4ea5b2631 Mon Sep 17 00:00:00 2001 From: Yug Gupta Date: Mon, 15 Nov 2021 12:11:50 +0530 Subject: [PATCH] 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 (cherry picked from commit c339d43272be1bfdc046a1be6b0a6164a6ddb2f8) --- scripts/rook.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/scripts/rook.sh b/scripts/rook.sh index f71c45627..1526731d9 100755 --- a/scripts/rook.sh +++ b/scripts/rook.sh @@ -4,6 +4,7 @@ ROOK_VERSION=${ROOK_VERSION:-"v1.6.2"} ROOK_DEPLOY_TIMEOUT=${ROOK_DEPLOY_TIMEOUT:-300} 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_EC_POOL_NAME=${ROOK_BLOCK_EC_POOL_NAME:-"ec-pool"} SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" # shellcheck disable=SC1091 @@ -110,6 +111,22 @@ function delete_block_pool() { 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() { for ((retry = 0; retry <= ROOK_DEPLOY_TIMEOUT; retry = retry + 5)); do echo "Wait for rook deploy... ${retry}s" && sleep 5 @@ -198,6 +215,12 @@ create-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] Available Commands: