Merge "Skip k8s installation if needed"

This commit is contained in:
Zuul 2018-10-30 11:43:34 +00:00 committed by Gerrit Code Review
commit 4e9d87148e
2 changed files with 21 additions and 12 deletions

View File

@ -131,17 +131,21 @@ function configure_qinling {
# Configure the database. # Configure the database.
iniset $QINLING_CONF_FILE database connection `database_connection_url qinling` iniset $QINLING_CONF_FILE database connection `database_connection_url qinling`
# Configure Kubernetes API server certificates for qinling if required. if [ "$QINLING_INSTALL_K8S" == "True" ]; then
if [ "$QINLING_K8S_APISERVER_TLS" == "True" ]; then # Configure Kubernetes API server certificates for qinling if required.
iniset $QINLING_CONF_FILE kubernetes kube_host https://$(hostname -f):6443 if [ "$QINLING_K8S_APISERVER_TLS" == "True" ]; then
configure_k8s_certificates iniset $QINLING_CONF_FILE kubernetes kube_host https://$(hostname -f):6443
sudo kubectl create -f $QINLING_DIR/example/kubernetes/k8s_qinling_role.yaml configure_k8s_certificates
else sudo kubectl create -f $QINLING_DIR/example/kubernetes/k8s_qinling_role.yaml
iniset $QINLING_CONF_FILE kubernetes use_api_certificate False else
fi iniset $QINLING_CONF_FILE kubernetes use_api_certificate False
fi
# Config etcd TLS certs # Config etcd TLS certs
configure_etcd_certificates configure_etcd_certificates
else
echo_summary "Skip k8s related configuration"
fi
iniset $QINLING_CONF_FILE kubernetes replicas 5 iniset $QINLING_CONF_FILE kubernetes replicas 5
} }
@ -191,8 +195,12 @@ if is_service_enabled qinling; then
create_qinling_accounts create_qinling_accounts
fi fi
echo_summary "Installing kubernetes cluster" if [ "$QINLING_INSTALL_K8S" == "True" ]; then
install_k8s echo_summary "Installing kubernetes cluster"
install_k8s
else
echo_summary "Skip kubernetes cluster installation"
fi
configure_qinling configure_qinling

View File

@ -26,4 +26,5 @@ QINLING_PYTHON_RUNTIME_IMAGE=${QINLING_PYTHON_RUNTIME_IMAGE:-openstackqinling/py
QINLING_NODEJS_RUNTIME_IMAGE=${QINLING_NODEJS_RUNTIME_IMAGE:-openstackqinling/nodejs-runtime:0.0.1} QINLING_NODEJS_RUNTIME_IMAGE=${QINLING_NODEJS_RUNTIME_IMAGE:-openstackqinling/nodejs-runtime:0.0.1}
QINLING_SIDECAR_IMAGE=${QINLING_SIDECAR_IMAGE:-openstackqinling/sidecar:0.0.2} QINLING_SIDECAR_IMAGE=${QINLING_SIDECAR_IMAGE:-openstackqinling/sidecar:0.0.2}
QINLING_INSTALL_K8S=${QINLING_INSTALL_K8S:-True}
QINLING_K8S_APISERVER_TLS=${QINLING_K8S_APISERVER_TLS:-True} QINLING_K8S_APISERVER_TLS=${QINLING_K8S_APISERVER_TLS:-True}