Vid Template alignment.
[oom.git] / kubernetes / appc / templates / statefulset.yaml
1 apiVersion: apps/v1beta1
2 kind: StatefulSet
3 metadata:
4   name: {{ include "common.fullname" . }}
5   namespace: {{ include "common.namespace" . }}
6   labels:
7     app: {{ include "common.name" . }}
8     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
9     release: {{ .Release.Name }}
10     heritage: {{ .Release.Service }}
11 spec:
12   serviceName: "{{ .Values.service.name }}-cluster"
13   replicas: {{ .Values.replicaCount }}
14   podManagementPolicy: Parallel
15   template:
16     metadata:
17       labels:
18         app: {{ include "common.name" . }}
19         release: {{ .Release.Name }}
20     spec:
21       imagePullSecrets:
22       - name: "{{ include "common.namespace" . }}-docker-registry-key"
23       initContainers:
24       - command:
25         - /root/ready.py
26         args:
27         - --container-name
28         - {{ .Values.mysql.nameOverride }}
29         env:
30         - name: NAMESPACE
31           valueFrom:
32             fieldRef:
33               apiVersion: v1
34               fieldPath: metadata.namespace
35         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
36         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
37         name: {{ include "common.name" . }}-readiness
38       containers:
39         - name: {{ include "common.name" . }}
40           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
41           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
42           command:
43           - /opt/appc/bin/startODL.sh
44           ports:
45           - containerPort: {{ .Values.service.internalPort }}
46           - containerPort: {{ .Values.service.externalPort2 }}
47           readinessProbe:
48             exec:
49               command:
50               - /opt/appc/bin/health_check.sh
51             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
52             periodSeconds: {{ .Values.readiness.periodSeconds }}
53           env:
54             - name: MYSQL_ROOT_PASSWORD
55               valueFrom:
56                 secretKeyRef:
57                   name: {{ template "common.fullname" . }}
58                   key: db-root-password
59             - name: SDNC_CONFIG_DIR
60               value: "{{ .Values.config.configDir }}"
61             - name: APPC_CONFIG_DIR
62               value: "{{ .Values.config.configDir }}"
63             - name: DMAAP_TOPIC_ENV
64               value: "{{ .Values.config.dmaapTopic }}"
65             - name: ENABLE_AAF
66               value: "{{ .Values.config.enableAAF }}"
67             - name: ENABLE_ODL_CLUSTER
68               value: "{{ .Values.config.enableClustering }}"
69             - name: APPC_REPLICAS
70               value: "{{ .Values.replicaCount }}"
71           volumeMounts:
72           - mountPath: /etc/localtime
73             name: localtime
74             readOnly: true
75           - mountPath: /opt/onap/appc/data/properties/dblib.properties
76             name: onap-appc-data-properties
77             subPath: dblib.properties
78           - mountPath: /opt/onap/appc/data/properties/svclogic.properties
79             name: onap-appc-data-properties
80             subPath: svclogic.properties
81           - mountPath: /opt/onap/appc/data/properties/appc.properties
82             name: onap-appc-data-properties
83             subPath: appc.properties
84           - mountPath: /opt/onap/appc/data/properties/aaiclient.properties
85             name: onap-appc-data-properties
86             subPath: aaiclient.properties
87           - mountPath: /opt/onap/appc/data/properties/aaa-app-config.xml
88             name: onap-appc-data-properties
89             subPath: aaa-app-config.xml
90           - mountPath: /opt/onap/appc/svclogic/config/svclogic.properties
91             name: onap-appc-svclogic-config
92             subPath: svclogic.properties
93           - mountPath: /opt/onap/appc/svclogic/bin/showActiveGraphs.sh
94             name: onap-appc-svclogic-bin
95             subPath: showActiveGraphs.sh
96           - mountPath: /opt/onap/appc/bin/startODL.sh
97             name: onap-appc-bin
98             subPath: startODL.sh
99           - mountPath: /opt/onap/appc/bin/installAppcDb.sh
100             name: onap-appc-bin
101             subPath: installAppcDb.sh
102           - mountPath: /opt/onap/appc/bin/health_check.sh
103             name: onap-appc-bin
104             subPath: health_check.sh
105           - mountPath: /opt/onap/ccsdk/data/properties/dblib.properties
106             name: onap-sdnc-data-properties
107             subPath: dblib.properties
108           - mountPath: /opt/onap/ccsdk/data/properties/svclogic.properties
109             name: onap-sdnc-data-properties
110             subPath: svclogic.properties
111           - mountPath: /opt/onap/ccsdk/data/properties/aaiclient.properties
112             name: onap-sdnc-data-properties
113             subPath: aaiclient.properties
114           - mountPath: /opt/onap/ccsdk/svclogic/config/svclogic.properties
115             name: onap-sdnc-svclogic-config
116             subPath: svclogic.properties
117           - mountPath: /opt/onap/ccsdk/svclogic/bin/showActiveGraphs.sh
118             name: onap-sdnc-svclogic-bin
119             subPath: showActiveGraphs.sh
120           - mountPath: /opt/onap/ccsdk/bin/startODL.sh
121             name: onap-sdnc-bin
122             subPath: startODL.sh
123           - mountPath: /opt/onap/ccsdk/bin/installSdncDb.sh
124             name: onap-sdnc-bin
125             subPath: installSdncDb.sh
126           - mountPath: {{ .Values.persistence.mdsalPath }}
127             name: {{ include "common.fullname" . }}-data
128           - mountPath: /var/log/onap
129             name: logs
130           - mountPath: /opt/opendaylight/current/etc/org.ops4j.pax.logging.cfg
131             name: log-config
132             subPath: org.ops4j.pax.logging.cfg
133           resources:
134 {{ toYaml .Values.resources | indent 12 }}
135         {{- if .Values.nodeSelector }}
136         nodeSelector:
137 {{ toYaml .Values.nodeSelector | indent 10 }}
138         {{- end -}}
139         {{- if .Values.affinity }}
140         affinity:
141 {{ toYaml .Values.affinity | indent 10 }}
142         {{- end }}
143
144         # side car containers
145         - name: filebeat-onap
146           image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
147           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
148           volumeMounts:
149           - mountPath: /usr/share/filebeat/filebeat.yml
150             name: filebeat-conf
151             subPath: filebeat.yml
152           - mountPath: /var/log/onap
153             name: logs
154           - mountPath: /usr/share/filebeat/data
155             name: data-filebeat
156       volumes:
157         - name: localtime
158           hostPath:
159             path: /etc/localtime
160         - name: filebeat-conf
161           configMap:
162             name: {{ include "common.fullname" . }}-filebeat
163         - name: log-config
164           configMap:
165             name: {{ include "common.fullname" . }}-logging-cfg
166         - name: logs
167           emptyDir: {}
168         - name: data-filebeat
169           emptyDir: {}
170         - name: onap-appc-data-properties
171           configMap:
172             name: {{ include "common.fullname" . }}-onap-appc-data-properties
173         - name: onap-appc-svclogic-config
174           configMap:
175             name: {{ include "common.fullname" . }}-onap-appc-svclogic-config
176         - name: onap-appc-svclogic-bin
177           configMap:
178             name: {{ include "common.fullname" . }}-onap-appc-svclogic-bin
179             defaultMode: 0755
180         - name: onap-appc-bin
181           configMap:
182             name: {{ include "common.fullname" . }}-onap-appc-bin
183             defaultMode: 0755
184         - name: onap-sdnc-data-properties
185           configMap:
186             name: {{ include "common.fullname" . }}-onap-sdnc-data-properties
187         - name: onap-sdnc-svclogic-config
188           configMap:
189             name: {{ include "common.fullname" . }}-onap-sdnc-svclogic-config
190         - name: onap-sdnc-svclogic-bin
191           configMap:
192             name: {{ include "common.fullname" . }}-onap-sdnc-svclogic-bin
193             defaultMode: 0755
194         - name: onap-sdnc-bin
195           configMap:
196             name: {{ include "common.fullname" . }}-onap-sdnc-bin
197             defaultMode: 0755
198 {{ if not .Values.persistence.enabled }}
199         - name: {{ include "common.fullname" . }}-data
200           emptyDir: {}
201 {{ else }}
202   volumeClaimTemplates:
203   - metadata:
204       name: {{ include "common.fullname" . }}-data
205       labels:
206         name: {{ include "common.fullname" . }}
207     spec:
208       accessModes: [ {{ .Values.persistence.accessMode }} ]
209       storageClassName: {{ include "common.fullname" . }}-data
210       resources:
211         requests:
212           storage: {{ .Values.persistence.size }}
213 {{ end }}