-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added missing scripts for K8s calico L3 CICD case
- Loading branch information
1 parent
86ba4a5
commit 097d894
Showing
4 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## Test Case Description | ||
|
||
This scenario will have K8s(1 Master Nodes & 2 Worker Nodes) cluster with Calico CNI in ipvs mode. LoxiLB will be running as external Service LB. Workloads will be spawned in all the cluster nodes. | ||
|
||
Client will be connected to the LoxiLB with L3 network. Client and LoxiLB will run BGP peering. LoxiLB will advertise the Service CIDR or VirtualIP to the client. | ||
Service CIDR will also be a Virtual IP, different from the K8s cluster network. | ||
|
||
In scenarios where LoxiLB runs outside of the cluster, it is advised to create LB services in either one-arm or fullnat mode for ease of connectivity or else user has to resolve connectivity with either static routes or through BGP. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/bash | ||
extIP=$(cat /vagrant/extIP) | ||
|
||
mode="onearm" | ||
tcp_port=56002 | ||
udp_port=56003 | ||
sctp_port=56004 | ||
|
||
code=0 | ||
echo Service IP: $extIP | ||
|
||
numECMP=$(ip route list match $extIP | grep $extIP -A 2 | tail -n 2 | wc -l) | ||
|
||
ip route list match $extIP | grep $extIP -A 2 | ||
|
||
if [ $numECMP == "2" ]; then | ||
echo "Host ECMP route [OK]" | ||
else | ||
echo "Host ECMP route [NOK]" | ||
fi | ||
echo -e "\n*********************************************" | ||
echo "Testing Service" | ||
echo "*********************************************" | ||
for((i=0;i<20;i++)) | ||
do | ||
|
||
out=$(curl -s --connect-timeout 10 http://$extIP:$tcp_port) | ||
if [[ ${out} == *"Welcome to nginx"* ]]; then | ||
echo -e "K8s-calico-ipvs3 TCP\t($mode)\t[OK]" | ||
else | ||
echo -e "K8s-calico-ipvs3 TCP\t($mode)\t[FAILED]" | ||
code=1 | ||
fi | ||
|
||
out=$(timeout 5 /vagrant/udp_client $extIP $udp_port) | ||
if [[ ${out} == *"Client"* ]]; then | ||
echo -e "K8s-calico-ipvs3 UDP\t($mode)\t[OK]" | ||
else | ||
echo -e "K8s-calico-ipvs3 UDP\t($mode)\t[FAILED]" | ||
code=1 | ||
fi | ||
|
||
sctp_darn -H 192.168.80.9 -h 20.20.20.1 -p 56004 -s < /vagrant/input > output | ||
#sleep 2 | ||
exp="New connection, peer addresses | ||
20.20.20.1:56004" | ||
|
||
res=`cat output | grep -A 1 "New connection, peer addresses"` | ||
sudo rm -rf output | ||
if [[ "$res" == "$exp" ]]; then | ||
#echo $res | ||
echo -e "K8s-calico-ipvs3 SCTP\t($mode)\t[OK]" | ||
else | ||
echo -e "K8s-calico-ipvs3 SCTP\t($mode)\t[FAILED]" | ||
code=1 | ||
fi | ||
|
||
|
||
done | ||
exit $code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.