From 4fb915ab5da2235040e553b54ba451dd07a073ba Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Sun, 22 Oct 2023 12:21:10 +0900 Subject: [PATCH 01/22] Update k3s-flannel-incluster.yml --- .github/workflows/k3s-flannel-incluster.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/k3s-flannel-incluster.yml b/.github/workflows/k3s-flannel-incluster.yml index eef233a98..38c7852d9 100644 --- a/.github/workflows/k3s-flannel-incluster.yml +++ b/.github/workflows/k3s-flannel-incluster.yml @@ -13,7 +13,7 @@ jobs: build: name: k3s-flannel-incluster-sanity runs-on: self-hosted - if: github.repository == 'loxilb-io/loxilb' + if: github.repository == 'TrekkieCoder/loxilb' && github.event.inputs.tagName == '' steps: - name: Checkout From 4120ff60f4e624b7801fbdcbfb3fe52185413d01 Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Sun, 22 Oct 2023 12:21:35 +0900 Subject: [PATCH 02/22] Update k3s-flannel-incluster.yml --- .github/workflows/k3s-flannel-incluster.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/k3s-flannel-incluster.yml b/.github/workflows/k3s-flannel-incluster.yml index 38c7852d9..4da7538e8 100644 --- a/.github/workflows/k3s-flannel-incluster.yml +++ b/.github/workflows/k3s-flannel-incluster.yml @@ -25,6 +25,7 @@ jobs: run: | cd cicd/k3s-flannel-incluster ./config.sh + sleep 90 ./validation.sh cd - From a885da75756b19cc5f75e39937a96b5576f8b32d Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Sun, 22 Oct 2023 12:50:30 +0900 Subject: [PATCH 03/22] Update k3s-flannel-incluster.yml --- .github/workflows/k3s-flannel-incluster.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/k3s-flannel-incluster.yml b/.github/workflows/k3s-flannel-incluster.yml index 4da7538e8..dca5a118a 100644 --- a/.github/workflows/k3s-flannel-incluster.yml +++ b/.github/workflows/k3s-flannel-incluster.yml @@ -25,7 +25,7 @@ jobs: run: | cd cicd/k3s-flannel-incluster ./config.sh - sleep 90 + sleep 120 ./validation.sh cd - @@ -33,5 +33,5 @@ jobs: if: success() || failure() run: | cd cicd/k3s-flannel-incluster || true - ./rmconfig.sh + #./rmconfig.sh cd - From ddfcc50e1c8ab153d0c60ea007ee9f5cc36d495e Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Sun, 22 Oct 2023 13:20:38 +0900 Subject: [PATCH 04/22] Update k3s-flannel-incluster.yml --- .github/workflows/k3s-flannel-incluster.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/k3s-flannel-incluster.yml b/.github/workflows/k3s-flannel-incluster.yml index dca5a118a..89cb32a2e 100644 --- a/.github/workflows/k3s-flannel-incluster.yml +++ b/.github/workflows/k3s-flannel-incluster.yml @@ -27,6 +27,8 @@ jobs: ./config.sh sleep 120 ./validation.sh + vagrant ssh host -c "socat -T10 - sctp:123.123.123.1:55004,bind=192.168.90.9" + vagrant ssh host -c "socat -T10 - sctp:123.123.123.1:57004,bind=192.168.90.9" cd - - name: Clean test-bed From 99f8497af2c05d66888e8072c2d2ce774de361f2 Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Sun, 22 Oct 2023 13:50:25 +0900 Subject: [PATCH 05/22] Update k3s-flannel-incluster.yml --- .github/workflows/k3s-flannel-incluster.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/k3s-flannel-incluster.yml b/.github/workflows/k3s-flannel-incluster.yml index 89cb32a2e..f939587fb 100644 --- a/.github/workflows/k3s-flannel-incluster.yml +++ b/.github/workflows/k3s-flannel-incluster.yml @@ -27,8 +27,12 @@ jobs: ./config.sh sleep 120 ./validation.sh - vagrant ssh host -c "socat -T10 - sctp:123.123.123.1:55004,bind=192.168.90.9" - vagrant ssh host -c "socat -T10 - sctp:123.123.123.1:57004,bind=192.168.90.9" + echo "Trying" + vagrant ssh host -c "ip route" + echo "Trying2" + vagrant ssh host -c "socat -T10 - sctp:123.123.123.1:55004,bind=192.168.90.9" | tee out.txt + echo "Trying3" + vagrant ssh host -c "socat -T10 - sctp:123.123.123.1:57004,bind=192.168.90.9" | tee out1.txt cd - - name: Clean test-bed From 5d9480376c4f273804ccb5896b3753b10502080e Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Sun, 22 Oct 2023 14:53:01 +0900 Subject: [PATCH 06/22] Update k3s-flannel-incluster.yml --- .github/workflows/k3s-flannel-incluster.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/k3s-flannel-incluster.yml b/.github/workflows/k3s-flannel-incluster.yml index f939587fb..5fcc4ba46 100644 --- a/.github/workflows/k3s-flannel-incluster.yml +++ b/.github/workflows/k3s-flannel-incluster.yml @@ -25,14 +25,8 @@ jobs: run: | cd cicd/k3s-flannel-incluster ./config.sh - sleep 120 + sleep 90 ./validation.sh - echo "Trying" - vagrant ssh host -c "ip route" - echo "Trying2" - vagrant ssh host -c "socat -T10 - sctp:123.123.123.1:55004,bind=192.168.90.9" | tee out.txt - echo "Trying3" - vagrant ssh host -c "socat -T10 - sctp:123.123.123.1:57004,bind=192.168.90.9" | tee out1.txt cd - - name: Clean test-bed From 40435d06b3e9e9d168f6583da7e39605628d13cc Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Sun, 22 Oct 2023 15:02:36 +0900 Subject: [PATCH 07/22] Update validation.sh --- cicd/k3s-flannel-incluster/validation.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cicd/k3s-flannel-incluster/validation.sh b/cicd/k3s-flannel-incluster/validation.sh index e3ef6b99a..6e31d4544 100755 --- a/cicd/k3s-flannel-incluster/validation.sh +++ b/cicd/k3s-flannel-incluster/validation.sh @@ -41,7 +41,10 @@ else exit 1 fi -out=$(vagrant ssh host -c "socat -T10 - sctp:$extIP:55004,bind=192.168.90.9") +rm -f /vagrant/log1.txt +touch /vagrant/log1.txt +vagrant ssh host -c "socat -v -T10 - sctp:$extIP:55004,bind=192.168.90.9 1> /vagrant/log1.txt 2>&1" +out=$(cat log1.txt) if [[ ${out} == *"server1"* ]]; then echo "k3s-flannel-cluster (kube-loxilb) sctp [OK]" else @@ -50,7 +53,10 @@ else exit 1 fi -out=$(vagrant ssh host -c "socat -T10 - sctp:$extIP:57004,bind=192.168.90.9") +rm -f /vagrant/log2.txt +touch /vagrant/log2.txt +vagrant ssh host -c "socat -v -T10 - sctp:$extIP:57004,bind=192.168.90.9 1> /vagrant/log2.txt 2>&1" +out=$(cat log2.txt) if [[ ${out} == *"server1"* ]]; then echo "k3s-flannel-cluster (kube-loxilb) default-sctp [OK]" else From 76732ed8c948a0f160c613813653152f4e6c529a Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Sun, 22 Oct 2023 17:37:38 +0900 Subject: [PATCH 08/22] Update Vagrantfile --- cicd/k3s-flannel-incluster/Vagrantfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cicd/k3s-flannel-incluster/Vagrantfile b/cicd/k3s-flannel-incluster/Vagrantfile index d62074c26..3078cfe9e 100644 --- a/cicd/k3s-flannel-incluster/Vagrantfile +++ b/cicd/k3s-flannel-incluster/Vagrantfile @@ -29,8 +29,8 @@ Vagrant.configure("2") do |config| master.vm.network :private_network, ip: "192.168.90.10", :netmask => "255.255.255.0" master.vm.provision :shell, :path => "master1.sh" master.vm.provider :virtualbox do |vbox| - vbox.customize ["modifyvm", :id, "--memory", 8192] - vbox.customize ["modifyvm", :id, "--cpus", 4] + vbox.customize ["modifyvm", :id, "--memory", 4096] + vbox.customize ["modifyvm", :id, "--cpus", 2] vbox.customize ["modifyvm", :id, "--nicpromisc1", "allow-all"] vbox.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"] end @@ -42,8 +42,8 @@ Vagrant.configure("2") do |config| master.vm.network :private_network, ip: "192.168.90.11", :netmask => "255.255.255.0" master.vm.provision :shell, :path => "master2.sh" master.vm.provider :virtualbox do |vbox| - vbox.customize ["modifyvm", :id, "--memory", 8192] - vbox.customize ["modifyvm", :id, "--cpus", 4] + vbox.customize ["modifyvm", :id, "--memory", 4096] + vbox.customize ["modifyvm", :id, "--cpus", 2] vbox.customize ["modifyvm", :id, "--nicpromisc1", "allow-all"] vbox.customize ["modifyvm", :id, "--nicpromisc2", "allow-all"] end From 9b034d36b821de0c9797c929e587eef462f70af5 Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Sun, 22 Oct 2023 17:39:12 +0900 Subject: [PATCH 09/22] Update validation.sh --- cicd/k3s-flannel-incluster/validation.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cicd/k3s-flannel-incluster/validation.sh b/cicd/k3s-flannel-incluster/validation.sh index 6e31d4544..220b2e6c0 100755 --- a/cicd/k3s-flannel-incluster/validation.sh +++ b/cicd/k3s-flannel-incluster/validation.sh @@ -41,8 +41,6 @@ else exit 1 fi -rm -f /vagrant/log1.txt -touch /vagrant/log1.txt vagrant ssh host -c "socat -v -T10 - sctp:$extIP:55004,bind=192.168.90.9 1> /vagrant/log1.txt 2>&1" out=$(cat log1.txt) if [[ ${out} == *"server1"* ]]; then @@ -52,9 +50,8 @@ else print_debug_info exit 1 fi +rm -f /vagrant/log1.txt -rm -f /vagrant/log2.txt -touch /vagrant/log2.txt vagrant ssh host -c "socat -v -T10 - sctp:$extIP:57004,bind=192.168.90.9 1> /vagrant/log2.txt 2>&1" out=$(cat log2.txt) if [[ ${out} == *"server1"* ]]; then @@ -64,5 +61,6 @@ else print_debug_info exit 1 fi +rm -f /vagrant/log2.txt exit From ec84ce1de232770efcfa860b5012ec6e7305d420 Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Sun, 22 Oct 2023 18:47:30 +0900 Subject: [PATCH 10/22] Update k3s-flannel-incluster.yml --- .github/workflows/k3s-flannel-incluster.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/k3s-flannel-incluster.yml b/.github/workflows/k3s-flannel-incluster.yml index 5fcc4ba46..145cb29f4 100644 --- a/.github/workflows/k3s-flannel-incluster.yml +++ b/.github/workflows/k3s-flannel-incluster.yml @@ -17,15 +17,15 @@ jobs: && github.event.inputs.tagName == '' steps: - name: Checkout - uses: actions/checkout@v2 - with: - submodules: recursive + #uses: actions/checkout@v2 + #with: + # submodules: recursive - name: Run the test run: | cd cicd/k3s-flannel-incluster - ./config.sh - sleep 90 + #./config.sh + #sleep 90 ./validation.sh cd - From 681b22d606b3405fd0d8e1f59e901c7ab8560616 Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Sun, 22 Oct 2023 18:51:31 +0900 Subject: [PATCH 11/22] Update k3s-flannel-incluster.yml --- .github/workflows/k3s-flannel-incluster.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/k3s-flannel-incluster.yml b/.github/workflows/k3s-flannel-incluster.yml index 145cb29f4..ea452eb94 100644 --- a/.github/workflows/k3s-flannel-incluster.yml +++ b/.github/workflows/k3s-flannel-incluster.yml @@ -16,11 +16,6 @@ jobs: if: github.repository == 'TrekkieCoder/loxilb' && github.event.inputs.tagName == '' steps: - - name: Checkout - #uses: actions/checkout@v2 - #with: - # submodules: recursive - - name: Run the test run: | cd cicd/k3s-flannel-incluster From 9fe82c569a418f4a65f553de8818152bc89d9416 Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Sun, 22 Oct 2023 21:20:27 +0900 Subject: [PATCH 12/22] Update k3s-flannel-incluster.yml --- .github/workflows/k3s-flannel-incluster.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/k3s-flannel-incluster.yml b/.github/workflows/k3s-flannel-incluster.yml index ea452eb94..39f63628e 100644 --- a/.github/workflows/k3s-flannel-incluster.yml +++ b/.github/workflows/k3s-flannel-incluster.yml @@ -19,8 +19,8 @@ jobs: - name: Run the test run: | cd cicd/k3s-flannel-incluster - #./config.sh - #sleep 90 + ./config.sh + sleep 90 ./validation.sh cd - @@ -28,5 +28,5 @@ jobs: if: success() || failure() run: | cd cicd/k3s-flannel-incluster || true - #./rmconfig.sh + ./rmconfig.sh cd - From 40a8a61e98ba197a9896437416a2d781aaa09564 Mon Sep 17 00:00:00 2001 From: Trekkie Coder Date: Sun, 22 Oct 2023 21:21:15 +0900 Subject: [PATCH 13/22] cicd:fix for validation of k3s-flannel-incluster --- cicd/common/sctp_socat_client | Bin 0 -> 17256 bytes cicd/common/sctp_socat_client.c | 72 +++++++++++++++++++++++ cicd/k3s-flannel-incluster/host.sh | 4 +- cicd/k3s-flannel-incluster/validation.sh | 6 +- 4 files changed, 78 insertions(+), 4 deletions(-) create mode 100755 cicd/common/sctp_socat_client create mode 100644 cicd/common/sctp_socat_client.c diff --git a/cicd/common/sctp_socat_client b/cicd/common/sctp_socat_client new file mode 100755 index 0000000000000000000000000000000000000000..399c0bd26aa1dc783fb64cc5d5721e6c98cec8e4 GIT binary patch literal 17256 zcmeHOYj9h|6<%3!;)Fz20s-^PB_(YLSaE`rCSd}SV>{Q>c_$EB;38XcEU+abU4up-GqmlXMuG7CN{O2Ac*N1hnRnsNdPU=j!TO zD$~cGcC;S(ob#Q>?w;Mdx~qHl&ZgGp3Xex{@ro-1Nh32YB&ZY*U#=LCpjakm;Qt(P zftU<=lEf^1&?3-UBOlDMHV)V8N7INR<3a75`LA!&LY!nfxk=RkE9Y zpE`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TsQ;4W@K82uR;B*lWF&#T9ewIib-TBK>hxVNo+_X>N@sQ*@L`nkm76E*b3#lY`=V zx=ay}V-Nrv*p`4uOe)$g0%o)iB3*T`PRQ98h<2*$tP=;LY{`mYU2v8M^QbD^9YZk7 z9pfwlxY)aK1r}Lt{&k4%jIdPWJJ%{T>VBFj?;n*~+A>e{bNJ9!js5xlov8+$v+zER zv87;~{##Z3OzHWav+(y3V=Z8u{=6SxsZvSh5jz|o$T{dvE_^z+J++s}4P z>4j0+BeTr=8m8-&Kj)a+uV9e@Lpf!C-v2NiR)$p<8 z_J0r<<%Hwo=E5q9y6^nm4%b)jgOpmam zq8yLu(=LBLpU?COSBKe;!#?Zs=Y1hl{{4yVUE#zpl|PTa(3GX3inzIka18cic{-d4ST@6S?h9|32Elqs($Cxn4_a{T$;mk*aU5uq +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define RECVBUFSIZE 4096 +#define PPID 1234 + +int main(int argc, char* argv[]) +{ + + struct sockaddr_in servaddr = {0}; + struct sockaddr_in laddr = {0}; + int sockfd, in, flags; + char *saddr; + int sport, lport, error = 0; + struct sctp_status status = {0}; + struct sctp_sndrcvinfo sndrcvinfo = {0}; + struct sctp_event_subscribe events = {0}; + struct sctp_initmsg initmsg = {0}; + char msg[1024] = {0}; + char buff[1024] = {0}; + socklen_t opt_len; + socklen_t slen = (socklen_t) sizeof(struct sockaddr_in); + + + sockfd = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP); + lport = atoi(argv[2]); + + laddr.sin_family = AF_INET; + laddr.sin_addr.s_addr = inet_addr(argv[1]); + laddr.sin_port = lport?htons(lport):0; + + //bind to local address + error = bind(sockfd, (struct sockaddr *)&laddr, sizeof(struct sockaddr_in)); + if (error != 0) { + printf("\n\n\t\t***r: error binding addr:" + " %s. ***\n", strerror(errno)); + exit(1); + } + + saddr = argv[3]; + sport = atoi(argv[4]); + bzero( (void *)&servaddr, sizeof(servaddr) ); + servaddr.sin_family = AF_INET; + servaddr.sin_port = htons(sport); + servaddr.sin_addr.s_addr = inet_addr( saddr ); + + connect( sockfd, (struct sockaddr *)&servaddr, sizeof(servaddr)); + + while(1) + { + in = sctp_recvmsg(sockfd, (void*)buff, RECVBUFSIZE, + (struct sockaddr *)&servaddr, + &slen, &sndrcvinfo, &flags); + if (in > 0 && in < RECVBUFSIZE - 1) + { + buff[in] = 0; + printf("%s",buff); + break; + } + } + + close(sockfd); + return 0; +} diff --git a/cicd/k3s-flannel-incluster/host.sh b/cicd/k3s-flannel-incluster/host.sh index c436473e5..0a243ca7b 100755 --- a/cicd/k3s-flannel-incluster/host.sh +++ b/cicd/k3s-flannel-incluster/host.sh @@ -1,10 +1,10 @@ -wget https://github.com/loxilb-io/loxilb/raw/main/cicd/common/sctp_client +wget https://github.com/loxilb-io/loxilb/raw/main/cicd/common/sctp_socat_client wget https://github.com/loxilb-io/loxilb/raw/main/cicd/common/udp_client chmod 777 sctp_client chmod 777 udp_client echo "123.123.123.1 k8s-svc" >> /etc/hosts -sudo apt install -y bird2 socat +sudo apt install -y bird2 socat lksctp-tools sleep 5 diff --git a/cicd/k3s-flannel-incluster/validation.sh b/cicd/k3s-flannel-incluster/validation.sh index 220b2e6c0..46c63d1e9 100755 --- a/cicd/k3s-flannel-incluster/validation.sh +++ b/cicd/k3s-flannel-incluster/validation.sh @@ -41,7 +41,8 @@ else exit 1 fi -vagrant ssh host -c "socat -v -T10 - sctp:$extIP:55004,bind=192.168.90.9 1> /vagrant/log1.txt 2>&1" +#vagrant ssh host -c "socat -v -T10 - sctp:$extIP:55004,bind=192.168.90.9 1> /vagrant/log1.txt 2>&1" +out=$(vagrant ssh host -c "./sctp_socat_client 192.168.90.9 0 $extIP 55004") out=$(cat log1.txt) if [[ ${out} == *"server1"* ]]; then echo "k3s-flannel-cluster (kube-loxilb) sctp [OK]" @@ -52,7 +53,8 @@ else fi rm -f /vagrant/log1.txt -vagrant ssh host -c "socat -v -T10 - sctp:$extIP:57004,bind=192.168.90.9 1> /vagrant/log2.txt 2>&1" +#vagrant ssh host -c "socat -v -T10 - sctp:$extIP:57004,bind=192.168.90.9 1> /vagrant/log2.txt 2>&1" +out=$(vagrant ssh host -c "./sctp_socat_client 192.168.90.9 0 $extIP 57004") out=$(cat log2.txt) if [[ ${out} == *"server1"* ]]; then echo "k3s-flannel-cluster (kube-loxilb) default-sctp [OK]" From 6b86ed429043cfeaf01b7639ab699e4fa383faae Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Sun, 22 Oct 2023 21:32:34 +0900 Subject: [PATCH 14/22] Update k3s-flannel-incluster.yml --- .github/workflows/k3s-flannel-incluster.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/k3s-flannel-incluster.yml b/.github/workflows/k3s-flannel-incluster.yml index 39f63628e..4da7538e8 100644 --- a/.github/workflows/k3s-flannel-incluster.yml +++ b/.github/workflows/k3s-flannel-incluster.yml @@ -16,6 +16,11 @@ jobs: if: github.repository == 'TrekkieCoder/loxilb' && github.event.inputs.tagName == '' steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: recursive + - name: Run the test run: | cd cicd/k3s-flannel-incluster From f917d354ec64444be8b9fc8f3fe2e9efa0e23011 Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Sun, 22 Oct 2023 21:34:21 +0900 Subject: [PATCH 15/22] Update host.sh --- cicd/k3s-flannel-incluster/host.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cicd/k3s-flannel-incluster/host.sh b/cicd/k3s-flannel-incluster/host.sh index 0a243ca7b..1bb9b077a 100755 --- a/cicd/k3s-flannel-incluster/host.sh +++ b/cicd/k3s-flannel-incluster/host.sh @@ -1,6 +1,6 @@ -wget https://github.com/loxilb-io/loxilb/raw/main/cicd/common/sctp_socat_client +wget https://github.com/TrekkieCoder/loxilb/raw/main/cicd/common/sctp_socat_client wget https://github.com/loxilb-io/loxilb/raw/main/cicd/common/udp_client -chmod 777 sctp_client +chmod 777 sctp_socat_client chmod 777 udp_client echo "123.123.123.1 k8s-svc" >> /etc/hosts From dcc02fd1c874ce231b96798d56d19ae69baf5c21 Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Sun, 22 Oct 2023 21:53:58 +0900 Subject: [PATCH 16/22] Update validation.sh --- cicd/k3s-flannel-incluster/validation.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cicd/k3s-flannel-incluster/validation.sh b/cicd/k3s-flannel-incluster/validation.sh index 46c63d1e9..77ce6c1fe 100755 --- a/cicd/k3s-flannel-incluster/validation.sh +++ b/cicd/k3s-flannel-incluster/validation.sh @@ -43,7 +43,6 @@ fi #vagrant ssh host -c "socat -v -T10 - sctp:$extIP:55004,bind=192.168.90.9 1> /vagrant/log1.txt 2>&1" out=$(vagrant ssh host -c "./sctp_socat_client 192.168.90.9 0 $extIP 55004") -out=$(cat log1.txt) if [[ ${out} == *"server1"* ]]; then echo "k3s-flannel-cluster (kube-loxilb) sctp [OK]" else @@ -51,11 +50,9 @@ else print_debug_info exit 1 fi -rm -f /vagrant/log1.txt #vagrant ssh host -c "socat -v -T10 - sctp:$extIP:57004,bind=192.168.90.9 1> /vagrant/log2.txt 2>&1" out=$(vagrant ssh host -c "./sctp_socat_client 192.168.90.9 0 $extIP 57004") -out=$(cat log2.txt) if [[ ${out} == *"server1"* ]]; then echo "k3s-flannel-cluster (kube-loxilb) default-sctp [OK]" else @@ -63,6 +60,5 @@ else print_debug_info exit 1 fi -rm -f /vagrant/log2.txt exit From 4d679dd82860638acb2f6e867bbbb8e5c236b732 Mon Sep 17 00:00:00 2001 From: Trekkie Coder Date: Sun, 22 Oct 2023 21:56:18 +0900 Subject: [PATCH 17/22] cicd:added enhanced sctp client --- cicd/k8s-calico-ubuntu22/validation.sh | 2 +- cicd/k8s-calico/validation.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cicd/k8s-calico-ubuntu22/validation.sh b/cicd/k8s-calico-ubuntu22/validation.sh index 131be315b..7455a4f80 100755 --- a/cicd/k8s-calico-ubuntu22/validation.sh +++ b/cicd/k8s-calico-ubuntu22/validation.sh @@ -86,7 +86,7 @@ else code=1 fi -out=$(timeout 10 ../common/sctp_client 192.168.90.1 34951 $extIP ${sctp_port[i]}) +out=$(timeout 10 ../common/sctp_socat_client 192.168.90.1 34951 $extIP ${sctp_port[i]}) if [[ ${out} == *"server1"* ]]; then echo -e "K8s-calico-Ubuntu22 SCTP\t(${mode[i]})\t[OK]" else diff --git a/cicd/k8s-calico/validation.sh b/cicd/k8s-calico/validation.sh index dc9d77851..06100d862 100755 --- a/cicd/k8s-calico/validation.sh +++ b/cicd/k8s-calico/validation.sh @@ -86,7 +86,7 @@ else code=1 fi -out=$(timeout 5 ../common/sctp_client 192.168.90.1 34951 $extIP ${sctp_port[i]}) +out=$(timeout 5 ../common/sctp_socat_client 192.168.90.1 34951 $extIP ${sctp_port[i]}) if [[ ${out} == *"server1"* ]]; then echo -e "K8s-calico SCTP\t(${mode[i]})\t[OK]" else From 0f9a70935e5544a4d6f81283c73681a5a997c3c4 Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Sun, 22 Oct 2023 22:22:29 +0900 Subject: [PATCH 18/22] Update validation.sh --- cicd/k3s-flannel-incluster/validation.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cicd/k3s-flannel-incluster/validation.sh b/cicd/k3s-flannel-incluster/validation.sh index 77ce6c1fe..ee8eae48f 100755 --- a/cicd/k3s-flannel-incluster/validation.sh +++ b/cicd/k3s-flannel-incluster/validation.sh @@ -42,7 +42,7 @@ else fi #vagrant ssh host -c "socat -v -T10 - sctp:$extIP:55004,bind=192.168.90.9 1> /vagrant/log1.txt 2>&1" -out=$(vagrant ssh host -c "./sctp_socat_client 192.168.90.9 0 $extIP 55004") +out=$(vagrant ssh host -c "timeout 10 ./sctp_socat_client 192.168.90.9 0 $extIP 55004") if [[ ${out} == *"server1"* ]]; then echo "k3s-flannel-cluster (kube-loxilb) sctp [OK]" else @@ -52,7 +52,7 @@ else fi #vagrant ssh host -c "socat -v -T10 - sctp:$extIP:57004,bind=192.168.90.9 1> /vagrant/log2.txt 2>&1" -out=$(vagrant ssh host -c "./sctp_socat_client 192.168.90.9 0 $extIP 57004") +out=$(vagrant ssh host -c "timeout 10 ./sctp_socat_client 192.168.90.9 0 $extIP 57004") if [[ ${out} == *"server1"* ]]; then echo "k3s-flannel-cluster (kube-loxilb) default-sctp [OK]" else From 64530f22629870c7f7765a5d6f90a343f94ce0c7 Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Sun, 22 Oct 2023 22:22:53 +0900 Subject: [PATCH 19/22] Update master1.sh --- cicd/k3s-flannel-incluster/master1.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cicd/k3s-flannel-incluster/master1.sh b/cicd/k3s-flannel-incluster/master1.sh index 260a9fb38..c6f0613d1 100755 --- a/cicd/k3s-flannel-incluster/master1.sh +++ b/cicd/k3s-flannel-incluster/master1.sh @@ -1,7 +1,7 @@ sudo su export MASTER_IP=$(ip a |grep global | grep -v '10.0.2.15' | grep -v '192.168.90' | grep '192.168.80' | awk '{print $2}' | cut -f1 -d '/') curl -fL https://get.k3s.io | sh -s - server --node-ip=192.168.80.10 --disable servicelb --disable traefik --cluster-init external-hostname=192.168.80.10 --node-external-ip=192.168.80.10 --disable-cloud-controller -#curl -sfL https://github.com/loxilb-io/loxilb-ebpf/raw/main/kprobe/install.sh | sh - +curl -sfL https://github.com/loxilb-io/loxilb-ebpf/raw/main/kprobe/install.sh | sh - sleep 60 echo $MASTER_IP > /vagrant/master-ip cp /var/lib/rancher/k3s/server/node-token /vagrant/node-token From 1685f623eef9e1a5902d6aed6e3d720596b5bb23 Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Sun, 22 Oct 2023 22:23:08 +0900 Subject: [PATCH 20/22] Update master2.sh --- cicd/k3s-flannel-incluster/master2.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cicd/k3s-flannel-incluster/master2.sh b/cicd/k3s-flannel-incluster/master2.sh index ad122e87c..5ec72af6e 100644 --- a/cicd/k3s-flannel-incluster/master2.sh +++ b/cicd/k3s-flannel-incluster/master2.sh @@ -5,6 +5,6 @@ export NODE_TOKEN=$(cat /vagrant/node-token) #curl -fL https://get.k3s.io | K3S_TOKEN=${NODE_TOKEN} sh -s - server --server https://192.168.80.10:6443 --disable traefik --disable servicelb --node-ip=192.168.80.11 external-hostname=192.168.80.11 --node-external-ip=192.168.80.11 --disable-cloud-controller -t ${NODE_TOKEN} curl -fL https://get.k3s.io | K3S_TOKEN=${NODE_TOKEN} sh -s - server --server https://192.168.80.10:6443 --disable traefik --disable servicelb --node-ip=192.168.80.11 external-hostname=192.168.80.11 --node-external-ip=192.168.80.11 -t ${NODE_TOKEN} -#curl -sfL https://github.com/loxilb-io/loxilb-ebpf/raw/main/kprobe/install.sh | sh - +curl -sfL https://github.com/loxilb-io/loxilb-ebpf/raw/main/kprobe/install.sh | sh - /vagrant/wait_ready.sh From 3c03b8833a98d8eec73555d2b780ea3df7f45c13 Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Sun, 22 Oct 2023 22:49:56 +0900 Subject: [PATCH 21/22] Update k3s-flannel-incluster.yml --- .github/workflows/k3s-flannel-incluster.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/k3s-flannel-incluster.yml b/.github/workflows/k3s-flannel-incluster.yml index 4da7538e8..3da4ea13f 100644 --- a/.github/workflows/k3s-flannel-incluster.yml +++ b/.github/workflows/k3s-flannel-incluster.yml @@ -13,7 +13,7 @@ jobs: build: name: k3s-flannel-incluster-sanity runs-on: self-hosted - if: github.repository == 'TrekkieCoder/loxilb' + if: github.repository == 'loxilb-io/loxilb' && github.event.inputs.tagName == '' steps: - name: Checkout From f424c6334bbb882c9491ca29ed72bc02e4c299df Mon Sep 17 00:00:00 2001 From: TrekkieCoder <111065900+TrekkieCoder@users.noreply.github.com> Date: Sun, 22 Oct 2023 22:55:33 +0900 Subject: [PATCH 22/22] Update host.sh --- cicd/k3s-flannel-incluster/host.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cicd/k3s-flannel-incluster/host.sh b/cicd/k3s-flannel-incluster/host.sh index 1bb9b077a..bdb9b7356 100755 --- a/cicd/k3s-flannel-incluster/host.sh +++ b/cicd/k3s-flannel-incluster/host.sh @@ -1,4 +1,4 @@ -wget https://github.com/TrekkieCoder/loxilb/raw/main/cicd/common/sctp_socat_client +wget https://github.com/loxilb-io/loxilb/raw/main/cicd/common/sctp_socat_client wget https://github.com/loxilb-io/loxilb/raw/main/cicd/common/udp_client chmod 777 sctp_socat_client chmod 777 udp_client