Adding default volumes unless a dynamic volume provisioning is not available 29/6229/3
authorPatrikBuhr <patrik.buhr@est.tech>
Fri, 4 Jun 2021 08:57:06 +0000 (10:57 +0200)
committerPatrikBuhr <patrik.buhr@est.tech>
Mon, 21 Jun 2021 07:23:27 +0000 (09:23 +0200)
Possible to used dynamic volume provisioning or creating the persistent volumes
by the install (configured in the recipe).

Change-Id: I08b70d2a5211fdd6e3fd0937718eb724b274fab9
Signed-off-by: PatrikBuhr <patrik.buhr@est.tech>
Issue-ID: NONRTRIC-478

nonrtric/RECIPE_EXAMPLE/example_recipe.yaml
nonrtric/helm/enrichmentservice/templates/statefulset.yaml
nonrtric/helm/enrichmentservice/values.yaml
nonrtric/helm/nonrtric/templates/pv1.yaml [new file with mode: 0644]
nonrtric/helm/nonrtric/templates/pv2.yaml [new file with mode: 0644]
nonrtric/helm/nonrtric/values.yaml
nonrtric/helm/policymanagementservice/templates/statefulset.yaml
nonrtric/helm/policymanagementservice/values.yaml

index fcd62b7..3972294 100644 (file)
@@ -24,18 +24,81 @@ nonrtric:
   installPms: true
   installA1controller: false
   installA1simulator: false
-  installControlpanel: false
+  installControlpanel: true
   installEnrichmentservice: true
   installRappcatalogueservice: false
-  installNonrtricgateway: false
-
+  installNonrtricgateway: true
+  installKong: false
+  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: ecs-storage
+         
 common:
-  releasePrefix: r2-dev-nonrtric
-# Change the namespaces using the following options
+  releasePrefix: r3-dev-nonrtric
+# Do not change the namespace
   namespace:
     nonrtric: nonrtric
-  ingressClassName: kong
-  installKong: true
+  ingressClassName: kong 
+enrichmentservice:
+  enrichmentservice:
+    imagePullPolicy: IfNotPresent
+    image:
+      registry: 'nexus3.o-ran-sc.org:10004/o-ran-sc'
+      name: 'nonrtric-enrichment-coordinator-service'
+      tag: 1.1.0
+    service:
+      allowHttp: true
+      httpName: http
+      internalPort1: 9082
+      targetPort1: 8083
+      httpsName: https
+      internalPort2: 9083
+      targetPort2: 8434
+    liveness:
+      initialDelaySeconds: 20
+      periodSeconds: 10
+    readiness:
+      initialDelaySeconds: 20
+      periodSeconds: 10
+    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: ecs-storage
+
+# Need to check the external port Availability
+policymanagementservice:
+  policymanagementservice:
+    imagePullPolicy: IfNotPresent
+    image:
+      registry: 'nexus3.o-ran-sc.org:10004/o-ran-sc'
+      name: nonrtric-policy-agent
+      tag: 2.2.0
+    service:
+      allowHttp: true
+      httpName: http
+      internalPort1: 9080
+      targetPort1: 8081
+      httpsName: https
+      internalPort2: 9081
+      targetPort2: 8433
+    liveness:
+      initialDelaySeconds: 20
+      periodSeconds: 10
+    readiness:
+      initialDelaySeconds: 20
+      periodSeconds: 10
+    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
+
 
 # A1 Conttroller may take few more minutes to start. Increase the initialDelaySeconds in liveness to avoid container restart.
 a1controller:
@@ -118,68 +181,10 @@ controlpanel:
       initialDelaySeconds: 20
       periodSeconds: 10
 
-# Need to check the external port Availability
-policymanagementservice:
-  policymanagementservice:
-    imagePullPolicy: IfNotPresent
-    image:
-      registry: 'nexus3.o-ran-sc.org:10004/o-ran-sc'
-      name: nonrtric-policy-agent
-      tag: 2.2.0
-    service:
-      allowHttp: true
-      httpName: http
-      internalPort1: 9080
-      targetPort1: 8081
-      httpsName: https
-      internalPort2: 9081
-      targetPort2: 8433
-    liveness:
-      initialDelaySeconds: 20
-      periodSeconds: 10
-    readiness:
-      initialDelaySeconds: 20
-      periodSeconds: 10
-    persistence:
-      volumeReclaimPolicy: Retain
-      accessMode: ReadWriteOnce
-      size: 2Gi
-      mountPath: /dockerdata-nfs
-      mountSubPath: nonrtric/policymanagementservice
     ingress:
       enabled: false
-
-enrichmentservice:
-  enrichmentservice:
-    imagePullPolicy: IfNotPresent
-    image:
-      registry: 'nexus3.o-ran-sc.org:10004/o-ran-sc'
-      name: 'nonrtric-enrichment-coordinator-service'
-      tag: 1.1.0
-    service:
-      allowHttp: true
-      httpName: http
-      internalPort1: 9082
-      targetPort1: 8083
-      httpsName: https
-      internalPort2: 9083
-      targetPort2: 8434
-    liveness:
-      initialDelaySeconds: 20
-      periodSeconds: 10
-    readiness:
-      initialDelaySeconds: 20
-      periodSeconds: 10
-    persistence:
-      enabled: true
-      volumeReclaimPolicy: Retain
-      accessMode: ReadWriteOnce
-      size: 2Gi
-      mountPath: /dockerdata-nfs
-      mountSubPath: nonrtric/enrichmentservice
     ingress:
       enabled: false
