diff --git a/.github/workflows/eks.yaml b/.github/workflows/eks.yaml index 51e24141e..6a49fbf9f 100644 --- a/.github/workflows/eks.yaml +++ b/.github/workflows/eks.yaml @@ -28,18 +28,12 @@ jobs: run: shell: bash working-directory: ./cicd/eks - + if: github.repository == 'loxilb-io/loxilb' + && github.event.inputs.tagName == '' steps: # Checkout the repository to the GitHub Actions runner - name: Checkout uses: actions/checkout@v3 - - # Run this only on main repo - - name: Check Repo owner - if: github.repository != 'loxilb-io/loxilb' - run: | - gh run cancel ${{ github.run_id }} - gh run watch ${{ github.run_id }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/k0s-weave.yml b/.github/workflows/k0s-weave.yml index 027d1338a..3a14b3a4a 100644 --- a/.github/workflows/k0s-weave.yml +++ b/.github/workflows/k0s-weave.yml @@ -10,46 +10,54 @@ on: required: true default: 'k0s-weave' jobs: - build: + test-runner: name: k0s-weave-sanity - runs-on: ubuntu-20.04 + runs-on: self-hosted + if: github.repository == 'loxilb-io/loxilb' + && github.event.inputs.tagName == '' steps: - - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v2 with: submodules: recursive - - uses: actions/setup-go@v3 + - name: Setup Go + uses: actions/setup-go@v3 with: go-version: '>=1.18.0' - - run: | + - name: Setup Local Env1 + run: | echo "KUBECONFIG=/var/lib/k0s/pki/admin.conf" >> $GITHUB_ENV - - run: sudo ip addr add 192.169.20.59/32 dev lo - - run: sudo apt-get -y install lksctp-tools - - run: sudo swapoff -a - - run: | - sudo mkdir -p /opt/cni/bin/ - git clone https://github.com/containernetworking/plugins.git - cd plugins - ./build_linux.sh - sudo cp -f bin/* /opt/cni/bin/ - cd - - - run: sudo curl -sSLf https://get.k0s.sh | sudo sh - - run: sudo k0s install controller --enable-worker -c cicd/k0s-weave/k0s.yaml - - run: sudo k0s start - - run: | + - name: Setup lo + run: sudo ip addr add 192.169.20.59/32 dev lo || true + - name: Setup Packages + run: sudo apt-get -y install lksctp-tools || true + - name: Install k0s + run: sudo curl -sSLf https://get.k0s.sh | sudo sh + - name: Enable k0s worker + run: sudo k0s install controller --enable-worker -c cicd/k0s-weave/k0s.yaml + - name: Start k0s + run: sudo k0s start + - name: Setup Weave + run: | sleep 120 sudo k0s kubectl apply -f https://github.com/weaveworks/weave/releases/download/v2.8.1/weave-daemonset-k8s.yaml - - run: | + - name: Print running pods + run: | sleep 60 - sudo k0s kubectl get pods -A - - run: | - sleep 10 sudo k0s kubectl taint nodes --all node-role.kubernetes.io/master:NoSchedule- sleep 60 sudo k0s kubectl get nodes sudo k0s kubectl get pods -A - - run: | + - name: Run the test + run: | cd cicd/k0s-weave/ ./config.sh ./validation.sh - ./rmconfig.sh cd - + - name: Cleanup + if: success() || failure() + run: | + cd cicd/k0s-weave/ || true + ./rmconfig.sh + cd - + sudo ip addr del 192.169.20.59/32 dev lo || true diff --git a/cicd/k0s-weave/config.sh b/cicd/k0s-weave/config.sh index fbe620d47..f261cc690 100755 --- a/cicd/k0s-weave/config.sh +++ b/cicd/k0s-weave/config.sh @@ -30,6 +30,8 @@ function wait_k0s_cluster_ready_full { i=$(( $i + 1 )) if [[ $i -ge 40 ]]; then echo "Cluster is not ready.Giving up" + sudo k0s kubectl get svc + sudo k0s kubectl get pods -A exit 1 fi echo "Cluster is not ready...." @@ -221,7 +223,7 @@ sleep 15 sudo k0s kubectl apply -f udp-svc-lb2.yml sleep 15 sudo k0s kubectl apply -f sctp-svc-lb2.yml -sleep 30 +sleep 30 # External LB service must be created by now sudo k0s kubectl get svc diff --git a/loxilb-ebpf b/loxilb-ebpf index fe66f3a20..5e43775f9 160000 --- a/loxilb-ebpf +++ b/loxilb-ebpf @@ -1 +1 @@ -Subproject commit fe66f3a202877edd93f32b4c7b436a5bed964ae1 +Subproject commit 5e43775f9a6231cb3a121f227c9f36c02b83538b