Add openebs for dynamic volume provisioning 63/14563/2
authoraravind.est <aravindhan.a@est.tech>
Fri, 13 Jun 2025 16:16:05 +0000 (17:16 +0100)
committeraravind.est <aravindhan.a@est.tech>
Fri, 20 Jun 2025 10:59:43 +0000 (11:59 +0100)
Default volume provisioners doesn't provide proper permission for the volumes.
Hence there is an permission based issues in some containers.
Openebs provisioner able to handle the permissions properly during the volume provisioning.

Issue-ID: INT-170
Change-Id: Ifa1d284a8c39bc6fb3e73c30cccffdc30555928b
Signed-off-by: aravind.est <aravindhan.a@est.tech>
smo-install/helm-override/default/onap-override.yaml
smo-install/helm-override/default/oran-override.yaml
smo-install/oran_oom/nonrtric/templates/pv3.yaml [deleted file]
smo-install/scripts/packages/pre-configuration/smo-sc.yaml [moved from smo-install/scripts/packages/pre-configuration/mariadb-galera-pv.yaml with 73% similarity]
smo-install/scripts/sub-scripts/install-nonrtric.sh
smo-install/scripts/sub-scripts/preconfigure-smo.sh

index 790bf03..1e0e038 100644 (file)
@@ -52,6 +52,7 @@ global:
   # referenced by persistent volumes and log files
   persistence:
     mountPath: /dockerdata-nfs
+    storageClass: &smo-sc smo-storage
 
   # flag to enable debugging - application support required
   debugEnabled: false
@@ -153,7 +154,7 @@ mariadb-galera:
   mariadbOperator:
     appVersion: 11.1.2
     persistence:
-      storageClassName: mariadb-galera-sc
+      storageClassName: *smo-sc
     galera:
       enabled: false
 postgres:
index 0cbc8c9..939e66b 100644 (file)
@@ -47,11 +47,11 @@ nonrtric:
   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
+    storageClassName: &smo-sc smo-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
+    storageClassName: *smo-sc
   # List of secrets to be copied from ONAP namespace to NONRTRIC
   # Based on the dependsOn value, the secrets will be copied to the SMO namespace
   secrets:
@@ -67,7 +67,7 @@ informationservice:
     # 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
+    storageClassName: *smo-sc
   ingress:
     enabled: true
 
@@ -78,7 +78,7 @@ policymanagementservice:
     # 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
+    storageClassName: *smo-sc
   ingress:
     enabled: true
 
diff --git a/smo-install/oran_oom/nonrtric/templates/pv3.yaml b/smo-install/oran_oom/nonrtric/templates/pv3.yaml
deleted file mode 100644 (file)
index c29edd3..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-###############################################################################
-#   Copyright (c) 2021 Nordix Foundation.                                      #
-#                                                                              #
-#   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.                                             #
-################################################################################
-
-{{- if .Values.nonrtric.volume3.size }}
-
-kind: PersistentVolume
-apiVersion: v1
-metadata:
-  name: nonrtric-pv3
-  namespace: {{ include "common.namespace" . }}
-spec:
-  capacity:
-    storage: {{ .Values.nonrtric.volume3.size }}
-  accessModes:
-    - ReadWriteOnce
-    - ReadWriteMany
-  persistentVolumeReclaimPolicy: Retain
-  hostPath:
-    path: {{ .Values.nonrtric.persistence.mountPath }}/nonrtric/volume3
-  storageClassName: {{ .Values.nonrtric.volume3.storageClassName }}
-
-{{- end }}
-
@@ -1,6 +1,5 @@
 ################################################################################
-#   Copyright (c) 2021-2023 Nordix Foundation.                                 #
-#   Copyright (C) 2023-2025 OpenInfra Foundation Europe                        #
+#   Copyright (C) 2025 OpenInfra Foundation Europe                             #
 #                                                                              #
 #   Licensed under the Apache License, Version 2.0 (the "License");            #
 #   you may not use this file except in compliance with the License.           #
 #   limitations under the License.                                             #
 ################################################################################
 
-kind: PersistentVolume
-apiVersion: v1
+apiVersion: storage.k8s.io/v1
+kind: StorageClass
 metadata:
-  name: mariadb-galera-pv
-spec:
-  capacity:
-    storage: 3Gi
-  accessModes:
-    - ReadWriteOnce
-    - ReadWriteMany
-  persistentVolumeReclaimPolicy: Retain
-  hostPath:
-    path: /dockerdata-nfs/onap/mariadb
-  storageClassName: mariadb-galera-sc
+  annotations:
+    cas.openebs.io/config: |
+      - name: StorageType
+        value: "hostpath"
+      - name: BasePath
+        value: "/dockerdata/smo"
+    openebs.io/cas-type: local
+  name: smo-storage
+provisioner: openebs.io/local
+reclaimPolicy: Delete
+volumeBindingMode: WaitForFirstConsumer
index 7526b30..6b4fa93 100755 (executable)
@@ -92,3 +92,6 @@ else
         kubectl get secret $secret -n onap -o json | jq 'del(.metadata["namespace","creationTimestamp","resourceVersion","selfLink","uid","ownerReferences"])' | kubectl apply -n nonrtric -f -
     done
 fi
