From: PatrikBuhr Date: Tue, 4 May 2021 06:51:22 +0000 (+0200) Subject: NONRTRIC - PMS Persistent storage of policies and type definitions X-Git-Tag: f-release~54 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=it%2Fdep.git;a=commitdiff_plain;h=e046844b54bb936b8015dd38de3abbbc7e8a4f2d NONRTRIC - PMS Persistent storage of policies and type definitions Changed deployment to statefulset in both PMC and ECS. "Even Deployments with one replica using ReadWriteOnce volume are not recommended. This is because the default Deployment strategy creates a second Pod before bringing down the first Pod on a recreate. The Deployment may fail in deadlock as the second Pod can't start because the ReadWriteOnce volume is already in use, and the first Pod won't be removed because the seco nd Pod has not yet started. Instead, use a StatefulSet with ReadWriteOnce volumes." Change-Id: If3afb358e9a111bf2be0d5ceb9c5a70c314a9222 Signed-off-by: PatrikBuhr Issue-ID: NONRTRIC-478 --- diff --git a/nonrtric/helm/enrichmentservice/templates/deployment.yaml b/nonrtric/helm/enrichmentservice/templates/statefulset.yaml similarity index 96% rename from nonrtric/helm/enrichmentservice/templates/deployment.yaml rename to nonrtric/helm/enrichmentservice/templates/statefulset.yaml index 11a18747..7bc9a75b 100644 --- a/nonrtric/helm/enrichmentservice/templates/deployment.yaml +++ b/nonrtric/helm/enrichmentservice/templates/statefulset.yaml @@ -14,7 +14,7 @@ # limitations under the License. # ################################################################################ -kind: Deployment +kind: StatefulSet apiVersion: apps/v1 metadata: name: {{ include "common.name.enrichmentservice" . }} @@ -28,6 +28,7 @@ metadata: annotations: deployment.kubernetes.io/revision: '1' spec: + serviceName: {{ include "common.name.enrichmentservice" . }} replicas: 1 selector: matchLabels: @@ -64,11 +65,11 @@ spec: - name: {{ include "common.name.enrichmentservice" . }}-enrichment-config mountPath: /opt/app/enrichment-coordinator-service/config - name: {{ include "common.name.enrichmentservice" . }}-ei-jobs-vol - mountPath: /var/enrichment-coordinator-service/database + 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 \ No newline at end of file + claimName: {{ include "common.name.enrichmentservice" . }}-pvc diff --git a/nonrtric/helm/policymanagementservice/templates/deployment.yaml b/nonrtric/helm/policymanagementservice/templates/statefulset.yaml similarity index 95% rename from nonrtric/helm/policymanagementservice/templates/deployment.yaml rename to nonrtric/helm/policymanagementservice/templates/statefulset.yaml index 939f9351..779d51f0 100644 --- a/nonrtric/helm/policymanagementservice/templates/deployment.yaml +++ b/nonrtric/helm/policymanagementservice/templates/statefulset.yaml @@ -14,7 +14,7 @@ # limitations under the License. # ################################################################################ -kind: Deployment +kind: StatefulSet apiVersion: apps/v1 metadata: name: {{ include "common.name.policymanagementservice" . }} @@ -28,6 +28,7 @@ metadata: annotations: deployment.kubernetes.io/revision: '1' spec: + serviceName: {{ include "common.name.policymanagementservice" . }} replicas: 1 selector: matchLabels: @@ -62,11 +63,11 @@ spec: periodSeconds: {{ .Values.policymanagementservice.liveness.periodSeconds }} volumeMounts: - name: {{ include "common.name.policymanagementservice" . }}-vardata - mountPath: "/var/policy-management-service/database" + mountPath: "/var/policy-management-service" - name: {{ include "common.name.policymanagementservice" . }}-policy-config mountPath: /opt/app/policy-agent/config - name: {{ include "common.name.policymanagementservice" . }}-policy-data - mountPath: /opt/app/policy-agent/data + mountPath: /opt/app/policy-agent/data volumes: - name: {{ include "common.name.policymanagementservice" . }}-policy-config configMap: