Improve oran_oom helm charts
[it/dep.git] / smo-install / oran_oom / policymanagementservice / templates / statefulset.yaml
1 ################################################################################
2 #   Copyright (c) 2020 Nordix Foundation.                                      #
3 #                                                                              #
4 #   Licensed under the Apache License, Version 2.0 (the "License");            #
5 #   you may not use this file except in compliance with the License.           #
6 #   You may obtain a copy of the License at                                    #
7 #                                                                              #
8 #       http://www.apache.org/licenses/LICENSE-2.0                             #
9 #                                                                              #
10 #   Unless required by applicable law or agreed to in writing, software        #
11 #   distributed under the License is distributed on an "AS IS" BASIS,          #
12 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
13 #   See the License for the specific language governing permissions and        #
14 #   limitations under the License.                                             #
15 ################################################################################
16
17 kind: StatefulSet
18 apiVersion: apps/v1
19 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
20 spec:
21   serviceName: {{ include "common.name" . }}
22   replicas: 1
23   selector: {{- include "common.selectors" . | nindent 4 }}
24   template:
25     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
26     spec:
27       hostname: {{ include "common.name" . }}
28       initContainers:
29       - name: copy
30         image: busybox:1.28
31         command:
32         - /bin/sh
33         - -c
34         - FILE=/var/policy-management-service/application_configuration.json;
35           if [ ! -f $FILE ]; then
36             cp  /etc/app/policy-management-service/initialdata/application_configuration.json $FILE;
37           fi;
38           chmod 666 $FILE;
39         volumeMounts:
40         - name: {{ include "common.vardataMountName" . }}
41           mountPath: "/var/policy-management-service"
42         - name: {{ include "common.name" . }}-policy-data
43           mountPath: /etc/app/policy-management-service/initialdata
44       containers:
45       - name: {{ include "common.containername" . }}
46         image: {{ .Values.image.registry }}/{{ .Values.image.name }}:{{ .Values.image.tag }}
47         imagePullPolicy: {{ .Values.imagePullPolicy }}
48         ports: {{- include "common.containerPorts" . | nindent 8 }}
49         {{- include "common.tcpsocketReadinessProbe" . | nindent 8 }}
50         {{- include "common.httpLiveProbe" . | nindent 8 }}
51         volumeMounts:
52         - name: {{ include "common.applicationConfigMountName" . }}
53           mountPath: /opt/app/policy-agent/config
54         - name: {{ include "common.vardataMountName" . }}
55           mountPath: "/var/policy-management-service"
56         - name: {{ include "common.name" . }}-policy-data
57           mountPath: /etc/app/policy-management-service/initialdata
58       volumes:
59         {{- include "common.applicationConfigVolume" . | nindent 8 }}
60         - name: {{ include "common.name" . }}-policy-data
61           configMap:
62             name: {{ include "common.name" . }}-data-configmap
63   volumeClaimTemplates: {{- include "common.vardataVolumeClaimTemplate" . | nindent 4 }}