Merge "KubeADM-AIO container tidy"

This commit is contained in:
Jenkins 2017-05-05 21:19:55 +00:00 committed by Gerrit Code Review
commit c188941178
2 changed files with 31 additions and 13 deletions

View File

@ -29,7 +29,7 @@ kube_wait_for_pods openstack 600
helm install local/keystone --name=keystone --namespace=openstack helm install local/keystone --name=keystone --namespace=openstack
kube_wait_for_pods openstack 240 kube_wait_for_pods openstack 240
helm install local/glance --name=glance --namespace=openstack --values=${WORK_DIR}/tools/overrides/glance.yaml helm install local/glance --name=glance --namespace=openstack --values=${WORK_DIR}/tools/overrides/mvp/glance.yaml
helm install local/nova --name=nova --namespace=openstack --values=${WORK_DIR}/tools/overrides/nova.yaml --set=conf.nova.libvirt.nova.conf.virt_type=qemu helm install local/nova --name=nova --namespace=openstack --values=${WORK_DIR}/tools/overrides/mvp/nova.yaml --set=conf.nova.libvirt.nova.conf.virt_type=qemu
helm install local/neutron --name=neutron --namespace=openstack --values=${WORK_DIR}/tools/overrides/neutron.yaml helm install local/neutron --name=neutron --namespace=openstack --values=${WORK_DIR}/tools/overrides/mvp/neutron.yaml
kube_wait_for_pods openstack 600 kube_wait_for_pods openstack 600

View File

@ -53,23 +53,41 @@ sudo docker run \
--env KUBE_VERSION=${KUBE_VERSION} \ --env KUBE_VERSION=${KUBE_VERSION} \
${KUBEADM_IMAGE} ${KUBEADM_IMAGE}
# Wait for kubeconfig echo "Waiting for kubeconfig"
while [[ ! -f ${HOME}/.kubeadm-aio/admin.conf ]]; do set +x
echo "Waiting for kubeconfig" end=$(($(date +%s) + 120))
sleep 2 READY="False"
while true; do
if [ -f ${HOME}/.kubeadm-aio/admin.conf ]; then
READY="True"
fi
[ $READY == "True" ] && break || true
sleep 1
now=$(date +%s)
[ $now -gt $end ] && \
echo "KubeADM did not generate kubectl config in time" && \
docker logs kubeadm-aio && exit -1
done done
set -x
# Set perms of kubeconfig and set env-var # Set perms of kubeconfig and set env-var
sudo chown $(id -u):$(id -g) ${HOME}/.kubeadm-aio/admin.conf sudo chown $(id -u):$(id -g) ${HOME}/.kubeadm-aio/admin.conf
export KUBECONFIG=${HOME}/.kubeadm-aio/admin.conf export KUBECONFIG=${HOME}/.kubeadm-aio/admin.conf
# Wait for node to be ready before continuing echo "Waiting for node to be ready before continuing"
NODE_STATUS="Unknown" set +x
while [[ $NODE_STATUS != "Ready" ]]; do end=$(($(date +%s) + 240))
NODE_STATUS=$(kubectl get nodes --no-headers=true | awk "{ print \$2 }" | head -1) READY="False"
echo "Current node status: ${NODE_STATUS}" while true; do
sleep 2 READY=$(kubectl get nodes --no-headers=true | awk "{ print \$2 }" | head -1)
[ $READY == "Ready" ] && break || true
sleep 1
now=$(date +%s)
[ $now -gt $end ] && \
echo "Kube node did not register as ready in time" && \
docker logs kubeadm-aio && exit -1
done done
set -x
# Initialize Helm # Initialize Helm
helm init helm init