add check on node LB in support.sh

Starting from 18.09, there's a per node LB for each overlay
network, this change adds the check to node LB.
This change should not break on older docker versions.

Signed-off-by: Xinfeng Liu <xinfeng.liu@gmail.com>
This commit is contained in:
Xinfeng Liu 2019-05-07 16:45:01 +08:00
parent 60b2a582d4
commit 74013a3899
1 changed files with 15 additions and 11 deletions

View File

@ -76,23 +76,27 @@ echo "Overlay network configuration"
for networkID in $(${DOCKER} network ls --no-trunc --filter driver=overlay -q) "ingress_sbox"; do
echo "nnn Network ${networkID}"
if [ "${networkID}" != "ingress_sbox" ]; then
nspath=(${NSDIR}/*-${networkID:0:10})
nspath=($(ls ${NSDIR}/*${networkID:0:9}*))
inspect_output=$(${DOCKER} network inspect ${NETINSPECT_VERBOSE_SUPPORT} ${networkID})
echo "$inspect_output"
check_ip_overlap $inspect_output
else
nspath=(${NSDIR}/${networkID})
fi
echo_and_run ${NSENTER} --net=${nspath[0]} ${IP} -o -4 address show
echo_and_run ${NSENTER} --net=${nspath[0]} ${IP} -4 route show
echo_and_run ${NSENTER} --net=${nspath[0]} ${IP} -4 neigh show
echo_and_run ${NSENTER} --net=${nspath[0]} ${BRIDGE} fdb show
echo_and_run ${NSENTER} --net=${nspath[0]} ${IPTABLES} -w1 -n -v -L -t filter | grep -v '^$'
echo_and_run ${NSENTER} --net=${nspath[0]} ${IPTABLES} -w1 -n -v -L -t nat | grep -v '^$'
echo_and_run ${NSENTER} --net=${nspath[0]} ${IPTABLES} -w1 -n -v -L -t mangle | grep -v '^$'
echo_and_run ${NSENTER} --net=${nspath[0]} ${IPVSADM} -l -n
printf "\n"
((networks++))
for i in "${nspath[@]}"
do
echo_and_run ${NSENTER} --net=${i} ${IP} -o -4 address show
echo_and_run ${NSENTER} --net=${i} ${IP} -4 route show
echo_and_run ${NSENTER} --net=${i} ${IP} -4 neigh show
echo_and_run ${NSENTER} --net=${i} ${BRIDGE} fdb show
echo_and_run ${NSENTER} --net=${i} ${IPTABLES} -w1 -n -v -L -t filter | grep -v '^$'
echo_and_run ${NSENTER} --net=${i} ${IPTABLES} -w1 -n -v -L -t nat | grep -v '^$'
echo_and_run ${NSENTER} --net=${i} ${IPTABLES} -w1 -n -v -L -t mangle | grep -v '^$'
echo_and_run ${NSENTER} --net=${i} ${IPVSADM} -l -n
printf "\n"
((networks++))
done
done
echo "Container network configuration"