Gate: fix multinode support for running outside of zuul

This PS fixes multinode operation when run outside of zuul.

Change-Id: I66fecae7c14fa4022882235d656f5c0ac97c12bc
This commit is contained in:
Pete Birley 2017-06-29 15:59:16 -05:00
parent c60c29b737
commit 5fd358f0ba
3 changed files with 5 additions and 3 deletions

View File

@ -15,7 +15,8 @@ sudo chmod 777 --recursive ${LOGS_DIR}/*
mkdir -p ${LOGS_DIR}/k8s
for OBJECT_TYPE in nodes \
namespace; do
namespace \
storageclass; do
kubectl get ${OBJECT_TYPE} -o yaml > ${LOGS_DIR}/k8s/${OBJECT_TYPE}.yaml
done
kubectl describe nodes > ${LOGS_DIR}/k8s/nodes.txt

View File

@ -54,8 +54,8 @@ function kube_wait_for_nodes {
end=$((end + 180))
fi
while true; do
NUMBER_OF_NODES_EXPECTED=$1
NUMBER_OF_NODES=$(kubectl get nodes --no-headers -o name | wc -l)
NUMBER_OF_NODES_EXPECTED=$(($(cat /etc/nodepool/sub_nodes_private | wc -l) + 1))
[ $NUMBER_OF_NODES -eq $NUMBER_OF_NODES_EXPECTED ] && \
NODES_ONLINE="True" || NODES_ONLINE="False"
while read SUB_NODE; do

View File

@ -16,6 +16,7 @@ set -ex
: ${SSH_PRIVATE_KEY:="/etc/nodepool/id_rsa"}
: ${PRIMARY_NODE_IP:="$(cat /etc/nodepool/primary_node_private | tail -1)"}
: ${SUB_NODE_IPS:="$(cat /etc/nodepool/sub_nodes_private)"}
export SUB_NODE_COUNT="$(($(echo ${SUB_NODE_IPS} | wc -w) + 1))"
sudo chown $(whoami) ${SSH_PRIVATE_KEY}
sudo chmod 600 ${SSH_PRIVATE_KEY}
@ -40,7 +41,7 @@ bash ${SUB_NODE_PROVISION_SCRIPT}
rm -rf ${SUB_NODE_PROVISION_SCRIPT}
source ${WORK_DIR}/tools/gate/funcs/kube.sh
kube_wait_for_nodes 240
kube_wait_for_nodes ${SUB_NODE_COUNT} 240
kube_wait_for_pods kube-system 240
kube_wait_for_pods openstack 240
kubectl get nodes --show-all