From 60b2b0a05ed1a6a85c27723a8f07345b4a1df836 Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:01:44 +0900 Subject: [PATCH 01/11] Update config.sh --- cicd/k0s-weave/config.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cicd/k0s-weave/config.sh b/cicd/k0s-weave/config.sh index fbe620d47..88e88126b 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...." From f3cbca2b49a575b50824e858dd7e563392c8a78e Mon Sep 17 00:00:00 2001 From: Trekkie Coder Date: Tue, 3 Oct 2023 16:58:41 +0900 Subject: [PATCH 02/11] updated scripts for k0s cicd --- cicd/k0s-weave/config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cicd/k0s-weave/config.sh b/cicd/k0s-weave/config.sh index 88e88126b..b385ffa31 100755 --- a/cicd/k0s-weave/config.sh +++ b/cicd/k0s-weave/config.sh @@ -6,7 +6,7 @@ source ../common.sh function wait_k0s_cluster_ready { Res=$(sudo k0s kubectl get pods -A | while IFS= read -r line; do - if [[ "$line" != *"Running"* && "$line" != *"READY"* ]]; then + if [[ "$line" != *"Running"* && "$line" != *"READY"* && "$line" != *"Completed"* ]]; then echo "not ready" return fi From ad54a12e4b3dd9795f173c28be407eb2b8c02d77 Mon Sep 17 00:00:00 2001 From: Trekkie Coder Date: Tue, 3 Oct 2023 17:19:34 +0900 Subject: [PATCH 03/11] updated scripts for k0s cicd --- cicd/k0s-weave/config.sh | 8 ++++---- cicd/k0s-weave/validation.sh | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cicd/k0s-weave/config.sh b/cicd/k0s-weave/config.sh index b385ffa31..691abb8e4 100755 --- a/cicd/k0s-weave/config.sh +++ b/cicd/k0s-weave/config.sh @@ -220,10 +220,10 @@ sudo k0s kubectl apply -f udp-svc-lb.yml sleep 15 sudo k0s kubectl apply -f sctp-svc-lb.yml sleep 15 -sudo k0s kubectl apply -f udp-svc-lb2.yml -sleep 15 -sudo k0s kubectl apply -f sctp-svc-lb2.yml -sleep 30 +#sudo k0s kubectl apply -f udp-svc-lb2.yml +#sleep 15 +#sudo k0s kubectl apply -f sctp-svc-lb2.yml +#sleep 30 # External LB service must be created by now sudo k0s kubectl get svc diff --git a/cicd/k0s-weave/validation.sh b/cicd/k0s-weave/validation.sh index 73af091a5..c99509f3d 100755 --- a/cicd/k0s-weave/validation.sh +++ b/cicd/k0s-weave/validation.sh @@ -85,6 +85,10 @@ else code=1 fi +exit + +## Currently not running the following tests + out=$($hexec user timeout 10 ../common/sctp_client 1.1.1.1 0 $extIP 55005) if [[ ${out} == *"server1"* ]]; then echo "cluster-k0s (sctp2) [OK]" From f622e34cff2d080ca335546433c4e4a72df2a921 Mon Sep 17 00:00:00 2001 From: Trekkie Coder Date: Tue, 3 Oct 2023 17:50:02 +0900 Subject: [PATCH 04/11] updated scripts for k0s cicd --- cicd/k0s-weave/config.sh | 10 +++++----- cicd/k0s-weave/validation.sh | 4 ---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/cicd/k0s-weave/config.sh b/cicd/k0s-weave/config.sh index 691abb8e4..f261cc690 100755 --- a/cicd/k0s-weave/config.sh +++ b/cicd/k0s-weave/config.sh @@ -6,7 +6,7 @@ source ../common.sh function wait_k0s_cluster_ready { Res=$(sudo k0s kubectl get pods -A | while IFS= read -r line; do - if [[ "$line" != *"Running"* && "$line" != *"READY"* && "$line" != *"Completed"* ]]; then + if [[ "$line" != *"Running"* && "$line" != *"READY"* ]]; then echo "not ready" return fi @@ -220,10 +220,10 @@ sudo k0s kubectl apply -f udp-svc-lb.yml sleep 15 sudo k0s kubectl apply -f sctp-svc-lb.yml sleep 15 -#sudo k0s kubectl apply -f udp-svc-lb2.yml -#sleep 15 -#sudo k0s kubectl apply -f sctp-svc-lb2.yml -#sleep 30 +sudo k0s kubectl apply -f udp-svc-lb2.yml +sleep 15 +sudo k0s kubectl apply -f sctp-svc-lb2.yml +sleep 30 # External LB service must be created by now sudo k0s kubectl get svc diff --git a/cicd/k0s-weave/validation.sh b/cicd/k0s-weave/validation.sh index c99509f3d..73af091a5 100755 --- a/cicd/k0s-weave/validation.sh +++ b/cicd/k0s-weave/validation.sh @@ -85,10 +85,6 @@ else code=1 fi -exit - -## Currently not running the following tests - out=$($hexec user timeout 10 ../common/sctp_client 1.1.1.1 0 $extIP 55005) if [[ ${out} == *"server1"* ]]; then echo "cluster-k0s (sctp2) [OK]" From 175774fd8e4572d2c3038feb3ca4290761370a88 Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Tue, 3 Oct 2023 09:07:15 +0000 Subject: [PATCH 05/11] Update k0s-weave.yml --- .github/workflows/k0s-weave.yml | 53 +++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/.github/workflows/k0s-weave.yml b/.github/workflows/k0s-weave.yml index 027d1338a..4f0211479 100644 --- a/.github/workflows/k0s-weave.yml +++ b/.github/workflows/k0s-weave.yml @@ -10,46 +10,61 @@ 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: | + - name: Setup lo + run: sudo ip addr add 192.169.20.59/32 dev lo + - name: Setup Packages + run: sudo apt-get -y install lksctp-tools + - name: Check container plugins + 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: 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 - From 0ee38a18520e9ff14327ba537fae8320e0213e00 Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Tue, 3 Oct 2023 09:08:23 +0000 Subject: [PATCH 06/11] Update k0s-weave.yml --- .github/workflows/k0s-weave.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/k0s-weave.yml b/.github/workflows/k0s-weave.yml index 4f0211479..04e1e83d9 100644 --- a/.github/workflows/k0s-weave.yml +++ b/.github/workflows/k0s-weave.yml @@ -13,7 +13,7 @@ jobs: test-runner: name: k0s-weave-sanity runs-on: self-hosted - if: github.repository == 'loxilb-io/loxilb' + if: github.repository == 'TrekkieCoder/loxilb' && github.event.inputs.tagName == '' steps: - name: Checkout From 1681e8643d992584cfe0366a8e58d0dc8f835844 Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Tue, 3 Oct 2023 09:11:48 +0000 Subject: [PATCH 07/11] Update k0s-weave.yml --- .github/workflows/k0s-weave.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/k0s-weave.yml b/.github/workflows/k0s-weave.yml index 04e1e83d9..4c2f8fdc1 100644 --- a/.github/workflows/k0s-weave.yml +++ b/.github/workflows/k0s-weave.yml @@ -28,9 +28,9 @@ jobs: run: | echo "KUBECONFIG=/var/lib/k0s/pki/admin.conf" >> $GITHUB_ENV - name: Setup lo - run: sudo ip addr add 192.169.20.59/32 dev 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 + run: sudo apt-get -y install lksctp-tools || true - name: Check container plugins run: | sudo mkdir -p /opt/cni/bin/ @@ -68,3 +68,4 @@ jobs: cd cicd/k0s-weave/ || true ./rmconfig.sh cd - + sudo ip addr del 192.169.20.59/32 dev lo || true From a8a5bb22f51ed9a9d7b83ea5bab16a36cf457bc6 Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Tue, 3 Oct 2023 09:14:43 +0000 Subject: [PATCH 08/11] Update k0s-weave.yml --- .github/workflows/k0s-weave.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/k0s-weave.yml b/.github/workflows/k0s-weave.yml index 4c2f8fdc1..3f9c3dbfb 100644 --- a/.github/workflows/k0s-weave.yml +++ b/.github/workflows/k0s-weave.yml @@ -31,14 +31,6 @@ jobs: 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: Check container plugins - 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 - - name: Install k0s run: sudo curl -sSLf https://get.k0s.sh | sudo sh - name: Enable k0s worker From fbde72c85a03a284c0d4d182b8218df73feaf591 Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Tue, 3 Oct 2023 09:31:22 +0000 Subject: [PATCH 09/11] Update k0s-weave.yml --- .github/workflows/k0s-weave.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/k0s-weave.yml b/.github/workflows/k0s-weave.yml index 3f9c3dbfb..3a14b3a4a 100644 --- a/.github/workflows/k0s-weave.yml +++ b/.github/workflows/k0s-weave.yml @@ -13,7 +13,7 @@ jobs: test-runner: name: k0s-weave-sanity runs-on: self-hosted - if: github.repository == 'TrekkieCoder/loxilb' + if: github.repository == 'loxilb-io/loxilb' && github.event.inputs.tagName == '' steps: - name: Checkout From e52e70cbf922945db002fdcef6159448678a7557 Mon Sep 17 00:00:00 2001 From: Trekkie Coder Date: Tue, 3 Oct 2023 18:33:23 +0900 Subject: [PATCH 10/11] Updated to latest submodule --- loxilb-ebpf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 27a96065ca95134079461ac4ed502444cf1f0a34 Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Tue, 3 Oct 2023 09:38:27 +0000 Subject: [PATCH 11/11] Update eks.yaml --- .github/workflows/eks.yaml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) 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 }}