devstack: Have controller wait for K8s API

There could be cases, like for example when reusing existing K8s
services where the wait_for K8s API has not run at all before the
controller is run. This would end up in a controller failure, so we
address it here.

Change-Id: Id3946e8b970a1506d70d6448cc1667fb87415134
Signed-off-by: Antoni Segura Puimedon <antonisp@celebdor.com>
This commit is contained in:
Antoni Segura Puimedon 2016-12-20 23:21:03 +01:00
parent b1da475537
commit 1ff372cf63
No known key found for this signature in database
GPG Key ID: B71BE48A9A349926

View File

@ -428,6 +428,14 @@ function run_k8s_kubelet {
run_process kubelet "$command"
}
function run_kuryr_kubernetes {
wait_for "Kubernetes API Server" "$KURYR_K8S_API_URL"
run_process kuryr-kubernetes \
"python ${KURYR_HOME}/scripts/run_server.py \
--config-file $KURYR_CONFIG"
}
# main loop
if is_service_enabled kuryr-kubernetes; then
if [[ "$1" == "stack" && "$2" == "install" ]]; then
@ -489,9 +497,7 @@ if is_service_enabled kuryr-kubernetes; then
run_k8s_kubelet
fi
run_process kuryr-kubernetes \
"python ${KURYR_HOME}/scripts/run_server.py \
--config-file $KURYR_CONFIG"
run_kuryr_kubernetes
fi
if [[ "$1" == "unstack" ]]; then