X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=install%2Finstall-nrt.sh;h=8e6e032683e69d6d0f4130d614dc9791a7c91bb1;hb=refs%2Fchanges%2F08%2F12708%2F1;hp=6cb2caf6f606b19c670d69dd759f78725ed6de3c;hpb=7ba76d4f4c0f92c874686d60abd12ef0322f01b0;p=nonrtric%2Fplt%2Franpm.git diff --git a/install/install-nrt.sh b/install/install-nrt.sh index 6cb2caf..8e6e032 100755 --- a/install/install-nrt.sh +++ b/install/install-nrt.sh @@ -2,6 +2,7 @@ # ============LICENSE_START=============================================== # Copyright (C) 2023 Nordix Foundation. All rights reserved. +# Copyright (C) 2024 OpenInfra Foundation Europe. All rights reserved. # ======================================================================== # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -25,6 +26,9 @@ # Constants SAMELINE="\033[0K\r" +EXPECTEDMAJORKUBERNETESVERSION="1" +EXPECTEDMINORKUBERNETESVERSION="21" +STRIMZIKAFKAOPERATORVERSION="0.39.0" # Variables export KUBERNETESHOST=$(kube_get_controlplane_host) @@ -34,9 +38,25 @@ if [ $? -ne 0 ]; then exit 1 fi +KUBERNETESVERSIONINFO=$(kubectl version --short 2>/dev/null || kubectl version 2>/dev/null) +export KUBERNETESVERSION=$(echo $KUBERNETESVERSIONINFO | grep 'Server Version' | awk '{print $3}') +if [ $? -ne 0 ]; then + echo $KUBERNETESVERSION + echo "Exiting" + exit 1 +fi + +KUBERNETESMAJORVERSION=$(echo ${KUBERNETESVERSION#v} | cut -d. -f1) +KUBERNETESMINORVERSION=$(echo $KUBERNETESVERSION | cut -d. -f2) echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "Kubernetes control plane host: $KUBERNETESHOST" echo "Host obtained from current kubectl context" +echo "Kubernetes version : $KUBERNETESVERSION" +if ((KUBERNETESMAJORVERSION < EXPECTEDMAJORKUBERNETESVERSION)) || ((KUBERNETESMINORVERSION < EXPECTEDMINORKUBERNETESVERSION)); then + echo "Required minimum Kubernetes version : $EXPECTEDMAJORKUBERNETESVERSION.$EXPECTEDMINORKUBERNETESVERSION" + echo "Aborting..." + exit 1 +fi echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" @@ -81,18 +101,10 @@ check_error() { fi } -################################################################################## -echo "##### Installing chart: namespaces" -################################################################################## - -helm install --wait namespaces helm/namespaces - -echo "" - ################################################################################## echo "##### Installing chart: nrt-base-0" ################################################################################## -helm install --wait -n nonrtric nrt-base-0 helm/nrt-base-0 +helm install --wait --create-namespace -n nonrtric nrt-base-0 helm/nrt-base-0 # Create realm in keycloak @@ -122,7 +134,8 @@ echo "##### Installing charts: strimzi and nrt-base-1" helm repo add strimzi https://strimzi.io/charts/ -helm install --wait strimzi-kafka-crds -n nonrtric strimzi/strimzi-kafka-operator +echo "Installing Strimzi Kafka operator version: $STRIMZIKAFKAOPERATORVERSION" +helm install --wait strimzi-kafka-crds -n nonrtric strimzi/strimzi-kafka-operator --version $STRIMZIKAFKAOPERATORVERSION cp opa-rules/bundle.tar.gz helm/nrt-base-1/charts/opa-rule-db/data @@ -150,7 +163,11 @@ while [ $retcode -eq 1 ]; do done # Save influx user api-token to secret -INFLUXDB2_TOKEN=$(get_influxdb2_token influxdb2-0 nonrtric | base64) +B64FLAG="-w 0" +case "$OSTYPE" in + darwin*) B64FLAG="" ;; +esac +INFLUXDB2_TOKEN=$(get_influxdb2_token influxdb2-0 nonrtric | base64 $B64FLAG) PATCHDATA='[{"op": "add", "path": "/data/token", "value": "'$INFLUXDB2_TOKEN'"}]' kubectl patch secret influxdb-api-token -n nonrtric --type json -p "$PATCHDATA" @@ -170,6 +187,20 @@ done echo "" +################################################################################## +echo "##### Installing: chart nonrtricgateway" +################################################################################## + +helm install --wait -n nonrtric nonrtricgateway helm/nonrtricgateway +echo "" + +################################################################################## +echo "##### Installing: chart controlpanel" +################################################################################## + +helm install --wait -n nonrtric controlpanel helm/controlpanel +echo "" + ################################################################################## echo "##### Installing: chart ran" ################################################################################## @@ -177,7 +208,7 @@ echo "##### Installing: chart ran" ./helm/ran/certs/gen-certs.sh 10 check_error $? -helm install --wait -f helm/global-values.yaml -n ran ran helm/ran +helm install --wait --create-namespace -n ran -f helm/global-values.yaml ran helm/ran echo ""