From 64e1c582ef9de3a486033cdd009926e0cf5a5fda Mon Sep 17 00:00:00 2001 From: Nikhil Malik Date: Mon, 25 Mar 2024 16:29:33 +0900 Subject: [PATCH] sctp mh case added --- cicd/k3s-flannel-multus/bastion.sh | 2 +- cicd/k3s-flannel-multus/host_validation.sh | 23 ++++++++++++++++++++++ cicd/k3s-flannel-multus/kube-loxilb.yml | 1 + cicd/k3s-flannel-multus/master.sh | 2 ++ cicd/k3s-flannel-multus/multus/macvlan.yml | 2 +- 5 files changed, 28 insertions(+), 2 deletions(-) diff --git a/cicd/k3s-flannel-multus/bastion.sh b/cicd/k3s-flannel-multus/bastion.sh index 7b1c4d667..657b44515 100644 --- a/cicd/k3s-flannel-multus/bastion.sh +++ b/cicd/k3s-flannel-multus/bastion.sh @@ -1,2 +1,2 @@ apt-get update -apt-get install -y software-properties-common curl wget +apt-get install -y software-properties-common curl wget lksctp-tools diff --git a/cicd/k3s-flannel-multus/host_validation.sh b/cicd/k3s-flannel-multus/host_validation.sh index 37b171d98..51f3b7a58 100755 --- a/cicd/k3s-flannel-multus/host_validation.sh +++ b/cicd/k3s-flannel-multus/host_validation.sh @@ -2,6 +2,7 @@ extIP=$(cat /vagrant/extIP) tcp_port=55002 +sctp_port=55002 code=0 echo Service IP: $extIP @@ -17,4 +18,26 @@ else code=1 fi done + +for((i=0;i<20;i++)) +do +stdbuf -oL sctp_darn -H 0.0.0.0 -h $extIP -p $sctp_port -s < /vagrant/input > output +#sleep 1 +exp="New connection, peer addresses +4.0.5.2:55002 +4.0.3.1:55002 +4.0.4.1:55002" + +res=`cat output | grep -A 3 "New connection, peer addresses"` +sudo rm -rf output +if [[ "$res" == "$exp" ]]; then + #echo $res + echo "K3s-multus SCTP Multihoming service [OK]" +else + echo "K3s-multus SCTP Multihoming service [NOK]" + echo "Expected : $exp" + echo "Received : $res" + exit 1 +fi +done exit $code diff --git a/cicd/k3s-flannel-multus/kube-loxilb.yml b/cicd/k3s-flannel-multus/kube-loxilb.yml index d01240695..48f1da654 100644 --- a/cicd/k3s-flannel-multus/kube-loxilb.yml +++ b/cicd/k3s-flannel-multus/kube-loxilb.yml @@ -112,6 +112,7 @@ spec: args: - --loxiURL=http://4.0.6.149:11111 - --externalCIDR=4.0.5.2/32 + - --externalSecondaryCIDRs=4.0.4.1/24,4.0.3.1/24 #- --monitor #- --setBGP #- --setLBMode=1 diff --git a/cicd/k3s-flannel-multus/master.sh b/cicd/k3s-flannel-multus/master.sh index c3db1117d..b3ee6ceba 100644 --- a/cicd/k3s-flannel-multus/master.sh +++ b/cicd/k3s-flannel-multus/master.sh @@ -26,4 +26,6 @@ sudo ifconfig eth2 promisc sudo kubectl apply -f /vagrant/multus/multus-pod.yml sudo kubectl apply -f /vagrant/multus/multus-service.yml +sudo kubectl apply -f /vagrant/multus/multus-sctp-pod.yml +sudo kubectl apply -f /vagrant/multus/multus-sctp-service.yml /vagrant/wait_ready.sh diff --git a/cicd/k3s-flannel-multus/multus/macvlan.yml b/cicd/k3s-flannel-multus/multus/macvlan.yml index 9d455338b..97b50df0c 100644 --- a/cicd/k3s-flannel-multus/multus/macvlan.yml +++ b/cicd/k3s-flannel-multus/multus/macvlan.yml @@ -17,7 +17,7 @@ spec: "rangeEnd": "4.0.6.100", "routes": [ { - "dst": "4.0.5.0/24" + "dst": "0.0.0.0/0" } ], "gateway": "4.0.6.149"