Skip to content

Commit

Permalink
loxilb-io#87 Do not use of docker pid and cgroup option for all cases
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholeawsm committed Jul 28, 2024
1 parent 80a807f commit 0b30e7b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions cicd/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ hostdocker="ghcr.io/loxilb-io/nettest:latest"
cluster_opts=""
extra_opts=""
ka_opts=""
docker_extra_opts=""
#var=$(lsb_release -r | cut -f2)
#if [[ $var == *"22.04"* ]];then
# lxdocker="ghcr.io/loxilb-io/loxilb:latestu22"
Expand Down Expand Up @@ -76,7 +77,7 @@ spawn_docker_host() {
fi
shift 2
;;
-d | --ka-config )
-n | --ka-config )
kpath="$2"
if [[ -z ${ka+x} ]]; then
ka="in"
Expand All @@ -87,6 +88,10 @@ spawn_docker_host() {
extra_opts="$2"
shift 2
;;
-x | --docker-args)
docker_extra_opts="$2"
shift 2
;;
-*|--*)
echo "Unknown option $1"
exit
Expand All @@ -109,11 +114,11 @@ spawn_docker_host() {
fi
if [[ ! -z ${ka+x} ]]; then
sudo mkdir -p /etc/shared/$dname/
docker run -u root --cap-add SYS_ADMIN --restart unless-stopped --privileged -dt --pid=host --cgroupns=host --entrypoint /bin/bash $bgp_conf -v /dev/log:/dev/log -v /etc/shared/$dname:/etc/shared $loxilb_config --name $dname $lxdocker
docker run -u root --cap-add SYS_ADMIN --restart unless-stopped --privileged -dt $docker_extra_opts --entrypoint /bin/bash $bgp_conf -v /dev/log:/dev/log -v /etc/shared/$dname:/etc/shared $loxilb_config --name $dname $lxdocker
get_llb_peerIP $dname
docker exec -dt $dname /root/loxilb-io/loxilb/loxilb $bgp_opts $cluster_opts $ka_opts $extra_opts
else
docker run -u root --cap-add SYS_ADMIN --restart unless-stopped --privileged -dt --pid=host --cgroupns=host --entrypoint /bin/bash $bgp_conf -v /dev/log:/dev/log $loxilb_config --name $dname $lxdocker $bgp_opts
docker run -u root --cap-add SYS_ADMIN --restart unless-stopped --privileged -dt $docker_extra_opts --entrypoint /bin/bash $bgp_conf -v /dev/log:/dev/log $loxilb_config --name $dname $lxdocker $bgp_opts
docker exec -dt $dname /root/loxilb-io/loxilb/loxilb $bgp_opts $cluster_opts $extra_opts
fi
elif [[ "$dtype" == "host" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion cicd/tcplb-local/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo "#########################################"
echo "Spawning all hosts"
echo "#########################################"

spawn_docker_host --dock-type loxilb --dock-name llb1 --extra-args "--localsockpolicy"
spawn_docker_host --dock-type loxilb --dock-name llb1 --docker-args "--pid=host --cgroupns=host" --extra-args "--localsockpolicy"
spawn_docker_host --dock-type host --dock-name l3h1
spawn_docker_host --dock-type host --dock-name l3ep1
spawn_docker_host --dock-type host --dock-name l3ep2
Expand Down

0 comments on commit 0b30e7b

Please sign in to comment.