3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
18 HELM_VERSION
="v3.15.1"
21 #Helm releases can be found here: https://github.com/helm/helm/releases
22 function install_helm_client
() {
23 [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of
function
24 if ! [[ "$(helm version --short 2>/dev/null)" =~ ^v3.
* ]]; then
25 # Helm is not installed. Install helm
26 echo "Helm3 is not installed, installing ..."
27 curl https
://get.helm.sh
/helm-
${HELM_VERSION}-linux-amd64.
tar.gz
--output helm-
${HELM_VERSION}.
tar.gz
28 tar -zxvf helm-
${HELM_VERSION}.
tar.gz
29 sudo
mv linux-amd64
/helm
/usr
/local
/bin
/helm
31 rm helm-
${HELM_VERSION}.
tar.gz
33 echo "Helm3 is already installed. Skipping installation..."
35 helm version || FATAL_TRACK k8scluster
"Could not obtain helm version. Maybe helm client was not installed"
36 helm repo add stable https
://charts.helm.sh
/stable || FATAL_TRACK k8scluster
"Helm repo stable could not be added"
37 helm repo update || FATAL_TRACK k8scluster
"Helm repo stable could not be updated"
38 [ -z "${DEBUG_INSTALL}" ] || DEBUG end of
function
42 while getopts ":D:-: " o
; do
45 OSM_DEVOPS
="${OPTARG}"
48 [ "${OPTARG}" == "debug" ] && DEBUG_INSTALL
="y" && continue
49 echo -e "Invalid option: '--$OPTARG'\n" >&2
53 echo "Option -$OPTARG requires an argument" >&2
57 echo -e "Invalid option: '-$OPTARG'\n" >&2
66 source $OSM_DEVOPS/common
/logging
67 source $OSM_DEVOPS/common
/track
69 echo "DEBUG_INSTALL=$DEBUG_INSTALL"
70 echo "DEFAULT_IP=$DEFAULT_IP"
71 echo "OSM_DEVOPS=$OSM_DEVOPS"