From 8a1a9a4f6864499d0340ff3b8e2de46eeda9ec33 Mon Sep 17 00:00:00 2001 From: PatrikBuhr Date: Fri, 4 Jun 2021 10:57:06 +0200 Subject: [PATCH] Adding default volumes unless a dynamic volume provisioning is not available 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 Issue-ID: NONRTRIC-478 --- nonrtric/RECIPE_EXAMPLE/example_recipe.yaml | 135 +++++++++++---------- .../enrichmentservice/templates/statefulset.yaml | 10 +- nonrtric/helm/enrichmentservice/values.yaml | 9 +- nonrtric/helm/nonrtric/templates/pv1.yaml | 35 ++++++ nonrtric/helm/nonrtric/templates/pv2.yaml | 36 ++++++ nonrtric/helm/nonrtric/values.yaml | 8 +- .../templates/statefulset.yaml | 5 +- nonrtric/helm/policymanagementservice/values.yaml | 10 +- 8 files changed, 158 insertions(+), 90 deletions(-) create mode 100644 nonrtric/helm/nonrtric/templates/pv1.yaml create mode 100644 nonrtric/helm/nonrtric/templates/pv2.yaml diff --git a/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml b/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml index fcd62b7a..39722949 100644 --- a/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml +++ b/nonrtric/RECIPE_EXAMPLE/example_recipe.yaml @@ -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 diff --git a/nonrtric/helm/enrichmentservice/templates/statefulset.yaml b/nonrtric/helm/enrichmentservice/templates/statefulset.yaml index 4e2169fc..678e8b15 100644 --- a/nonrtric/helm/enrichmentservice/templates/statefulset.yaml +++ b/nonrtric/helm/enrichmentservice/templates/statefulset.yaml @@ -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 }}" diff --git a/nonrtric/helm/enrichmentservice/values.yaml b/nonrtric/helm/enrichmentservice/values.yaml index e5d997a9..8ed6dc58 100644 --- a/nonrtric/helm/enrichmentservice/values.yaml +++ b/nonrtric/helm/enrichmentservice/values.yaml @@ -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 index 00000000..c9ba128a --- /dev/null +++ b/nonrtric/helm/nonrtric/templates/pv1.yaml @@ -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 index 00000000..6fd313cc --- /dev/null +++ b/nonrtric/helm/nonrtric/templates/pv2.yaml @@ -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 }} + diff --git a/nonrtric/helm/nonrtric/values.yaml b/nonrtric/helm/nonrtric/values.yaml index b4728c5b..5a137787 100644 --- a/nonrtric/helm/nonrtric/values.yaml +++ b/nonrtric/helm/nonrtric/values.yaml @@ -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 diff --git a/nonrtric/helm/policymanagementservice/templates/statefulset.yaml b/nonrtric/helm/policymanagementservice/templates/statefulset.yaml index d67bb1ef..3ef28260 100644 --- a/nonrtric/helm/policymanagementservice/templates/statefulset.yaml +++ b/nonrtric/helm/policymanagementservice/templates/statefulset.yaml @@ -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 }}" diff --git a/nonrtric/helm/policymanagementservice/values.yaml b/nonrtric/helm/policymanagementservice/values.yaml index a868bce1..85accd42 100644 --- a/nonrtric/helm/policymanagementservice/values.yaml +++ b/nonrtric/helm/policymanagementservice/values.yaml @@ -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 -- 2.16.6