Merge "Fix UUI health check"
[oom.git] / kubernetes / so / templates / deployment.yaml
1 apiVersion: extensions/v1beta1
2 kind: Deployment
3 metadata:
4   name: {{ include "common.name" . }}
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   replicas: {{ .Values.replicaCount }}
13   template:
14     metadata:
15       labels:
16         app: {{ include "common.name" . }}
17         release: {{ .Release.Name }}
18     spec:
19       initContainers:
20       - command:
21         - /root/ready.py
22         args:
23         - --container-name
24         - so-mariadb
25         env:
26         - name: NAMESPACE
27           valueFrom:
28             fieldRef:
29               apiVersion: v1
30               fieldPath: metadata.namespace
31         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
32         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
33         name: {{ include "common.name" . }}-readiness
34       containers:
35         - name: {{ .Chart.Name }}
36           command:
37           - /tmp/start-jboss-server.sh
38           image: "{{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }}"
39           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
40           ports:
41           - containerPort: {{ .Values.service.internalPort }}
42           - containerPort: {{ .Values.service.internalPort2 }}
43           - containerPort: {{ .Values.service.internalPort3 }}
44           - containerPort: {{ .Values.service.internalPort4 }}
45           - containerPort: {{ .Values.service.internalPort5 }}
46           # disable liveness probe when breakpoints set in debugger
47           # so K8s doesn't restart unresponsive container 
48           {{- if eq .Values.liveness.enabled true }}
49           livenessProbe:
50             tcpSocket:
51               port: {{ .Values.service.internalPort }}
52             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
53             periodSeconds: {{ .Values.liveness.periodSeconds }}
54           {{ end -}}
55           readinessProbe:
56             tcpSocket:
57               port: {{ .Values.service.internalPort }}
58             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
59             periodSeconds: {{ .Values.readiness.periodSeconds }}
60           env:
61             - name: JBOSS_DEBUG
62               value: {{ .Values.global.debugEnabled | default .Values.debugEnabled | quote }}
63           volumeMounts:
64           - mountPath: /etc/localtime
65             name: localtime
66             readOnly: true
67           - mountPath: /shared/
68             name: so
69           - mountPath: /tmp/start-jboss-server.sh
70             name: so-docker-files
71             subPath: start-jboss-server.sh
72           - mountPath: /opt/jboss/standalone/configuration/standalone-full-ha-mso.xml
73             name: so-config
74             subPath: standalone-full-ha-mso.xml
75
76           - mountPath: /var/log/onap
77             name: so-logs
78           - mountPath: /var/berks-cookbooks/mso-config/files/default/mso-po-adapter-config/logback.network.xml
79             name: so-logback
80             subPath: logback.network.xml
81           - mountPath: /var/berks-cookbooks/mso-config/files/default/mso-po-adapter-config/logback.tenant.xml
82             name: so-logback
83             subPath: logback.tenant.xml
84           - mountPath: /var/berks-cookbooks/mso-config/files/default/mso-po-adapter-config/logback.vnf.xml
85             name: so-logback
86             subPath: logback.vnf.xml
87           - mountPath: /var/berks-cookbooks/mso-config/files/default/mso-po-adapter-config/logback.vfc.xml
88             name: so-logback
89             subPath: logback.vfc.xml
90           - mountPath: /var/berks-cookbooks/mso-config/files/default/mso-api-handler-infra-config/logback.apihandler-infra.xml
91             name: so-logback
92             subPath: logback.apihandler-infra.xml
93           - mountPath: /var/berks-cookbooks/mso-config/files/default/mso-appc-adapter-config/logback.appc.xml
94             name: so-logback
95             subPath: logback.appc.xml
96           - mountPath: /var/berks-cookbooks/mso-config/files/default/mso-requests-db-adapter-config/logback.msorequestsdbadapter.xml
97             name: so-logback
98             subPath: logback.msorequestsdbadapter.xml
99           - mountPath: /var/berks-cookbooks/mso-config/files/default/mso-asdc-controller-config/logback.asdc.xml
100             name: so-logback
101             subPath: logback.asdc.xml
102           - mountPath: /var/berks-cookbooks/mso-config/files/default/mso-sdnc-adapter-config/logback.sdnc.xml
103             name: so-logback
104             subPath: logback.sdnc.xml
105           - mountPath: /var/berks-cookbooks/mso-config/files/default/mso-bpmn-config/logback.bpmn.xml
106             name: so-logback
107             subPath: logback.bpmn.xml
108           - mountPath: /var/berks-cookbooks/mso-config/files/default/mso-workflow-message-adapter-config/logback.workflow-message-adapter.xml
109             name: so-logback
110             subPath: logback.workflow-message-adapter.xml
111           resources:
112 {{ toYaml .Values.resources | indent 12 }}
113         {{- if .Values.nodeSelector }}
114         nodeSelector:
115 {{ toYaml .Values.nodeSelector | indent 10 }}
116         {{- end -}}
117         {{- if .Values.affinity }}
118         affinity:
119 {{ toYaml .Values.affinity | indent 10 }}
120         {{- end }}
121         
122         # side car containers
123         - name: filebeat-onap
124           image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
125           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
126           volumeMounts:
127           - mountPath: /usr/share/filebeat/filebeat.yml
128             name: filebeat-conf
129             subPath: filebeat.yml
130           - mountPath: /var/log/onap
131             name: so-logs
132           - mountPath: /usr/share/filebeat/data
133             name: so-data-filebeat
134
135       volumes:
136         - name: localtime
137           hostPath:
138             path: /etc/localtime
139         - name: so-logback
140           configMap:
141             name: so-log-configmap
142         - name: filebeat-conf
143           configMap:
144             name: so-filebeat-configmap
145         - name: so
146           configMap:
147             name: so-configmap
148             items:
149             - key: mso-docker.json
150               path: mso-docker.json
151               mode: 0755
152             - key: aai.crt
153               path: aai.crt
154               mode: 0755
155             - key: encryption.key
156               path: encryption.key
157               mode: 0644
158         - name: so-config
159           configMap:
160             name: so-configmap
161             items:
162             - key: standalone-full-ha-mso.xml
163               path: standalone-full-ha-mso.xml
164               mode: 0644
165         - name: so-logs
166           emptyDir: {}
167         - name: so-data-filebeat
168           emptyDir: {}
169         - name: so-docker-files
170           configMap:
171             name: so-docker-file-configmap
172             items:
173             - key: start-jboss-server.sh
174               path: start-jboss-server.sh
175               mode: 0755
176       imagePullSecrets:
177       - name: "{{ include "common.name" . }}-docker-registry-key"