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>
| ... | ... |
@@ -76,23 +76,27 @@ echo "Overlay network configuration" |
| 76 | 76 |
for networkID in $(${DOCKER} network ls --no-trunc --filter driver=overlay -q) "ingress_sbox"; do
|
| 77 | 77 |
echo "nnn Network ${networkID}"
|
| 78 | 78 |
if [ "${networkID}" != "ingress_sbox" ]; then
|
| 79 |
- nspath=(${NSDIR}/*-${networkID:0:10})
|
|
| 79 |
+ nspath=($(ls ${NSDIR}/*${networkID:0:9}*))
|
|
| 80 | 80 |
inspect_output=$(${DOCKER} network inspect ${NETINSPECT_VERBOSE_SUPPORT} ${networkID})
|
| 81 | 81 |
echo "$inspect_output" |
| 82 | 82 |
check_ip_overlap $inspect_output |
| 83 | 83 |
else |
| 84 | 84 |
nspath=(${NSDIR}/${networkID})
|
| 85 | 85 |
fi |
| 86 |
- echo_and_run ${NSENTER} --net=${nspath[0]} ${IP} -o -4 address show
|
|
| 87 |
- echo_and_run ${NSENTER} --net=${nspath[0]} ${IP} -4 route show
|
|
| 88 |
- echo_and_run ${NSENTER} --net=${nspath[0]} ${IP} -4 neigh show
|
|
| 89 |
- echo_and_run ${NSENTER} --net=${nspath[0]} ${BRIDGE} fdb show
|
|
| 90 |
- echo_and_run ${NSENTER} --net=${nspath[0]} ${IPTABLES} -w1 -n -v -L -t filter | grep -v '^$'
|
|
| 91 |
- echo_and_run ${NSENTER} --net=${nspath[0]} ${IPTABLES} -w1 -n -v -L -t nat | grep -v '^$'
|
|
| 92 |
- echo_and_run ${NSENTER} --net=${nspath[0]} ${IPTABLES} -w1 -n -v -L -t mangle | grep -v '^$'
|
|
| 93 |
- echo_and_run ${NSENTER} --net=${nspath[0]} ${IPVSADM} -l -n
|
|
| 94 |
- printf "\n" |
|
| 95 |
- ((networks++)) |
|
| 86 |
+ |
|
| 87 |
+ for i in "${nspath[@]}"
|
|
| 88 |
+ do |
|
| 89 |
+ echo_and_run ${NSENTER} --net=${i} ${IP} -o -4 address show
|
|
| 90 |
+ echo_and_run ${NSENTER} --net=${i} ${IP} -4 route show
|
|
| 91 |
+ echo_and_run ${NSENTER} --net=${i} ${IP} -4 neigh show
|
|
| 92 |
+ echo_and_run ${NSENTER} --net=${i} ${BRIDGE} fdb show
|
|
| 93 |
+ echo_and_run ${NSENTER} --net=${i} ${IPTABLES} -w1 -n -v -L -t filter | grep -v '^$'
|
|
| 94 |
+ echo_and_run ${NSENTER} --net=${i} ${IPTABLES} -w1 -n -v -L -t nat | grep -v '^$'
|
|
| 95 |
+ echo_and_run ${NSENTER} --net=${i} ${IPTABLES} -w1 -n -v -L -t mangle | grep -v '^$'
|
|
| 96 |
+ echo_and_run ${NSENTER} --net=${i} ${IPVSADM} -l -n
|
|
| 97 |
+ printf "\n" |
|
| 98 |
+ ((networks++)) |
|
| 99 |
+ done |
|
| 96 | 100 |
done |
| 97 | 101 |
|
| 98 | 102 |
echo "Container network configuration" |