[fuel] Handle kubernetes config 37/67337/2
authorMichael Polenchuk <mpolenchuk@mirantis.com>
Fri, 22 Mar 2019 12:20:45 +0000 (16:20 +0400)
committerMichael Polenchuk <mpolenchuk@mirantis.com>
Fri, 22 Mar 2019 15:04:17 +0000 (19:04 +0400)
Change-Id: I87b7d74b22341d9c091c16436a9d4a6cfce173d5
Signed-off-by: Michael Polenchuk <mpolenchuk@mirantis.com>
jjb/functest/functest-k8.sh
utils/fetch_k8_conf.sh

index 419c4e0..8561b02 100755 (executable)
@@ -20,6 +20,13 @@ if [[ ${INSTALLER_TYPE} == 'compass' ]]; then
 elif [[ ${INSTALLER_TYPE} == 'joid' && ${BRANCH} == 'master' ]]; then
     admin_conf_file_vol="-v ${HOME}/joid_config/config:/root/.kube/config"
     rc_file=${HOME}/joid_config/k8config
+elif [[ ${INSTALLER_TYPE} == 'fuel' ]]; then
+    admin_conf_file_vol="-v ${HOME}/admin.conf:/root/.kube/config"
+    KUBE_MASTER_URL=$(awk '/server:/ {print $2}' ${HOME}/admin.conf | grep -Fv localhost)
+    KUBE_MASTER_IP=$(echo $KUBE_MASTER_URL | grep -Po '(\d+\.){3}\d+')
+    for k in KUBERNETES_PROVIDER KUBE_MASTER_URL KUBE_MASTER_IP; do
+        echo "export $k=${!k}" >> $rc_file
+    done
 else
     echo "Not supported by other installers yet"
     exit 1
index 32c07f8..b3be0d6 100755 (executable)
@@ -59,6 +59,9 @@ if [ "$installer_type" == "compass" ]; then
     info "Fetch admin.conf successfully"
 elif [ "$installer_type" == "joid" ]; then
     info "Do nothing, config file has been provided in $HOME/joid_config/config for joid"
+elif [ "$installer_type" == "fuel" ]; then
+    info "Getting kubernetes config ..."
+    docker cp fuel:/opt/kubernetes.config $dest_path
 else
     error "Installer $installer_type is not supported by this script"
 fi