2 ##############################################################################
3 # Copyright (c) 2018 Huawei Tech and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10 K8S_CONFIG="/tmp/k8s_config"
12 usage="Script to prepare kubenetes test configurations.
15 bash $(basename "$0") [-h|--help] [-i|--installer <installer typer>] [-c|--config <k8s config>]
18 -h|--help show the help text
19 -i|--installer specify the installer for the system to be monitored
24 $(basename "$0") -i compass"
28 logger -s -t "BOTTLENECKS INFO" "$*"
32 logger -s -t "BOTTLENECKS ERROR" "$*"
36 # Process input variables
55 error "unkown input options $1 $2"
62 if [[ ${INSTALLER_TYPE} == 'compass' ]]; then
63 sshpass -p root scp -o StrictHostKeyChecking=no root@10.1.0.50:~/.kube/config ${K8S_CONFIG}
65 echo "BOTTLENECKS EROOR: unrecognized installer"
68 if [[ -f ${K8S_CONFIG} ]]; then
69 if [[ -d ~/.kube ]]; then
70 cp ${K8S_CONFIG} ~/.kube/config
71 echo "BOTTLENECKS INFO: copying k8s config to ~./kube"
74 cp ${K8S_CONFIG} ~/.kube/config
75 echo "BOTTLENECKS INFO: copying k8s config to ~./kube"
78 echo "BOTTLENECKS ERROR: k8s config file does no exit (${K8S_CONFIG})"