1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

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

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