Skip to content

Commit

Permalink
BFD Implementation - changes for cicd scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
TrekkieCoder committed Feb 8, 2024
1 parent d9f2ea6 commit dfa4f72
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 108 deletions.
20 changes: 14 additions & 6 deletions cicd/k3s-flannel/bird_config/bird.conf
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ protocol static {
# };
# };
#}

#
# Define simple filter as an example for BGP import filter
# See https://gitlab.labs.nic.cz/labs/bird/wikis/BGP_filtering for more examples
# filter rt_import
Expand Down Expand Up @@ -203,22 +203,30 @@ protocol static {
# neighbor 10.0.3.1;
# }
#
filter import_my_routes {
if (net = 0.0.0.0/0) then
{
reject;
}
accept;
}

protocol bgp llb1 {
local as 64512;
local 12.12.12.254 as 64514;
neighbor 12.12.12.1 as 64512;

ipv4 {
import all;
import filter import_my_routes;
export all;
};
}

protocol bgp llb2 {
local 14.14.14.254 as 64512;
neighbor 14.14.14.1 as 64512;
local 12.12.12.254 as 64514;
neighbor 12.12.12.2 as 64512;

ipv4 {
import all;
import filter import_my_routes;
export all;
};
}
Expand Down
20 changes: 13 additions & 7 deletions cicd/k3s-flannel/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ echo "#########################################"
echo "Spawning all hosts"
echo "#########################################"

spawn_docker_host --dock-type loxilb --dock-name llb1 --with-bgp yes --bgp-config $(pwd)/llb1_gobgp_config --with-ka in
spawn_docker_host --dock-type loxilb --dock-name llb2 --with-bgp yes --bgp-config $(pwd)/llb2_gobgp_config --with-ka in
spawn_docker_host --dock-type loxilb --dock-name llb1 --with-bgp yes --with-ka in
spawn_docker_host --dock-type loxilb --dock-name llb2 --with-bgp yes --with-ka in
spawn_docker_host --dock-type host --dock-name ep1
spawn_docker_host --dock-type host --dock-name ep2
spawn_docker_host --dock-type host --dock-name ep3
Expand Down Expand Up @@ -37,16 +37,22 @@ sleep 3
sudo ip -n llb1 link set ellb1sys up
sudo ip -n llb1 addr add 12.12.12.1/24 dev ellb1sys
sudo ip link set esysllb1 up
sudo ip addr add 12.12.12.254/24 dev esysllb1
#sudo ip addr add 12.12.12.254/24 dev esysllb1

sudo ip link add ellb2sys type veth peer name esysllb2
sleep 3
sudo ip link set ellb2sys netns llb2
sleep 3
sudo ip -n llb2 link set ellb2sys up
sudo ip -n llb2 addr add 14.14.14.1/24 dev ellb2sys
sudo ip -n llb2 addr add 12.12.12.2/24 dev ellb2sys
sudo ip link set esysllb2 up
sudo ip addr add 14.14.14.254/24 dev esysllb2
#sudo ip addr add 14.14.14.254/24 dev esysllb2

sudo brctl addbr k3sbr
sudo brctl addif k3sbr esysllb2
sudo brctl addif k3sbr esysllb1
sudo ip link set k3sbr up
sudo ip addr add 12.12.12.254/24 dev k3sbr

#node1 config
config_docker_host --host1 user --host2 r1 --ptype phy --addr 1.1.1.1/24 --gw 1.1.1.254
Expand Down Expand Up @@ -99,8 +105,8 @@ $hexec r1 ip route add 20.20.20.1/32 via 11.11.11.11
#add_route llb2 1.1.1.0/24 11.11.11.254

## host network
sudo ip route add 11.11.11.11/32 via 14.14.14.1
sudo ip route add 123.123.123.1/32 via 14.14.14.1
#sudo ip route add 11.11.11.11/32 via 14.14.14.1
#sudo ip route add 123.123.123.1/32 via 14.14.14.1

sleep 1
##Create LB rule
Expand Down
5 changes: 3 additions & 2 deletions cicd/k3s-flannel/kube-loxilb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,11 @@ spec:
command:
- /bin/kube-loxilb
args:
- --loxiURL=http://12.12.12.1:11111,http://14.14.14.1:11111
- --loxiURL=http://12.12.12.1:11111,http://12.12.12.2:11111
- --externalCIDR=123.123.123.1/24
#- --monitor
#- --setBGP
- --setBGP=64512
- --extBGPPeers=10.10.10.254:64512,12.12.12.254:64514,11.11.11.254:64511
#- --setLBMode=1
#- --config=/opt/loxilb/agent/kube-loxilb.conf
resources:
Expand Down
46 changes: 0 additions & 46 deletions cicd/k3s-flannel/llb1_gobgp_config/gobgp.conf

This file was deleted.

45 changes: 0 additions & 45 deletions cicd/k3s-flannel/llb2_gobgp_config/gobgp.conf

This file was deleted.

8 changes: 6 additions & 2 deletions cicd/k3s-flannel/rmconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ fi

source ../common.sh

sudo ip route del 11.11.11.11/32 via 14.14.14.1
sudo ip route del 123.123.123.1/32 via 14.14.14.1
#sudo ip route del 11.11.11.11/32 via 14.14.14.1
#sudo ip route del 123.123.123.1/32 via 14.14.14.1

sudo kubectl $KUBECONFIG delete -f nginx-svc-lb1.yml >> /dev/null 2>&1
sudo kubectl $KUBECONFIG delete -f nginx-svc-lb.yml >> /dev/null 2>&1
Expand Down Expand Up @@ -39,6 +39,10 @@ delete_docker_host r2
delete_docker_host ep1
delete_docker_host ep2
delete_docker_host ep3
sudo brctl delif k3sbr esysllb2
sudo brctl delif k3sbr esysllb1
sudo ip link set k3sbr down
sudo brctl delbr k3sbr
sudo ip link del esysllb1
sudo ip link del esysllb2

Expand Down

0 comments on commit dfa4f72

Please sign in to comment.