From ff94ba282caaa7d7331b54a000fd742a5ded59c7 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Wed, 29 Jul 2020 13:22:41 +0200 Subject: [PATCH] ci: deploy rook with mon_warn_on_pool_no_redundancy in ceph.conf In test environments the default pool size is set to 1, so there is no redundancy. This causes recent Ceph versions to complain with HEALTH_WARN as POOL_NO_REDUNDANCY get set. By disabling the mon_warn_on_pool_no_redundancy option in ceph.conf, the warning is not reported and the cluster is marked HEALTHY. See-also: rook/rook#5925 Signed-off-by: Niels de Vos --- scripts/rook.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/rook.sh b/scripts/rook.sh index 49e8404bf..71adefcae 100755 --- a/scripts/rook.sh +++ b/scripts/rook.sh @@ -26,7 +26,15 @@ function deploy_rook() { kubectl create -f "${TEMP_DIR}/cluster-test.yaml" rm -rf "${TEMP_DIR}" else - kubectl create -f "${ROOK_URL}/cluster-test.yaml" + # add "mon_warn_on_pool_no_redundancy = false" to ceph.conf if missing + # see https://github.com/rook/rook/pull/5925 for upstream status + TEMP_DIR="$(mktemp -d)" + curl -o "${TEMP_DIR}"/cluster-test.yaml "${ROOK_URL}/cluster-test.yaml" + if ! grep -q mon_warn_on_pool_no_redundancy "${TEMP_DIR}"/cluster-test.yaml; then + sed -i '/osd_pool_default_size =/a \ mon_warn_on_pool_no_redundancy = false' "${TEMP_DIR}"/cluster-test.yaml + fi + kubectl create -f "${TEMP_DIR}/cluster-test.yaml" + rm -rf "${TEMP_DIR}" fi kubectl create -f "${ROOK_URL}/toolbox.yaml"