diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index 01bd26774..cc9e9e72a 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -15,16 +15,19 @@ env: jobs: Test-on-k8s-v-1-19-7: - runs-on: ubuntu-latest + runs-on: self-hosted timeout-minutes: 150 steps: - uses: actions/checkout@v2 + - name: Clean up + run: kind delete cluster --name chart-testing && docker image prune -f + - name: Build image run: docker build . --file Dockerfile --tag ks-installer - name: Create kind cluster - uses: helm/kind-action@v1.0.0-rc.1 + uses: helm/kind-action@v1.1.0 with: config: .github/workflows/kind/kind.yaml @@ -78,32 +81,6 @@ jobs: kubectl apply -f deploy/kubesphere-installer.yaml kubectl apply -f deploy/cluster-configuration.yaml kubectl -n kubesphere-system patch cc ks-installer --type merge --patch '{"spec":{"servicemesh":{"enabled":true}}}' - for i in {1..300};do - set +e - kubectl -n istio-system get deploy | grep istiod - if [[ $? -ne 0 ]];then - sleep 1 - echo "wait $i s..." - continue - fi - set -e - sleep 2 - kubectl -n istio-system get deploy istiod-1-6-10 -oyaml | sed '/cpu: /d' | sed '/memory: /d' | sed '/resourceVersion: /d' | kubectl replace -f - - break - done - for i in {1..300};do - set +e - kubectl -n istio-system get deploy | grep istio-ingressgateway - if [[ $? -ne 0 ]];then - sleep 1 - echo "wait $i s..." - continue - fi - set -e - sleep 2 - kubectl -n istio-system get deploy istio-ingressgateway -oyaml | sed '/cpu: /d' | sed '/memory: /d' | sed '/resourceVersion: /d' | kubectl replace -f - - break - done bash scripts/check_cluster_status.sh - name: slack diff --git a/scripts/check_cluster_status.sh b/scripts/check_cluster_status.sh old mode 100644 new mode 100755 index 28bf06e72..1f2fa8019 --- a/scripts/check_cluster_status.sh +++ b/scripts/check_cluster_status.sh @@ -9,12 +9,12 @@ function check_installer_ok(){ kubectl -n kubesphere-system wait --timeout=180s --for=condition=Ready $(kubectl -n kubesphere-system get pod -l app=ks-install -oname) echo "waiting for KubeSphere ready" while IFS= read -r line; do - echo $line + echo "$line" if [[ $line =~ "Welcome to KubeSphere" ]] then return fi - done < <(timeout 1200 kubectl logs -n kubesphere-system deploy/ks-installer -f) + done < <(timeout 1200 kubectl logs -n kubesphere-system deploy/ks-installer -f --tail 1) echo "ks-install not output 'Welcome to KubeSphere'" exit 1 }