[skip e2e]Update chaos test to support cluster n nodes (#13915)

Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
This commit is contained in:
zhuwenxing 2021-12-21 21:59:18 +08:00 committed by GitHub
parent a32c637776
commit be8f658385
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,6 +21,7 @@ kubectl config set-context --current --namespace=${ns}
pod=${1:-"querynode"}
chaos_type=${2:-"pod_kill"} #pod_kill or pod_failure
chaos_task=${3:-"chaos-test"} # chaos-test or data-consist-test
node_num=${4:-1} # cluster_1_node or cluster_n_nodes
release="test"-${pod}-${chaos_type/_/-} # replace pod_kill to pod-kill
@ -40,11 +41,13 @@ then
echo "install standalone"
helm install --wait --timeout 360s ${release} milvus/milvus --set service.type=NodePort -f ../standalone-values.yaml -n=${ns}
fi
# if chaos_type is pod_failure, update replicas
if [ "$chaos_type" == "pod_failure" ];
declare -A pod_map=(["querynode"]="queryNode" ["indexnode"]="indexNode" ["datanode"]="dataNode" ["proxy"]="proxy")
if [ "$node_num" -gt "1" ];
then
declare -A pod_map=(["querynode"]="queryNode" ["indexnode"]="indexNode" ["datanode"]="dataNode" ["proxy"]="proxy")
helm upgrade ${release} milvus/milvus --set ${pod_map[${pod}]}.replicas=2 --reuse-values
echo "install cluster n node"
helm upgrade ${release} milvus/milvus --set ${pod_map[${pod}]}.replicas=$node_num --reuse-values
fi
# wait all pod ready