Fix gate script for devstack-gate
Change-Id: I8913144c88aa4de76af5224dc0337d02e63fc39d
This commit is contained in:
parent
5dba23dc84
commit
503bee80d6
@ -126,7 +126,9 @@ kubernetes_opts = [
|
||||
),
|
||||
cfg.StrOpt(
|
||||
'kube_host',
|
||||
help='Kubernetes server address.'
|
||||
default='127.0.0.1:8001',
|
||||
help='Kubernetes server address, e.g. you can start a proxy to the '
|
||||
'Kubernetes API server by using "kubectl proxy" command.'
|
||||
),
|
||||
cfg.IPOpt(
|
||||
'qinling_service_address',
|
||||
|
@ -14,11 +14,13 @@
|
||||
|
||||
# This script is executed inside pre_test_hook function in devstack gate.
|
||||
|
||||
set -x
|
||||
set -ex
|
||||
|
||||
export localconf=$BASE/new/devstack/local.conf
|
||||
export QINLING_CONF=/etc/qinling/qinling.conf
|
||||
|
||||
# Install k8s cluster
|
||||
bash $BASE/new/qinling/tools/gate/setup_gate.sh
|
||||
|
||||
echo -e '[[post-config|$QINLING_CONF]]\n[kubernetes]\n' >> $localconf
|
||||
echo -e 'qinling_service_address=${DEFAULT_HOST_IP}\n' >> $localconf
|
||||
echo -e 'kube_host=${K8S_SERVICE_IP}:8001\n' >> $localconf
|
||||
|
@ -37,7 +37,7 @@ function kube_wait_for_pods {
|
||||
break || true
|
||||
sleep 1
|
||||
now=$(date +%s)
|
||||
[ $now -gt $end ] && echo containers failed to start. && \
|
||||
[ $now -gt $end ] && echo "containers failed to start." && \
|
||||
kubectl get pods --namespace $1 -o wide && exit -1
|
||||
done
|
||||
set -x
|
||||
@ -72,7 +72,6 @@ function kube_wait_for_nodes {
|
||||
|
||||
function kubeadm_aio_reqs_install {
|
||||
if [ "x$HOST_OS" == "xubuntu" ]; then
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y --no-install-recommends -qq \
|
||||
docker.io \
|
||||
jq
|
||||
|
@ -36,3 +36,8 @@ net_hosts_pre_kube
|
||||
|
||||
# Setup the K8s Cluster
|
||||
bash ${WORK_DIR}/tools/gate/kubeadm_aio.sh
|
||||
|
||||
# Starts a proxy to the Kubernetes API server in a screen session
|
||||
sudo screen -S kube_proxy -X quit || true
|
||||
sudo screen -dmS kube_proxy && screen -S kube_proxy -X screen -t kube_proxy
|
||||
sudo screen -S kube_proxy -p kube_proxy -X stuff 'kubectl proxy --accept-hosts=".*" --address="0.0.0.0"\n'
|
||||
|
@ -61,7 +61,7 @@ sudo docker run \
|
||||
|
||||
echo "Waiting for kubeconfig"
|
||||
set +x
|
||||
end=$(($(date +%s) + 240))
|
||||
end=$(($(date +%s) + 600))
|
||||
READY="False"
|
||||
while true; do
|
||||
if [ -f ${HOME}/.kubeadm-aio/admin.conf ]; then
|
||||
@ -82,7 +82,7 @@ export KUBECONFIG=${HOME}/.kubeadm-aio/admin.conf
|
||||
|
||||
echo "Waiting for node to be ready before continuing"
|
||||
set +x
|
||||
end=$(($(date +%s) + 240))
|
||||
end=$(($(date +%s) + 600))
|
||||
READY="False"
|
||||
while true; do
|
||||
READY=$(kubectl get nodes --no-headers=true | awk "{ print \$2 }" | head -1)
|
||||
@ -94,9 +94,3 @@ while true; do
|
||||
sudo docker logs kubeadm-aio && exit -1
|
||||
done
|
||||
set -x
|
||||
|
||||
: ${PVC_BACKEND:="nfs"}
|
||||
if [ "$PVC_BACKEND" == "nfs" ]; then
|
||||
# Deploy NFS provisioner into enviromment
|
||||
sudo docker exec kubeadm-aio openstack-helm-nfs-prep
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user