-
 rappcatalogueservice:
   rappcatalogueservice:
     imagePullPolicy: IfNotPresent
index 4e2169f..678e8b1 100644 (file)
@@ -75,12 +75,8 @@ spec:
     - metadata:
         name: {{ include "common.name.enrichmentservice" . }}-vardata
       spec:
-        accessModes: 
-          - {{ .Values.enrichmentservice.persistence.accessMode }}    
+        accessModes: [ ReadWriteOnce ]
+        storageClassName: "{{ .Values.enrichmentservice.persistence.storageClassName }}"        
         resources:
           requests:
-            storage: "{{ .Values.enrichmentservice.persistence.size }}"    
-                                    
-            
-            
-            
+            storage: "{{ .Values.enrichmentservice.persistence.size }}"
index e5d997a..8ed6dc5 100644 (file)
@@ -21,8 +21,8 @@
 enrichmentservice:
   imagePullPolicy: IfNotPresent
   image:
-    registry: 'nexus3.o-ran-sc.org:10004/o-ran-sc'
-    name: 'nonrtric-enrichment-coordinator-service'
+    registry: "nexus3.o-ran-sc.org:10004/o-ran-sc"
+    name: "nonrtric-enrichment-coordinator-service"
     tag: 1.1.0
   service:
     allowHttp: true
@@ -39,10 +39,7 @@ enrichmentservice:
     initialDelaySeconds: 20
     periodSeconds: 10
   persistence:
-    volumeReclaimPolicy: Retain
-    accessMode: ReadWriteOnce
     size: 2Gi
-    mountPath: /dockerdata-nfs
-    mountSubPath: nonrtric/enrichmentservice
+    storageClassName: standard
   ingress:
     enabled: false
diff --git a/nonrtric/helm/nonrtric/templates/pv1.yaml b/nonrtric/helm/nonrtric/templates/pv1.yaml
new file mode 100644 (file)
index 0000000..c9ba128
--- /dev/null
@@ -0,0 +1,35 @@
+###############################################################################
+#   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.volume1.size }}
+
+kind: PersistentVolume
+apiVersion: v1
+metadata:
+  name: nonrtric-pv1
+  namespace: {{ include "common.namespace.nonrtric" . }}
+spec:
+  capacity:
+    storage: {{ .Values.nonrtric.volume1.size}}
+  accessModes:
+    - ReadWriteOnce
+    - ReadWriteMany
+  persistentVolumeReclaimPolicy: Retain
+  hostPath:
+    path: /dockerdata-nfs/nonrtric/volume1
+  storageClassName: {{ .Values.nonrtric.volume1.storageClassName }}
+
+{{- end }}
diff --git a/nonrtric/helm/nonrtric/templates/pv2.yaml b/nonrtric/helm/nonrtric/templates/pv2.yaml
new file mode 100644 (file)
index 0000000..6fd313c
--- /dev/null
@@ -0,0 +1,36 @@
+###############################################################################
+#   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.volume2.size }}
+
+kind: PersistentVolume
+apiVersion: v1
+metadata:
+  name: nonrtric-pv2
+  namespace: {{ include "common.namespace.nonrtric" . }}
+spec:
+  capacity:
+    storage: {{ .Values.nonrtric.volume2.size }}
+  accessModes:
+    - ReadWriteOnce
+    - ReadWriteMany
+  persistentVolumeReclaimPolicy: Retain
+  hostPath:
+    path: /dockerdata-nfs/nonrtric/volume2
+  storageClassName: {{ .Values.nonrtric.volume2.storageClassName }}
+
+{{- end }}
+
index b4728c5..5a13778 100644 (file)
@@ -14,8 +14,6 @@
 #   limitations under the License.                                             #
 ################################################################################
 
-
-
 nonrtric:
   installPms: true
   installA1controller: true
@@ -24,3 +22,9 @@ nonrtric:
   installEnrichmentservice: true
   installRappcatalogueservice: true
   installNonrtricgateway: true
+  volume1:
+    size: 1Gi
+    storageClassName: volume1
+  volume2:
+    size: 1Gi
+    storageClassName: volume2
index d67bb1e..3ef2826 100644 (file)
@@ -80,7 +80,8 @@ spec:
         name: {{ include "common.name.policymanagementservice" . }}-vardata
       spec:
         accessModes:
-          - {{ .Values.policymanagementservice.persistence.accessMode }}
+          - ReadWriteOnce
+        storageClassName: "{{ .Values.policymanagementservice.persistence.storageClassName }}"
         resources:
           requests:
-            storage: "{{ .Values.policymanagementservice.persistence.size }}"                        
+            storage: "{{ .Values.policymanagementservice.persistence.size }}"
index a868bce..85accd4 100644 (file)
@@ -21,7 +21,7 @@
 policymanagementservice:
   imagePullPolicy: IfNotPresent
   image:
-    registry: 'nexus3.o-ran-sc.org:10004/o-ran-sc'
+    registry: "nexus3.o-ran-sc.org:10004/o-ran-sc"
     name: nonrtric-policy-agent
     tag: 2.2.0
   service:
@@ -39,13 +39,7 @@ policymanagementservice:
     initialDelaySeconds: 20
     periodSeconds: 10
   persistence:
-    volumeReclaimPolicy: Retain
-    accessMode: ReadWriteOnce
     size: 2Gi
-    mountPath: /dockerdata-nfs
-    mountSubPath: nonrtric/policymanagementservice
-    storageClass: "manual"
-    enabled: true
-    #existingClaim:
+    storageClassName: standard
   ingress:
     enabled: false