+
+# Wait for the Kong deployment to be ready
+kubectl wait --for=condition=available deployment/oran-nonrtric-kong -n nonrtric
\ No newline at end of file
index 290df43..326faf2 100755 (executable)
 # ============LICENSE_END============================================
 #
 
-# Check whether k8s is multinode or not and provide warning
-if [ $(kubectl get nodes --no-headers | wc -l) -gt 1 ]; then
-    echo "----------------------------------- WARNING!!! -------------------------------------------"
-    echo "This is a multi-node cluster."
-    echo "----------------------------------- Node Details  -----------------------------------------"
-    kubectl get nodes
-    echo "-------------------------------------------------------------------------------------------"
-    echo "This installation uses /dockerdata-nfs as a volume mount point."
-    echo "Each application creates its own sub-directory under /dockerdata-nfs."
-    echo "-------------------------------------------------------------------------------------------"
-    echo "If there is any previous installation, please ensure that the /dockerdata-nfs directory is empty."
-    echo "Leaving any previous data in this directory may cause issues with the new installation."
-    echo "-------------------------------------------------------------------------------------------"
-    echo "The file permission of the sub-directory should be set to 777. "
-    echo "Setting the permission to 777 is required for the application to work properly."
-    echo "Hence, the following command should be run on all nodes in the cluster."
-    echo "-------------------------------------------------------------------------------------------"
-    echo "sudo mkdir -p /dockerdata-nfs/onap"
-    echo "sudo mkdir -p /dockerdata-nfs/onap/mariadb"
-    echo "sudo mkdir -p /dockerdata-nfs/onap/elastic-master-0"
-    echo "sudo mkdir -p /dockerdata-nfs/onap/cps-temporal/data"
-    echo "sudo mkdir -p /dockerdata-nfs/onap/strimzi-kafka/kafka-0"
-    echo "sudo mkdir -p /dockerdata-nfs/onap/strimzi-kafka/zk-0"
-    echo "sudo mkdir -p /dockerdata-nfs/onap/strimzi-kafka/controller-0"
-    echo "sudo mkdir -p /dockerdata-nfs/onap/strimzi-kafka/broker-0"
-    echo "sudo chmod -R 777 /dockerdata-nfs"
-    echo "-------------------------------------------------------------------------------------------"
-else
-    echo "This is a single-node cluster."
-    echo "The installation will proceed with the assumption that /dockerdata-nfs is available on this node."
-    echo "------------------------------------- WARNING!!! -------------------------------------------"
-    echo "If there is any previous installation, please ensure that the /dockerdata-nfs directory is empty."
-    echo "Leaving any previous data in this directory may cause issues with the new installation."
-    echo "-------------------------------------------------------------------------------------------"
-fi
+# OpenEBS installation
+helm repo add openebs https://openebs.github.io/openebs
+helm repo update
+helm upgrade --install openebs --namespace openebs openebs/openebs --version 4.3.0 --create-namespace --set engines.replicated.mayastor.enabled=false --set engines.local.lvm.enabled=false --set engines.local.zfs.enabled=false --set loki.enabled=false --set alloy.enabled=false --wait
 
-# This needs to be done on all nodes in case of multi-node setup
-sudo mkdir -p /dockerdata-nfs/onap
-sudo mkdir -p /dockerdata-nfs/onap/mariadb
-sudo mkdir -p /dockerdata-nfs/onap/elastic-master-0
-sudo mkdir -p /dockerdata-nfs/onap/cps-temporal/data
-sudo mkdir -p /dockerdata-nfs/onap/strimzi-kafka/kafka-0
-sudo mkdir -p /dockerdata-nfs/onap/strimzi-kafka/zk-0
-sudo mkdir -p /dockerdata-nfs/onap/strimzi-kafka/controller-0
-sudo mkdir -p /dockerdata-nfs/onap/strimzi-kafka/broker-0
-sudo chmod -R 777 /dockerdata-nfs
+# Create storage class for smo
+kubectl apply -f ../packages/pre-configuration/smo-sc.yaml
 
 # Mariadb operator installation
 kubectl create ns mariadb-operator
@@ -70,14 +31,3 @@ helm repo update
 helm install mariadb-operator-crds mariadb-operator/mariadb-operator-crds -n mariadb-operator
 helm install mariadb-operator mariadb-operator/mariadb-operator -n mariadb-operator
 kubectl wait deployment mariadb-operator -n mariadb-operator --for=condition=available --timeout=120s
-
-# K8s Volume creation as required
-kubectl apply -f ../packages/pre-configuration/mariadb-galera-pv.yaml
-
-
-
-
-
-
-
-