From 0b30e7b50f8e45eac034c138418bc1bd94cc1f02 Mon Sep 17 00:00:00 2001 From: Nichole Turner Date: Sun, 28 Jul 2024 14:29:59 +0900 Subject: [PATCH] #87 Do not use of docker pid and cgroup option for all cases --- cicd/common.sh | 11 ++++++++--- cicd/tcplb-local/config.sh | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cicd/common.sh b/cicd/common.sh index fcf7ea8ec..807aa8870 100644 --- a/cicd/common.sh +++ b/cicd/common.sh @@ -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" @@ -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" @@ -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 @@ -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 diff --git a/cicd/tcplb-local/config.sh b/cicd/tcplb-local/config.sh index b5fe0db0b..ef7569559 100755 --- a/cicd/tcplb-local/config.sh +++ b/cicd/tcplb-local/config.sh @@ -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