From 386a2c52cf05fa25ac857c2915334087fded41c9 Mon Sep 17 00:00:00 2001 From: PatrikBuhr Date: Tue, 18 May 2021 12:09:33 +0200 Subject: [PATCH] NONRTRIC - Using volumeClaimTemplates 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 Issue-ID: NONRTRIC-478 Change-Id: I8048cef0d202d15e113864609281ac5676b97854 --- nonrtric/helm/enrichmentservice/templates/pv.yaml | 36 --------------------- nonrtric/helm/enrichmentservice/templates/pvc.yaml | 33 ------------------- .../enrichmentservice/templates/statefulset.yaml | 19 ++++++++--- .../resources/config/application.yaml | 5 +-- .../helm/policymanagementservice/templates/pv.yaml | 37 ---------------------- .../policymanagementservice/templates/pvc.yaml | 35 -------------------- .../templates/statefulset.yaml | 12 +++++-- 7 files changed, 27 insertions(+), 150 deletions(-) delete mode 100755 nonrtric/helm/enrichmentservice/templates/pv.yaml delete mode 100755 nonrtric/helm/enrichmentservice/templates/pvc.yaml delete mode 100644 nonrtric/helm/policymanagementservice/templates/pv.yaml delete mode 100644 nonrtric/helm/policymanagementservice/templates/pvc.yaml diff --git a/nonrtric/helm/enrichmentservice/templates/pv.yaml b/nonrtric/helm/enrichmentservice/templates/pv.yaml deleted file mode 100755 index 66deec70..00000000 --- a/nonrtric/helm/enrichmentservice/templates/pv.yaml +++ /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 index a9795b7b..00000000 --- a/nonrtric/helm/enrichmentservice/templates/pvc.yaml +++ /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 diff --git a/nonrtric/helm/enrichmentservice/templates/statefulset.yaml b/nonrtric/helm/enrichmentservice/templates/statefulset.yaml index 7bc9a75b..4e2169fc 100644 --- a/nonrtric/helm/enrichmentservice/templates/statefulset.yaml +++ b/nonrtric/helm/enrichmentservice/templates/statefulset.yaml @@ -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 }}" + + + + diff --git a/nonrtric/helm/policymanagementservice/resources/config/application.yaml b/nonrtric/helm/policymanagementservice/resources/config/application.yaml index a5faac5d..5fc5051e 100644 --- a/nonrtric/helm/policymanagementservice/resources/config/application.yaml +++ b/nonrtric/helm/policymanagementservice/resources/config/application.yaml @@ -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 index 929c7e5e..00000000 --- a/nonrtric/helm/policymanagementservice/templates/pv.yaml +++ /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 index 1c84e7bd..00000000 --- a/nonrtric/helm/policymanagementservice/templates/pvc.yaml +++ /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 }}" - diff --git a/nonrtric/helm/policymanagementservice/templates/statefulset.yaml b/nonrtric/helm/policymanagementservice/templates/statefulset.yaml index 779d51f0..d67bb1ef 100644 --- a/nonrtric/helm/policymanagementservice/templates/statefulset.yaml +++ b/nonrtric/helm/policymanagementservice/templates/statefulset.yaml @@ -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 }}" -- 2.16.6