From 152d517f8c860d3a13048998aefc8cc7de1a2029 Mon Sep 17 00:00:00 2001 From: Lingxian Kong Date: Mon, 29 Oct 2018 16:28:16 +1300 Subject: [PATCH] Skip k8s installation if needed Provide the user the ability to skip k8s installation in case user provides her own k8s and etcd deployment. Change-Id: Ief36778801720d5eb1d73cefbd6b00297b7241f1 --- devstack/plugin.sh | 32 ++++++++++++++++++++------------ devstack/settings | 1 + 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 1b103ba0..e5641f6a 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -131,17 +131,21 @@ function configure_qinling { # Configure the database. iniset $QINLING_CONF_FILE database connection `database_connection_url qinling` - # Configure Kubernetes API server certificates for qinling if required. - if [ "$QINLING_K8S_APISERVER_TLS" == "True" ]; then - iniset $QINLING_CONF_FILE kubernetes kube_host https://$(hostname -f):6443 - configure_k8s_certificates - sudo kubectl create -f $QINLING_DIR/example/kubernetes/k8s_qinling_role.yaml - else - iniset $QINLING_CONF_FILE kubernetes use_api_certificate False - fi + if [ "$QINLING_INSTALL_K8S" == "True" ]; then + # Configure Kubernetes API server certificates for qinling if required. + if [ "$QINLING_K8S_APISERVER_TLS" == "True" ]; then + iniset $QINLING_CONF_FILE kubernetes kube_host https://$(hostname -f):6443 + configure_k8s_certificates + sudo kubectl create -f $QINLING_DIR/example/kubernetes/k8s_qinling_role.yaml + else + iniset $QINLING_CONF_FILE kubernetes use_api_certificate False + fi - # Config etcd TLS certs - configure_etcd_certificates + # Config etcd TLS certs + configure_etcd_certificates + else + echo_summary "Skip k8s related configuration" + fi iniset $QINLING_CONF_FILE kubernetes replicas 5 } @@ -191,8 +195,12 @@ if is_service_enabled qinling; then create_qinling_accounts fi - echo_summary "Installing kubernetes cluster" - install_k8s + if [ "$QINLING_INSTALL_K8S" == "True" ]; then + echo_summary "Installing kubernetes cluster" + install_k8s + else + echo_summary "Skip kubernetes cluster installation" + fi configure_qinling diff --git a/devstack/settings b/devstack/settings index f5f1f11d..0e2424ee 100644 --- a/devstack/settings +++ b/devstack/settings @@ -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_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}