From e8400e984b68d1bbddadc490c1d622382554e122 Mon Sep 17 00:00:00 2001 From: "aravind.est" Date: Mon, 28 Jul 2025 18:18:14 +0100 Subject: [PATCH] Add Installation flavour configuration files rAppmanager and standalone-nonrtric flavour configuration files have been added to the helm-override directory. Each flavour configuration should have onap-flavour-config.yaml and oran-flavour-config.yaml files. onap-override.yaml and oran-override.yaml from default flavour is considered as a base configuration file for the respective flavour. The onap-flavour-config.yaml and oran-flavour-config.yaml files are used to override the base configuration files. During the installation, the appropriate flavour configuration files will be applied on top of the base configuration files. Issue-ID: NONRTRIC-1082 Change-Id: I9ad3427ce2185cac5c185e3c81d701b8504cfde6 Signed-off-by: aravind.est --- smo-install/README.md | 138 ++++++++++++++------- smo-install/helm-override/rappmanager/README.md | 28 +++++ .../rappmanager/onap-flavour-config.yaml | 37 ++++++ .../rappmanager/oran-flavour-config.yaml | 26 ++++ .../helm-override/standalone-nonrtric/README.md | 5 + .../standalone-nonrtric/onap-flavour-config.yaml | 31 +++++ .../standalone-nonrtric/oran-flavour-config.yaml | 36 ++++++ .../standalone-nonrtric/oran-override.yaml | 115 ----------------- smo-install/scripts/layer-2/2-install-oran.sh | 38 +++++- smo-install/scripts/sub-scripts/install-onap.sh | 36 ++++-- .../scripts/sub-scripts/preconfigure-smo.sh | 35 +++--- 11 files changed, 338 insertions(+), 187 deletions(-) create mode 100644 smo-install/helm-override/rappmanager/README.md create mode 100644 smo-install/helm-override/rappmanager/onap-flavour-config.yaml create mode 100644 smo-install/helm-override/rappmanager/oran-flavour-config.yaml create mode 100644 smo-install/helm-override/standalone-nonrtric/README.md create mode 100644 smo-install/helm-override/standalone-nonrtric/onap-flavour-config.yaml create mode 100644 smo-install/helm-override/standalone-nonrtric/oran-flavour-config.yaml delete mode 100644 smo-install/helm-override/standalone-nonrtric/oran-override.yaml diff --git a/smo-install/README.md b/smo-install/README.md index 22320e18..f78c5367 100644 --- a/smo-install/README.md +++ b/smo-install/README.md @@ -6,29 +6,46 @@ This project uses different helm charts from different Linux Foundation projects # Quick Installation on existing kubernetes +## Pre-requisites: +* VM with 64GB Memory, 20VCPU, 100GB of disk space. +* Helm 3.12.0 or later +* Kubernetes 1.30 or later +* Helm deploy/undeploy plugin +* Helm cm-push plugin +* yq +* jq + ## Installation flavours and configurations -Directory "smo-install/helm-override" contains different flavours of installations. One of these flavours can be used for the installation. -Each directory inside "smo-install/helm-override" contains a onap-override.yaml file. It controls the configuration of the ONAP components. -and oran-override.yaml controls the configuration of the O-RAN(NONRTIRC/SMO) components. +### Default installation flavour +Directory `smo-install/helm-override` contains different flavours of installations. One of these flavours can be used for the installation. -Any number of flavours can be created each flavour can have its own configuration. It should follow the same structure as the default flavour. +The default flavour is `default` (`smo-install/helm-override/default`). It contains the configuration for the ONAP and O-RAN (NONRTRIC/SMO) components. -The default flavour is "default". +`onap-override.yaml` file controls the configuration of the ONAP components. -Flavour name should be used as the directory name. It can be provided as an argument to the script. +`oran-override.yaml` file controls the configuration of the O-RAN (NONRTRIC/SMO) components. -```./dep/smo-install/scripts/layer-2/2-install-oran.sh ``` +### Creating a new flavour of installation -### Pre-requisites: -* VM with 64GB Memory, 20VCPU, 60GB of disk space. -* Helm 3.12.0 or later -* Kubernetes 1.30 or later -* Helm deploy/undeploy plugin -* Helm cm-push plugin -* yq -* jq +> [!NOTE] +> This default flavour is considered as a baseline configuration for all the installations. + +Any number of flavours can be created, each flavour can have its own configuration. + +Each of the new flavour should have its own directory under `smo-install/helm-override/`. +The directory should contain the `onap-flavour-config.yaml` and `oran-flavour-config.yaml` files. + +> [!IMPORTANT] +> These flavour configuration files doesn't needs to have entire configuration as same as in default flavour, Instead it should contain only the configuration that needs to be overridden from the default flavour. + +For example, if you want to disable NONRTRIC rAppmanager component in your flavour, then you can have that override in your flavour's `oran-flavour-config.yaml` file as below, +```yaml +nonrtric: + installrAppmanager: false +``` +This will disable the NONRTRIC rAppmanager component in your flavour and all the other components will be installed as per the default flavour configuration. ## Release Mode Installation @@ -43,35 +60,50 @@ Release mode uses the helm charts from the nexus helm repositories as pointed be Clone the repository using the command below, -```git clone --recursive "https://gerrit.o-ran-sc.org/r/it/dep"``` +```bash +git clone --recursive "https://gerrit.o-ran-sc.org/r/it/dep" +``` ---- -**NOTE** -The upload of the HELM charts for NONRTRIC and SMO components is currently in progress. Until the charts are available, these components should continue to be installed using the development mode. ---- +> [!NOTE] +> The upload of the HELM charts for NONRTRIC and SMO components is currently in progress. Until the charts are available, these components should continue to be installed using the development mode. -Use the below command to setup chartmuseum and helm +Use the below command to setup chartmuseum and helm, -```./dep/smo-install/scripts/layer-0/0-setup-charts-museum.sh``` +```bash +./dep/smo-install/scripts/layer-0/0-setup-charts-museum.sh +``` -```./dep/smo-install/scripts/layer-0/0-setup-helm3.sh``` +```bash +./dep/smo-install/scripts/layer-0/0-setup-helm3.sh +``` Charts can be build using the below command, -```./dep/smo-install/scripts/layer-1/1-build-all-charts.sh``` +```bash +./dep/smo-install/scripts/layer-1/1-build-all-charts.sh +``` -Once the pre-requisites are available, The below command can be used for the smo deployment. +Once the pre-requisites are available, The below command can be used for the smo deployment of default flavour, -```./dep/smo-install/scripts/layer-2/2-install-oran.sh``` +```bash +./dep/smo-install/scripts/layer-2/2-install-oran.sh +``` ---- -**WARNING** -Sometimes ONAP mariadb pod may not come up properly due to the slowness in pulling the container image. In such cases, you can try with re-installation and it should work fine. Otherwise you can try to pull all the required images manually into the cluster before the installation. ---- +The below command can be used for the smo deployment of a specific flavour, -Verify pods: +```bash +./dep/smo-install/scripts/layer-2/2-install-oran.sh +``` -```kubectl get pods -n onap && kubectl get pods -n nonrtric && kubectl get pods -n smo``` + +> [!WARNING] +> Sometimes ONAP mariadb pod may not come up properly due to the slowness in pulling the container image. In such cases, you can try with re-installation and it should work fine. Otherwise you can try to pull all the required images manually into the cluster before the installation. + +Verify pods, + +```bash +kubectl get pods -n onap && kubectl get pods -n nonrtric && kubectl get pods -n smo +``` ## Dev Mode Installation @@ -81,27 +113,47 @@ In this mode, the released helm charts are not used. Instead, the charts are bui Clone the repository using the command below, -```git clone --recursive "https://gerrit.o-ran-sc.org/r/it/dep"``` +```bash +git clone --recursive "https://gerrit.o-ran-sc.org/r/it/dep" +``` -Use the below command to setup chartmuseum and helm +Use the below command to setup chartmuseum and helm, -```./dep/smo-install/scripts/layer-0/0-setup-charts-museum.sh``` +```bash +./dep/smo-install/scripts/layer-0/0-setup-charts-museum.sh +``` -```./dep/smo-install/scripts/layer-0/0-setup-helm3.sh``` +```bash +./dep/smo-install/scripts/layer-0/0-setup-helm3.sh +``` Charts can be build using the below command, -```./dep/smo-install/scripts/layer-1/1-build-all-charts.sh``` +```bash +./dep/smo-install/scripts/layer-1/1-build-all-charts.sh +``` + +The below command can be used for the smo deployment of default flavour, + +```bash +./dep/smo-install/scripts/layer-2/2-install-oran.sh default dev +``` -The below command can be used for the smo deployment. +The below command can be used for the smo deployment of a specific flavour, -```./dep/smo-install/scripts/layer-2/2-install-oran.sh default dev``` +```bash +./dep/smo-install/scripts/layer-2/2-install-oran.sh dev +``` -Verify pods: +Verify pods, -```kubectl get pods -n onap && kubectl get pods -n nonrtric && kubectl get pods -n smo``` +```bash +kubectl get pods -n onap && kubectl get pods -n nonrtric && kubectl get pods -n smo +``` ## Uninstallation: -* Execute +Execute - ```./dep/smo-install/scripts/uninstall-all.sh``` +```bash +./dep/smo-install/scripts/uninstall-all.sh +``` diff --git a/smo-install/helm-override/rappmanager/README.md b/smo-install/helm-override/rappmanager/README.md new file mode 100644 index 00000000..beb12ed9 --- /dev/null +++ b/smo-install/helm-override/rappmanager/README.md @@ -0,0 +1,28 @@ +# NONRTRIC rAppManager Helm Override + +This directory contains the flavour configuration for the NONRTRIC rAppManager component. + +## rAppManager +Source code for the NONRTRIC rAppManager component is available in [`this`](https://gerrit.o-ran-sc.org/r/gitweb?p=nonrtric%2Fplt%2Frappmanager.git;a=summary) repsitory. + +Sample rApps are available in the [`rapps`](https://gerrit.o-ran-sc.org/r/gitweb?p=nonrtric/plt/rappmanager.git;a=tree;f=sample-rapp-generator) directory. + +Sample postman collection for rAppManager is available in [`ES Demo rApp Postman Collection`](https://github.com/o-ran-sc/nonrtric-plt-rappmanager/blob/master/sample-rapp-generator/es-demo-rapp/Demo_Energy_Saving_rApp.postman_collection.json). + +> [!NOTE] +> This installation doesn't include the kserve component. If you want to install kserver based rApp, It is recommended to use the script [here](https://github.com/o-ran-sc/nonrtric-plt-rappmanager/blob/master/scripts/install/install-kserve.sh). + + +## Helm repository whitelisting in ONAP Policy Clamp Kubernetes Participant +The rAppManager component uses ONAP policy-clamp-ac-k8s-ppnt chart to deploy the helm charts from the rApp. + +The `policy-clamp-ac-k8s-ppnt` chart requires a list of helm repositories used by rApp to be whitelisted. + +This is done by adding the helm repositories to the `repoList` section in the `oran-flavour-config.yaml` file. + + +## rAppManager cleanup +> [!IMPORTANT] +> It is essential to clean up the rAppManager component properly after a failure to have a clean state for future deployments. + +To clean up the rAppManager component, you can use follow the instructions in the [NONRTRIC rAppManager Cleanup](https://github.com/o-ran-sc/nonrtric-plt-rappmanager/tree/master/sample-rapp-generator/es-demo-rapp#clean-up). diff --git a/smo-install/helm-override/rappmanager/onap-flavour-config.yaml b/smo-install/helm-override/rappmanager/onap-flavour-config.yaml new file mode 100644 index 00000000..0b5c4044 --- /dev/null +++ b/smo-install/helm-override/rappmanager/onap-flavour-config.yaml @@ -0,0 +1,37 @@ +# ============LICENSE_START======================================================= +# Copyright (C) 2025 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. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END============================================ +# + +cps: + enabled: false +dcaegen2-services: + enabled: false +mariadb-galera: + enabled: false +policy: + policy-clamp-ac-k8s-ppnt: + repoList: + # This is the list of helm repositories allowed to be used + # by the policy-clamp-ac-k8s-ppnt chart. + # Helm repositories should be added as required. + helm: + repos: + - repoName: kong + address: https://charts.konghq.com + - repoName: bitnami + address: https://charts.bitnami.com/bitnami +sdnc: + enabled: false \ No newline at end of file diff --git a/smo-install/helm-override/rappmanager/oran-flavour-config.yaml b/smo-install/helm-override/rappmanager/oran-flavour-config.yaml new file mode 100644 index 00000000..d62dd048 --- /dev/null +++ b/smo-install/helm-override/rappmanager/oran-flavour-config.yaml @@ -0,0 +1,26 @@ +# ============LICENSE_START======================================================= +# Copyright (C) 2025 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. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END============================================ +# + +nonrtric: + installPms: false + installA1simulator: false + installTopology: false + installDmaapadapterservice: false + installRanpm: false + +smo: + installTeiv: false diff --git a/smo-install/helm-override/standalone-nonrtric/README.md b/smo-install/helm-override/standalone-nonrtric/README.md new file mode 100644 index 00000000..b12a8aa2 --- /dev/null +++ b/smo-install/helm-override/standalone-nonrtric/README.md @@ -0,0 +1,5 @@ +# Standalone NONRTRIC Helm Override + +This directory contains the flavour configuration for the Standalone NONRTRIC. + +This configuration installs the NONRTRIC components alone without ONAP/SMO namespace components. \ No newline at end of file diff --git a/smo-install/helm-override/standalone-nonrtric/onap-flavour-config.yaml b/smo-install/helm-override/standalone-nonrtric/onap-flavour-config.yaml new file mode 100644 index 00000000..68fdd665 --- /dev/null +++ b/smo-install/helm-override/standalone-nonrtric/onap-flavour-config.yaml @@ -0,0 +1,31 @@ +# ============LICENSE_START======================================================= +# Copyright (C) 2025 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. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END============================================ +# + +cps: + enabled: false +dcaegen2-services: + enabled: false +mariadb-galera: + enabled: false +postgres: + enabled: false +policy: + enabled: false +sdnc: + enabled: false +strimzi: + enabled: false diff --git a/smo-install/helm-override/standalone-nonrtric/oran-flavour-config.yaml b/smo-install/helm-override/standalone-nonrtric/oran-flavour-config.yaml new file mode 100644 index 00000000..414c315f --- /dev/null +++ b/smo-install/helm-override/standalone-nonrtric/oran-flavour-config.yaml @@ -0,0 +1,36 @@ +# ============LICENSE_START======================================================= +# Copyright (C) 2025 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. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END============================================ +# + +nonrtric: + installPms: true + installA1controller: true + installA1simulator: true + installControlpanel: true + installInformationservice: true + installNonrtricgateway: true + installKong: true + installTopology: false + installDmaapadapterservice: true + installDmeparticipant: false + installrAppmanager: true + installCapifcore: true + installServicemanager: true + installRanpm: false + +smo: + installTeiv: false + diff --git a/smo-install/helm-override/standalone-nonrtric/oran-override.yaml b/smo-install/helm-override/standalone-nonrtric/oran-override.yaml deleted file mode 100644 index 056a2cf7..00000000 --- a/smo-install/helm-override/standalone-nonrtric/oran-override.yaml +++ /dev/null @@ -1,115 +0,0 @@ -# ============LICENSE_START=============================================== -# Copyright (C) 2022-2023 Nordix Foundation. All rights reserved. -# Copyright (C) 2023-2025 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. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END================================================= - -################################################################# -# Global configuration overrides for standalone nonrtric deployment -# -# These overrides will affect all helm charts (ie. applications) -# that are listed below and are 'enabled'. -################################################################# - -##### ORAN ##### - -######### NONRTRIC ######### - -nonrtric: - installPms: true - installA1controller: true - installA1simulator: true - installControlpanel: true - installInformationservice: true - installNonrtricgateway: true - installKong: false - installTopology: false - installDmaapadapterservice: true - installrAppmanager: true - installDmeParticipant: true - # override default mount path root directory - # referenced by persistent volumes and log files - persistence: - mountPath: /dockerdata-nfs - volume1: - # Set the size to 0 if you do not need the volume (if you are using Dynamic Volume Provisioning) - size: 2Gi - storageClassName: pms-storage - volume2: - # Set the size to 0 if you do not need the volume (if you are using Dynamic Volume Provisioning) - size: 2Gi - storageClassName: ics-storage - -common: - releasePrefix: r3-dev-nonrtric - ingressClassName: kong - -informationservice: - informationservice: - persistence: - # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed size should be the same. - # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be for instance 'standard' or 'gluster-fs' (depeneds on which classes that are available) - size: 2Gi - storageClassName: ics-storage - ingress: - enabled: true - - -# Need to check the external port Availability -policymanagementservice: - policymanagementservice: - persistence: - # Either refer to a volume created under the nonrtric by storageClassName. Then the claimed size should be the same. - # The alternative use a dynamic volume provisioner in the cluster. Storage class can then be fon instance 'standard' or 'gluster-fs' (depeneds on which classes that are available) - size: 2Gi - storageClassName: pms-storage - ingress: - enabled: true - -kong: - ingressController: - installCRDs: false - admin: - enabled: true - -controlpanel: - controlpanel: - ingress: - enabled: false - -nonrtricgateway: - a1PolicyLink: https://policymanagementservice:8433 - -a1simulator: - a1Sims: - - name: a1-sim-osc-0 - a1Version: OSC_2.1.0 - allowHttp: true - - name: a1-sim-osc-1 - a1Version: OSC_2.1.0 - allowHttp: true - - name: a1-sim-std-0 - a1Version: STD_1.1.3 - allowHttp: true - - name: a1-sim-std-1 - a1Version: STD_1.1.3 - allowHttp: true - - name: a1-sim-std2-0 - a1Version: STD_2.0.0 - allowHttp: true - - name: a1-sim-std2-1 - a1Version: STD_2.0.0 - allowHttp: true - - diff --git a/smo-install/scripts/layer-2/2-install-oran.sh b/smo-install/scripts/layer-2/2-install-oran.sh index 715dd71e..29686dfa 100755 --- a/smo-install/scripts/layer-2/2-install-oran.sh +++ b/smo-install/scripts/layer-2/2-install-oran.sh @@ -27,6 +27,16 @@ SCRIPT=$(readlink -f "$0") SCRIPT_PATH=$(dirname "$SCRIPT") cd $SCRIPT_PATH +IS_GENERATED_ONAP_OVERRIDE=false +IS_GENERATED_ORAN_OVERRIDE=false + +if ! command -v yq > /dev/null 2>&1; then + ARCH=$(case $(uname -m) in x86_64) echo "amd64";; aarch64) echo "arm64";; *) uname -m;; esac) + VERSION="v4.45.4" + echo "yq is not installed. Installing yq..." + sudo wget https://github.com/mikefarah/yq/releases/download/${VERSION}/yq_linux_${ARCH} -O /usr/local/bin/yq + sudo chmod +x /usr/local/bin/yq +fi FLAVOUR=$1 MODE=$2 @@ -34,6 +44,25 @@ if [ -z "$1" ] then echo "No helm override flavour supplied, going to default" FLAVOUR="default" + else + echo "Using helm override flavour: $FLAVOUR" + if [ -f "../../helm-override/$FLAVOUR/onap-flavour-config.yaml" ]; then + echo "Generating onap-override.yaml for flavour $FLAVOUR" + yq eval-all '. as $item ireduce ({}; . * $item )' ../../helm-override/default/onap-override.yaml ../../helm-override/$FLAVOUR/onap-flavour-config.yaml > ../../helm-override/$FLAVOUR/onap-override.yaml + IS_GENERATED_ONAP_OVERRIDE=true + else + echo "No onap-flavour-config.yaml found for flavour $FLAVOUR." + exit 1 + fi + + if [ -f "../../helm-override/$FLAVOUR/oran-flavour-config.yaml" ]; then + echo "Generating oran-override.yaml for flavour $FLAVOUR" + yq eval-all '. as $item ireduce ({}; . * $item ) ' ../../helm-override/default/oran-override.yaml ../../helm-override/$FLAVOUR/oran-flavour-config.yaml > ../../helm-override/$FLAVOUR/oran-override.yaml + IS_GENERATED_ORAN_OVERRIDE=true + else + echo "No oran-flavour-config.yaml found for flavour $FLAVOUR." + exit 1 + fi fi if [ -z "$2" ] @@ -45,7 +74,7 @@ fi timestamp=$(date +%s) echo "Pre configuring SMO ..." -../sub-scripts/preconfigure-smo.sh ../../helm-override/$FLAVOUR/oran-override.yaml $MODE $timestamp +../sub-scripts/preconfigure-smo.sh ../../helm-override/$FLAVOUR/onap-override.yaml $MODE $timestamp echo "SMO pre configuration done." echo "Starting ONAP & NONRTRIC namespaces ..." @@ -62,4 +91,11 @@ kubectl get pods -n nonrtric kubectl get pods -n smo kubectl get namespaces +if [ "$IS_GENERATED_ONAP_OVERRIDE" = true ]; then + rm -f ../../helm-override/$FLAVOUR/onap-override.yaml +fi +if [ "$IS_GENERATED_ORAN_OVERRIDE" = true ]; then + rm -f ../../helm-override/$FLAVOUR/oran-override.yaml +fi + echo "SMO Installation completed successfully in $(( ($(date +%s) - $timestamp) / 60 )) minutes." diff --git a/smo-install/scripts/sub-scripts/install-onap.sh b/smo-install/scripts/sub-scripts/install-onap.sh index 5c804900..dc5e0783 100755 --- a/smo-install/scripts/sub-scripts/install-onap.sh +++ b/smo-install/scripts/sub-scripts/install-onap.sh @@ -28,27 +28,37 @@ SCRIPT=$(readlink -f "$0") SCRIPT_PATH=$(dirname "$SCRIPT") cd $SCRIPT_PATH +OVERRIDEYAML=$1 MODE=$2 +INSTALL_STRIMZI=$(cat $OVERRIDEYAML | yq e '.strimzi.enabled' -) +if [ $? -ne 0 ] || [ -z "$INSTALL_STRIMZI" ]; then + echo "Error: failed to parse INSTALL_STRIMZI from YAML with yq. Aborting install." + exit 1 +fi + if [ "$MODE" == "dev" ]; then - echo "### Installing Strimzi Kafka Operator (Dev Mode) ###" - helm cm-push ../packages/strimzi-kafka-operator-helm-3-chart-0.45.0.tgz local - helm repo update - helm upgrade --install strimzi-kafka-operator local/strimzi-kafka-operator --namespace strimzi-system --version 0.45.0 --set watchAnyNamespace=true --create-namespace - echo "Waiting for Strimzi Kafka Operator to be ready..." - kubectl wait --for=condition=available --timeout=600s deployment/strimzi-cluster-operator -n strimzi-system + if [ "$INSTALL_STRIMZI" == "true" ]; then + echo "### Installing Strimzi Kafka Operator (Dev Mode) ###" + helm cm-push ../packages/strimzi-kafka-operator-helm-3-chart-0.45.0.tgz local + helm repo update + helm upgrade --install strimzi-kafka-operator local/strimzi-kafka-operator --namespace strimzi-system --version 0.45.0 --set watchAnyNamespace=true --create-namespace + echo "Waiting for Strimzi Kafka Operator to be ready..." + kubectl wait --for=condition=available --timeout=600s deployment/strimzi-cluster-operator -n strimzi-system + fi kubectl create namespace onap echo '### Installing ONAP part (Dev Mode) ###' helm deploy --debug onap local/onap --namespace onap -f $1 else - echo "### Installing Strimzi Kafka Operator (Release Mode) ###" - helm repo add strimzi https://strimzi.io/charts/ - helm repo update - - helm upgrade --install strimzi-kafka-operator strimzi/strimzi-kafka-operator --namespace strimzi-system --version 0.45.0 --set watchAnyNamespace=true --create-namespace - echo "Waiting for Strimzi Kafka Operator to be ready..." - kubectl wait --for=condition=available --timeout=600s deployment/strimzi-cluster-operator -n strimzi-system + if [ "$INSTALL_STRIMZI" == "true" ]; then + echo "### Installing Strimzi Kafka Operator (Release Mode) ###" + helm repo add strimzi https://strimzi.io/charts/ + helm repo update + helm upgrade --install strimzi-kafka-operator strimzi/strimzi-kafka-operator --namespace strimzi-system --version 0.45.0 --set watchAnyNamespace=true --create-namespace + echo "Waiting for Strimzi Kafka Operator to be ready..." + kubectl wait --for=condition=available --timeout=600s deployment/strimzi-cluster-operator -n strimzi-system + fi echo '### Installing ONAP part (Release Mode) ###' helm repo add onap https://nexus3.onap.org/repository/onap-helm-testing/ diff --git a/smo-install/scripts/sub-scripts/preconfigure-smo.sh b/smo-install/scripts/sub-scripts/preconfigure-smo.sh index d939ec2f..0da495de 100755 --- a/smo-install/scripts/sub-scripts/preconfigure-smo.sh +++ b/smo-install/scripts/sub-scripts/preconfigure-smo.sh @@ -16,19 +16,13 @@ # ============LICENSE_END============================================ # -if ! command -v yq > /dev/null 2>&1; then - ARCH=$(case $(uname -m) in x86_64) echo "amd64";; aarch64) echo "arm64";; *) uname -m;; esac) - VERSION="v4.45.4" - echo "yq is not installed. Installing yq..." - sudo wget https://github.com/mikefarah/yq/releases/download/${VERSION}/yq_linux_${ARCH} -O /usr/local/bin/yq - sudo chmod +x /usr/local/bin/yq -fi - if ! command -v jq > /dev/null 2>&1; then echo "jq is not installed. Installing jq..." sudo apt-get install jq -y fi +OVERRIDEYAML=$1 + # OpenEBS installation helm repo add openebs https://openebs.github.io/openebs helm repo update @@ -37,10 +31,21 @@ helm upgrade --install openebs --namespace openebs openebs/openebs --version 4.3 # Create storage class for smo kubectl apply -f ../packages/pre-configuration/smo-sc.yaml -# Mariadb operator installation -kubectl create ns mariadb-operator -helm repo add mariadb-operator https://helm.mariadb.com/mariadb-operator -helm repo update -helm upgrade --install mariadb-operator-crds mariadb-operator/mariadb-operator-crds -n mariadb-operator -helm upgrade --install mariadb-operator mariadb-operator/mariadb-operator -n mariadb-operator -kubectl wait deployment mariadb-operator -n mariadb-operator --for=condition=available --timeout=120s +INSTALL_MARIADB=$(cat $OVERRIDEYAML | yq e '.mariadb-galera.enabled' -) +if [ $? -ne 0 ] || [ -z "$INSTALL_MARIADB" ]; then + echo "Error: failed to parse INSTALL_MARIADB from YAML with yq. Aborting install." + exit 1 +fi +if [ "$INSTALL_MARIADB" == "true" ]; then + echo "Installing MariaDB operator..." + # Mariadb operator installation + kubectl create ns mariadb-operator + helm repo add mariadb-operator https://helm.mariadb.com/mariadb-operator + helm repo update + helm upgrade --install mariadb-operator-crds mariadb-operator/mariadb-operator-crds -n mariadb-operator + helm upgrade --install mariadb-operator mariadb-operator/mariadb-operator -n mariadb-operator + kubectl wait deployment mariadb-operator -n mariadb-operator --for=condition=available --timeout=120s +else + echo "Skipping MariaDB operator installation as per configuration." +fi + -- 2.16.6