4 # ============LICENSE_START========================================================
6 # =================================================================================
7 # Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
8 # Modification Copyright (C) 2024 OpenInfra Foundation Europe. All rights reserved.
9 # =================================================================================
10 # Licensed under the Apache License, Version 2.0 (the "License");
11 # you may not use this file except in compliance with the License.
12 # You may obtain a copy of the License at
14 # http://www.apache.org/licenses/LICENSE-2.0
16 # Unless required by applicable law or agreed to in writing, software
17 # distributed under the License is distributed on an "AS IS" BASIS,
18 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 # See the License for the specific language governing permissions and
20 # limitations under the License.
21 # ============LICENSE_END==========================================================
22 # =================================================================================
26 kubectl create namespace nonrtric
27 echo '### Installing ORAN NONRTRIC part ###'
31 if ! command -v yq > /dev/null 2>&1; then
32 echo "yq is not installed. Installing yq..."
33 sudo snap install yq --channel=v3/stable
36 INSTALL_KONG=$(yq read "$OVERRIDEYAML" 'nonrtric.installKong')
37 if [ $? -ne 0 ] || [ -z "$INSTALL_KONG" ]; then
38 echo "Error: failed to parse installKong from YAML with yq. Aborting install."
42 INSTALL_CAPIF=$(yq read "$OVERRIDEYAML" 'nonrtric.installCapifcore')
43 if [ $? -ne 0 ] || [ -z "$INSTALL_CAPIF" ]; then
44 echo "Error: failed to parse installCapifcore from YAML with yq. Aborting install."
48 INSTALL_SERVICEMANAGER=$(yq read "$OVERRIDEYAML" 'nonrtric.installServicemanager')
49 if [ $? -ne 0 ] || [ -z "$INSTALL_SERVICEMANAGER" ]; then
50 echo "Error: failed to parse installServicemanager from YAML with yq. Aborting install."
54 if [ "$INSTALL_SERVICEMANAGER" == "true" ]; then
55 if [ "$INSTALL_KONG" == "false" ]; then
56 echo "Error: INSTALL_KONG must be true if INSTALL_SERVICEMANAGER is true. Aborting install."
59 if [ "$INSTALL_CAPIF" == "false" ]; then
60 echo "Error: INSTALL_CAPIF must be true if INSTALL_SERVICEMANAGER is true. Aborting install."
65 helm install --debug oran-nonrtric local/nonrtric --namespace nonrtric -f $OVERRIDEYAML --set nonrtric.persistence.mountPath="/dockerdata-nfs/deployment-$2"