Merge "Ceph: Fix Multinode Gates"
This commit is contained in:
commit
dbfbbda826
@ -46,7 +46,11 @@ nameserver ${UPSTREAM_DNS}
|
|||||||
search cluster.local svc.cluster.local
|
search cluster.local svc.cluster.local
|
||||||
EOF"
|
EOF"
|
||||||
|
|
||||||
SUBNET_RANGE=$(find_subnet_range)
|
if [ "x$INTEGRATION" == "xmulti" ]; then
|
||||||
|
SUBNET_RANGE="$(find_multi_subnet_range)"
|
||||||
|
else
|
||||||
|
SUBNET_RANGE=$(find_subnet_range)
|
||||||
|
fi
|
||||||
|
|
||||||
export osd_cluster_network=${SUBNET_RANGE}
|
export osd_cluster_network=${SUBNET_RANGE}
|
||||||
export osd_public_network=${SUBNET_RANGE}
|
export osd_public_network=${SUBNET_RANGE}
|
||||||
|
@ -54,3 +54,29 @@ function find_subnet_range {
|
|||||||
echo "$NETWORK/$PREFIX"
|
echo "$NETWORK/$PREFIX"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function find_multi_subnet_range {
|
||||||
|
: ${PRIMARY_NODE_IP:="$(cat /etc/nodepool/primary_node | tail -1)"}
|
||||||
|
: ${SUB_NODE_IPS:="$(cat /etc/nodepool/sub_nodes)"}
|
||||||
|
NODE_IPS="${PRIMARY_NODE_IP} ${SUB_NODE_IPS}"
|
||||||
|
NODE_IP_UNSORTED=$(mktemp --suffix=.txt)
|
||||||
|
for NODE_IP in $NODE_IPS; do
|
||||||
|
echo $NODE_IP >> ${NODE_IP_UNSORTED}
|
||||||
|
done
|
||||||
|
NODE_IP_SORTED=$(mktemp --suffix=.txt)
|
||||||
|
sort -V ${NODE_IP_UNSORTED} > ${NODE_IP_SORTED}
|
||||||
|
rm -f ${NODE_IP_UNSORTED}
|
||||||
|
FIRST_IP_SUBNET=$(ipcalc "$(head -n 1 ${NODE_IP_SORTED})/24" | awk '/^Network/ { print $2 }')
|
||||||
|
LAST_IP_SUBNET=$(ipcalc "$(tail -n 1 ${NODE_IP_SORTED})/24" | awk '/^Network/ { print $2 }')
|
||||||
|
rm -f ${NODE_IP_SORTED}
|
||||||
|
function ip_diff {
|
||||||
|
echo $(($(echo $LAST_IP_SUBNET | awk -F '.' "{ print \$$1}") - $(echo $FIRST_IP_SUBNET | awk -F '.' "{ print \$$1}")))
|
||||||
|
}
|
||||||
|
for X in {1..4}; do
|
||||||
|
if ! [ "$(ip_diff $X)" -eq "0" ]; then
|
||||||
|
SUBMASK=$(((($X - 1 )) * 8))
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo ${FIRST_IP_SUBNET%/*}/${SUBMASK}
|
||||||
|
}
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
: ${SSH_PRIVATE_KEY:="/etc/nodepool/id_rsa"}
|
: ${SSH_PRIVATE_KEY:="/etc/nodepool/id_rsa"}
|
||||||
: ${PRIMARY_NODE_IP:="$(cat /etc/nodepool/primary_node_private | tail -1)"}
|
: ${PRIMARY_NODE_IP:="$(cat /etc/nodepool/primary_node | tail -1)"}
|
||||||
: ${SUB_NODE_IPS:="$(cat /etc/nodepool/sub_nodes_private)"}
|
: ${SUB_NODE_IPS:="$(cat /etc/nodepool/sub_nodes)"}
|
||||||
export SUB_NODE_COUNT="$(($(echo ${SUB_NODE_IPS} | wc -w) + 1))"
|
export SUB_NODE_COUNT="$(($(echo ${SUB_NODE_IPS} | wc -w) + 1))"
|
||||||
|
|
||||||
sudo chown $(whoami) ${SSH_PRIVATE_KEY}
|
sudo chown $(whoami) ${SSH_PRIVATE_KEY}
|
||||||
|
Loading…
Reference in New Issue
Block a user