X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2Fa1policymanagement%2Ftemplates%2Fstatefulset.yaml;fp=kubernetes%2Fa1policymanagement%2Ftemplates%2Fdeployment.yaml;h=54ee1515bcfb362085bb3b16c716c2c677e523ab;hb=746ff37c26277159584e2ad9b01b55a8f70fbd71;hp=0d8399c8b357bd3047a74cdedab146cff3be8ab8;hpb=87411cc03c91a0ba7f26fcd9e7e4bd8afb75b24e;p=oom.git diff --git a/kubernetes/a1policymanagement/templates/deployment.yaml b/kubernetes/a1policymanagement/templates/statefulset.yaml similarity index 92% rename from kubernetes/a1policymanagement/templates/deployment.yaml rename to kubernetes/a1policymanagement/templates/statefulset.yaml index 0d8399c8b3..54ee1515bc 100644 --- a/kubernetes/a1policymanagement/templates/deployment.yaml +++ b/kubernetes/a1policymanagement/templates/statefulset.yaml @@ -17,17 +17,11 @@ ################################################################################ */}} -kind: Deployment +kind: StatefulSet apiVersion: apps/v1 -metadata: - name: {{ include "common.fullname" . }} - namespace: {{ include "common.namespace" . }} - labels: - app: {{ include "common.name" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ include "common.release" . }}" - heritage: "{{ .Release.Service }}" +metadata: {{- include "common.resourceMetadata" . | nindent 2 }} spec: + serviceName: {{ include "common.servicename" . }} replicas: {{ index .Values.replicaCount }} selector: {{- include "common.selectors" . | nindent 4 }} template: @@ -108,8 +102,8 @@ spec: subPath: application_configuration.json - name: config mountPath: /opt/app/policy-agent/config/application.yaml - subPath: application.yaml - - name: vardata + subPath: application.yaml + - name: {{ include "common.fullname" . }} mountPath: "/var/policy-management-service/database" resources: {{ include "common.resources" . | nindent 10 }} volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }} @@ -123,6 +117,10 @@ spec: - name: config emptyDir: medium: Memory - - name: vardata - persistentVolumeClaim: - claimName: {{ include "common.fullname" . }} +{{- if not .Values.persistence.enabled }} + - name: {{ include "common.fullname" . }} + emptyDir: {} +{{- else }} + volumeClaimTemplates: + - {{include "common.PVCTemplate" . | indent 6 | trim }} +{{- end }}