From 13fd26c9dfdfbe70eba3da738cc932814b072b92 Mon Sep 17 00:00:00 2001 From: "Yang (Gabriel) Yu" Date: Thu, 9 Aug 2018 13:07:31 +0800 Subject: add k8s test configs preparation JIRA: BOTTLENECK-243 Change-Id: I994c71f03c4c2429d62618920cfc92fc1ed16abe Signed-off-by: Yang (Gabriel) Yu --- utils/k8s_setup/k8s_config_pre.sh | 66 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 utils/k8s_setup/k8s_config_pre.sh (limited to 'utils/k8s_setup/k8s_config_pre.sh') diff --git a/utils/k8s_setup/k8s_config_pre.sh b/utils/k8s_setup/k8s_config_pre.sh new file mode 100644 index 00000000..f41ba78d --- /dev/null +++ b/utils/k8s_setup/k8s_config_pre.sh @@ -0,0 +1,66 @@ +#!/bin/bash +############################################################################## +# Copyright (c) 2018 Huawei Tech and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +K8S_CONFIG="/tmp/k8s_conig" + +usage="Script to prepare kubenetes test configurations. + +usage: + bash $(basename "$0") [-h|--help] [-i|--installer ] [-c|--config ] + +where: + -h|--help show the help text + -i|--installer specify the installer for the system to be monitored + + one of the following: + (compass) +examples: + $(basename "$0") -i compass" + + +info () { + logger -s -t "BOTTLENECKS INFO" "$*" +} + +error () { + logger -s -t "BOTTLENECKS ERROR" "$*" + exit 1 +} + +# Process input variables +while [[ $# > 0 ]] + do + key="$1" + case $key in + -h|--help) + echo "$usage" + exit 0 + shift + ;; + -i|--installer) + INSTALLER_TYPE="$2" + shift + ;; + -c|--config) + K8S_CONFIG="$2" + shift + ;; + *) + error "unkown input options $1 $2" + exit 1 + ;; + esac + shift +done + +if [[ ${INSTALLER_TYPE} == 'compass' ]]; then + sshpass -p root scp root@192.16.1.222:~/.kube/config ${K8S_CONFIG} +else + echo "BOTTLENECKS EROOR: unrecognized installer" +fi -- cgit 1.2.3-korg