NONRTRIC - Using volumeClaimTemplates 83/6083/2
authorPatrikBuhr <patrik.buhr@est.tech>
Tue, 18 May 2021 10:09:33 +0000 (12:09 +0200)
committerPatrikBuhr <patrik.buhr@est.tech>
Tue, 18 May 2021 10:18:28 +0000 (12:18 +0200)
Changed to using volumeClaimTemplates in both PMC and ECS.
The reason is that if anyone would create more than one instance, each
instance should have a separate volume.

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

nonrtric/helm/enrichmentservice/templates/pv.yaml [deleted file]
nonrtric/helm/enrichmentservice/templates/pvc.yaml [deleted file]
nonrtric/helm/enrichmentservice/templates/statefulset.yaml
nonrtric/helm/policymanagementservice/resources/config/application.yaml
nonrtric/helm/policymanagementservice/templates/pv.yaml [deleted file]
nonrtric/helm/policymanagementservice/templates/pvc.yaml [deleted file]
nonrtric/helm/policymanagementservice/templates/statefulset.yaml

diff --git a/nonrtric/helm/enrichmentservice/templates/pv.yaml b/nonrtric/helm/enrichmentservice/templates/pv.yaml
deleted file mode 100755 (executable)
index 66deec7..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-################################################################################
-#   Copyright (c) 2020 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.                                             #
-################################################################################
-
-kind: PersistentVolume
-apiVersion: v1
-metadata:
-  name: {{ include "common.name.enrichmentservice" . }}
-  namespace: {{ include "common.namespace.nonrtric" . }}
-  labels:
-    app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.enrichmentservice" . }}
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ .Release.Name }}
-    heritage: {{ .Release.Service }}
-    name: {{ include "common.name.enrichmentservice" . }}
-spec:
-  capacity:
-    storage: {{ .Values.enrichmentservice.persistence.size}}
-  accessModes:
-    - {{ .Values.enrichmentservice.persistence.accessMode }}
-  persistentVolumeReclaimPolicy: {{ .Values.enrichmentservice.persistence.volumeReclaimPolicy }}
-  hostPath:
-    path: {{ .Values.enrichmentservice.persistence.mountPath }}/{{ .Values.enrichmentservice.persistence.mountSubPath }}
-  storageClassName: "{{ include "common.name.enrichmentservice" . }}"
\ No newline at end of file
diff --git a/nonrtric/helm/enrichmentservice/templates/pvc.yaml b/nonrtric/helm/enrichmentservice/templates/pvc.yaml
deleted file mode 100755 (executable)
index a9795b7..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-################################################################################
-#   Copyright (c) 2020 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.                                             #
-################################################################################
-
-kind: PersistentVolumeClaim
-apiVersion: v1
-metadata:
-  name: {{ include "common.name.enrichmentservice" . }}-pvc
-  namespace: {{ include "common.namespace.nonrtric" . }}
-  labels:
-    app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.enrichmentservice" . }}
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ .Release.Name }}
-    heritage: {{ .Release.Service }}
-spec:
-  accessModes:
-    - {{ .Values.enrichmentservice.persistence.accessMode }}
-  resources:
-    requests:
-      storage: {{ .Values.enrichmentservice.persistence.size}}
-  storageClassName: "{{ include "common.name.enrichmentservice" . }}"
\ No newline at end of file
index 7bc9a75..4e2169f 100644 (file)
@@ -64,12 +64,23 @@ spec:
         volumeMounts:
         - name: {{ include "common.name.enrichmentservice" . }}-enrichment-config
           mountPath: /opt/app/enrichment-coordinator-service/config
-        - name: {{ include "common.name.enrichmentservice" . }}-ei-jobs-vol
+        - name: {{ include "common.name.enrichmentservice" . }}-vardata
           mountPath: /var/enrichment-coordinator-service
       volumes:
         - name: {{ include "common.name.enrichmentservice" . }}-enrichment-config
           configMap:
             name: {{ include "common.name.enrichmentservice" . }}-configmap
