Aligning RANPM function to work in it/dep repository 62/11562/3
authorrohithrajneesh <rohith.rajneesh@est.tech>
Tue, 8 Aug 2023 11:22:37 +0000 (12:22 +0100)
committerrohithrajneesh <rohith.rajneesh@est.tech>
Tue, 8 Aug 2023 16:34:37 +0000 (17:34 +0100)
Issue-ID: NONRTRIC-889
Change-Id: If41960a6ff4e62bf3d4e74bf90293d8a835cdc89
Signed-off-by: rohithrajneesh <rohith.rajneesh@est.tech>
install/helm/namespaces/Chart.yaml [deleted file]
install/helm/namespaces/templates/ns-nonrtric.yaml [deleted file]
install/helm/namespaces/templates/ns-ran.yaml [deleted file]
install/install-nrt.sh
install/install-pm-log.sh
install/install-ranpm.sh [new file with mode: 0644]
install/uninstall-nrt.sh
install/uninstall-pm-rapp.sh
install/uninstall-ranpm.sh [new file with mode: 0644]

diff --git a/install/helm/namespaces/Chart.yaml b/install/helm/namespaces/Chart.yaml
deleted file mode 100644 (file)
index 887d11f..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#  ============LICENSE_START===============================================
-#  Copyright (C) 2023 Nordix Foundation. 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=================================================
-#
-
-apiVersion: v2
-name: namespaces
-description: Namespaces helm chart
-
-# A chart can be either an 'application' or a 'library' chart.
-#
-# Application charts are a collection of templates that can be packaged into versioned archives
-# to be deployed.
-#
-# Library charts provide useful utilities or functions for the chart developer. They're included as
-# a dependency of application charts to inject those utilities and functions into the rendering
-# pipeline. Library charts do not define any templates and therefore cannot be deployed.
-type: application
-
-# This is the chart version. This version number should be incremented each time you make changes
-# to the chart and its templates, including the app version.
-# Versions are expected to follow Semantic Versioning (https://semver.org/)
-version: 0.1.0
-
-# This is the version number of the application being deployed. This version number should be
-# incremented each time you make changes to the application. Versions are not expected to
-# follow Semantic Versioning. They should reflect the version the application is using.
-# It is recommended to use it with quotes.
-appVersion: "0.1.0"
diff --git a/install/helm/namespaces/templates/ns-nonrtric.yaml b/install/helm/namespaces/templates/ns-nonrtric.yaml
deleted file mode 100644 (file)
index 0f3b95d..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#  ============LICENSE_START===============================================
-#  Copyright (C) 2023 Nordix Foundation. 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=================================================
-#
-
-apiVersion: v1
-kind: Namespace
-metadata:
-  name: nonrtric
-  labels:
-    istio-injection: enabled
-
diff --git a/install/helm/namespaces/templates/ns-ran.yaml b/install/helm/namespaces/templates/ns-ran.yaml
deleted file mode 100644 (file)
index 8601ab7..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#  ============LICENSE_START===============================================
-#  Copyright (C) 2023 Nordix Foundation. 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=================================================
-#
-
-apiVersion: v1
-kind: Namespace
-metadata:
-  name: ran
-  labels:
-    istio-injection: disabled
-
index 5bc4ae8..906fd31 100755 (executable)
@@ -81,18 +81,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
 
@@ -181,7 +173,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 ""
 
@@ -265,4 +257,4 @@ echo "ranpm installed"
 echo "Wait until all pods are running before installation additional charts"
 echo "Do: 'kubectl get po -n nonrtric' and verify that all pods are in status Running"
 echo " and all included containers are Ready"
-echo "######################################################################"
+echo "######################################################################"
\ No newline at end of file
index 0b3c7ab..19a51f7 100755 (executable)
@@ -62,4 +62,3 @@ echo " helm install..."
 helm install -n nonrtric nrt-pm-log helm/nrt-pm-log
 
 echo "done"
-
diff --git a/install/install-ranpm.sh b/install/install-ranpm.sh
new file mode 100644 (file)
index 0000000..bdd6b59
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+#  ============LICENSE_START===============================================
+#  Copyright (C) 2023 Nordix Foundation. 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=================================================
+
+ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+cd "${ROOT_DIR}"
+
+# Array of installation scripts
+scripts=("install-nrt.sh" "install-pm-log.sh" "install-pm-influx-job.sh" "install-pm-rapp.sh")
+
+for script in "${scripts[@]}"; do
+  echo "*****************************************************************"
+  echo "Running ${script}"
+  echo "*****************************************************************"
+  chmod +x "${ROOT_DIR}/${script}"
+  "${ROOT_DIR}/${script}"
+  if [ $? -eq 0 ]; then
+    echo "*****************************************************************"
+    echo "${script} completed"
+    echo "*****************************************************************"
+  else
+    exit 1
+  fi
+done
+
+echo "*****************************************************************"
+echo "*****************************************************************"
+echo "All RANPM installation scripts executed successfully!"
+echo "*****************************************************************"
+echo "*****************************************************************"
\ No newline at end of file
index ed24340..62abf73 100755 (executable)
@@ -37,7 +37,6 @@ helm uninstall -n nonrtric nrt-base-1
 
 helm uninstall -n nonrtric nrt-base-0
 
-
 INST="strimzi-kafka CRDs"
 echo "##########################"
 echo "Uninstall $INST"
@@ -46,8 +45,6 @@ helm repo remove strimzi
 helm uninstall   -n nonrtric strimzi-kafka-crds
 check_error $? "$INST"
 
-helm uninstall namespaces
-
 # Print final result
 if [ $NUM_ERRORS -eq 0 ]; then
     echo "Uninstall PM Demo OK"
@@ -57,5 +54,3 @@ else
 fi
 
 exit 0
-
-
index 12ce98c..53a2166 100755 (executable)
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 #  ============LICENSE_END=================================================
-#
 
 echo "Uninstalling pmrapp"
 
 echo " helm uninstall..."
 helm uninstall -n nonrtric nrt-pm-rapp
 
-echo "done"
-
+echo "done"
\ No newline at end of file
diff --git a/install/uninstall-ranpm.sh b/install/uninstall-ranpm.sh
new file mode 100644 (file)
index 0000000..f4c08d1
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+#  ============LICENSE_START===============================================
+#  Copyright (C) 2023 Nordix Foundation. 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=================================================
+
+ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
+cd "${ROOT_DIR}"
+
+# Array of scripts to execute
+scripts=("uninstall-pm-rapp.sh" "uninstall-nrt.sh")
+
+for script in "${scripts[@]}"; do
+  echo "*****************************************************************"
+  echo "Running ${script}"
+  echo "*****************************************************************"
+  chmod +x "${ROOT_DIR}/${script}"
+  "${ROOT_DIR}/${script}"
+  if [ $? -eq 0 ]; then
+    echo "*****************************************************************"
+    echo "${script} completed"
+    echo "*****************************************************************"
+  else
+    exit 1
+  fi
+done
+
+echo "*****************************************************************"
+echo "*****************************************************************"
+echo "All RANPM uninstallation scripts executed successfully!"
+echo "*****************************************************************"
+echo "*****************************************************************"
\ No newline at end of file