diff --git a/.github/workflows/pod-kill-chaos-test.yaml b/.github/workflows/pod-kill-chaos-test.yaml index 4c73094f8dfa1f7fff5c1478b93d71590f161482..a4d5e7833620eab83fd77e5f5b6e4f27d9a181df 100644 --- a/.github/workflows/pod-kill-chaos-test.yaml +++ b/.github/workflows/pod-kill-chaos-test.yaml @@ -107,6 +107,7 @@ jobs: shell: bash working-directory: tests/python_client/chaos run: | + kubectl config set-context --current --namespace=chaos-testing bash scripts/uninstall_milvus.sh helm install --wait --timeout 360s milvus-chaos milvus/milvus -f cluster-values.yaml -n=chaos-testing kubectl get pods -n chaos-testing diff --git a/tests/python_client/chaos/chaos_test.sh b/tests/python_client/chaos/chaos_test.sh index 3df68d468f7bcb1aec35a2751c5ed5b3f8c6c78c..997cb27a2582c17e6748556a9c5aeef79fef544b 100644 --- a/tests/python_client/chaos/chaos_test.sh +++ b/tests/python_client/chaos/chaos_test.sh @@ -14,6 +14,10 @@ echo "platform: $platform" # define chaos testing object release=${1:-"milvus-chaos"} +ns=${2:-"chaos-testing"} + +# switch namespace +kubectl config set-context --current --namespace=${ns} pod="proxy" chaos_type="pod_failure" release="milvus-chaos" @@ -22,9 +26,9 @@ ns="chaos-testing" # install milvus cluster for chaos testing pushd ./scripts echo "uninstall milvus if exist" -bash uninstall_milvus.sh ${release}|| true +bash uninstall_milvus.sh ${release} ${ns}|| true echo "install milvus" -bash install_milvus.sh ${release} +bash install_milvus.sh ${release} ${ns} # if chaos_type is pod_failure, update replicas if [ "$chaos_type" == "pod_failure" ]; diff --git a/tests/python_client/chaos/scripts/install_milvus.sh b/tests/python_client/chaos/scripts/install_milvus.sh index bed4bae83fa4fb9e77b205df28ec754a9b6805f0..584ff3e8994e337b17a66b9673574eb01dfc8c85 100644 --- a/tests/python_client/chaos/scripts/install_milvus.sh +++ b/tests/python_client/chaos/scripts/install_milvus.sh @@ -1,8 +1,8 @@ release=${1:-"milvs-chaos"} - -bash uninstall_milvus.sh ${release} || true +ns=${2:-"chaos-testing"} +bash uninstall_milvus.sh ${release} ${ns}|| true helm repo add milvus https://milvus-io.github.io/milvus-helm/ helm repo update -helm install --wait --timeout 360s ${release} milvus/milvus --set service.type=NodePort -f ../cluster-values.yaml -n=chaos-testing +helm install --wait --timeout 360s ${release} milvus/milvus --set service.type=NodePort -f ../cluster-values.yaml -n=${ns} diff --git a/tests/python_client/chaos/scripts/uninstall_milvus.sh b/tests/python_client/chaos/scripts/uninstall_milvus.sh index 22daa8995d493075799a8913a7d20505fc2aac29..82e65c518fd1940e46a5be2d6c7ad5fed235a29e 100644 --- a/tests/python_client/chaos/scripts/uninstall_milvus.sh +++ b/tests/python_client/chaos/scripts/uninstall_milvus.sh @@ -1,6 +1,7 @@ set -e release=${1:-"milvus-chaos"} -helm uninstall ${release} -kubectl delete pvc -l release=${release} -kubectl delete pvc -l app.kubernetes.io/instance=${release} +ns=${2:-"chaos-testing"} +helm uninstall ${release} -n=${ns} +kubectl delete pvc -l release=${release} -n=${ns} +kubectl delete pvc -l app.kubernetes.io/instance=${release} -n=${ns}