-        - name: {{ include "common.name.enrichmentservice" . }}-ei-jobs-vol
-          persistentVolumeClaim:
-            claimName: {{ include "common.name.enrichmentservice" . }}-pvc
+
+  volumeClaimTemplates:
+    - metadata:
+        name: {{ include "common.name.enrichmentservice" . }}-vardata
+      spec:
+        accessModes: 
+          - {{ .Values.enrichmentservice.persistence.accessMode }}    
+        resources:
+          requests:
+            storage: "{{ .Values.enrichmentservice.persistence.size }}"    
+                                    
+            
+            
+            
index a5faac5..5fc5051 100644 (file)
@@ -35,8 +35,9 @@ logging:
     org.springframework: ERROR
     org.springframework.data: ERROR
     org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR
-    org.onap.ccsdk.oran.a1policymanagementservice: INFO    
-  file: /var/log/policy-agent/application.log
+    org.onap.ccsdk.oran.a1policymanagementservice: INFO
+  file:
+    name: /var/log/policy-agent/application.log
 
 server:
    # Configuration of the HTTP/REST server. The parameters are defined and handeled by the springboot framework.
diff --git a/nonrtric/helm/policymanagementservice/templates/pv.yaml b/nonrtric/helm/policymanagementservice/templates/pv.yaml
deleted file mode 100644 (file)
index 929c7e5..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-################################################################################
-#   Copyright (c) 2020 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.                                             #
-################################################################################
-
-
-kind: PersistentVolume
-apiVersion: v1
-metadata:
-  name: {{ include "common.name.policymanagementservice" . }}
-  namespace: {{ include "common.namespace.nonrtric" . }}
-  labels:
-    app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.policymanagementservice" . }}
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ .Release.Name }}
-    heritage: {{ .Release.Service }}
-    name: {{ include "common.name.policymanagementservice" . }}
-spec:
-  capacity:
-    storage: {{ .Values.policymanagementservice.persistence.size}}
-  accessModes:
-    - {{ .Values.policymanagementservice.persistence.accessMode }}
-  persistentVolumeReclaimPolicy: {{ .Values.policymanagementservice.persistence.volumeReclaimPolicy }}
-  hostPath:
-    path: {{ .Values.policymanagementservice.persistence.mountPath }}/{{ .Values.policymanagementservice.persistence.mountSubPath }}
-  storageClassName: "{{ .Values.policymanagementservice.persistence.storageClass }}"
diff --git a/nonrtric/helm/policymanagementservice/templates/pvc.yaml b/nonrtric/helm/policymanagementservice/templates/pvc.yaml
deleted file mode 100644 (file)
index 1c84e7b..0000000
+++ /dev/null
@@ -1,35 +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.                                             #
-################################################################################
-
-
-kind: PersistentVolumeClaim
-apiVersion: v1
-metadata:
- name: {{ include "common.name.policymanagementservice" . }}-vardata-pvc
- namespace: {{ include "common.namespace.nonrtric" . }}
- labels:
-   app: {{ include "common.namespace.nonrtric" . }}-{{ include "common.name.policymanagementservice" . }}
-   chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-   release: {{ .Release.Name }}
-   heritage: {{ .Release.Service }}
-spec:
-  accessModes:
-    - ReadWriteOnce
-  resources:
-    requests:
-      storage: "{{ .Values.policymanagementservice.persistence.size }}"
-  storageClassName: "{{ .Values.policymanagementservice.persistence.storageClass }}"
-
index 779d51f..d67bb1e 100644 (file)
@@ -75,6 +75,12 @@ spec:
         - name: {{ include "common.name.policymanagementservice" . }}-policy-data
           configMap:
             name: {{ include "common.name.policymanagementservice" . }}-configmap-data
-        - name: {{ include "common.name.policymanagementservice" . }}-vardata
-          persistentVolumeClaim:
-            claimName: {{ include "common.name.policymanagementservice" . }}-vardata-pvc
+  volumeClaimTemplates:
+    - metadata:
+        name: {{ include "common.name.policymanagementservice" . }}-vardata
+      spec:
+        accessModes:
+          - {{ .Values.policymanagementservice.persistence.accessMode }}
+        resources:
+          requests:
+            storage: "{{ .Values.policymanagementservice.persistence.size }}"