[COMMON] new logConfiguration chart
[oom.git] / kubernetes / oof / charts / oof-cmso / charts / oof-cmso-ticketmgt / templates / deployment.yaml
1 # Copyright © 2018 AT&T
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 apiVersion: extensions/v1beta1
16 kind: Deployment
17 metadata:
18   name: {{ include "common.fullname" . }}
19   namespace: {{ include "common.namespace" . }}
20   labels:
21     app: {{ include "common.name" . }}
22     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
23     release: {{ include "common.release" . }}
24     heritage: {{ .Release.Service }}
25 spec:
26   replicas: {{ .Values.replicaCount }}
27   template:
28     metadata:
29       labels:
30         app: {{ include "common.name" . }}
31         release: {{ include "common.release" . }}
32     spec:
33       initContainers:
34       - name: {{ include "common.name" . }}-chown
35         command: ["/bin/sh", "-c", "chown -Rf 1000:1000 /share/"]
36         image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}"
37         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
38         volumeMounts:
39           - name: {{ include "common.fullname" . }}-logs
40             mountPath: /share/logs
41       containers:
42       - name: {{ include "common.name" . }}
43         image: "{{ include "common.repository" . }}/{{ .Values.image }}"
44         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
45         env:
46         - name: JAVA_TRUSTSTORE
47           value: /share/etc/certs/{{ .Values.global.truststoreFile }}
48         - name: SSL_KEYSTORE
49           value: /share/etc/certs/{{ .Values.global.keystoreFile }}
50         - name: JAVA_TRUSTSTORE_PASSWORD
51           value: {{ .Values.global.truststorePassword }}
52         - name: SSL_KEYSTORE_PASSWORD
53           value: {{ .Values.global.keystorePassword }}
54         - name: AUTHENTICATION
55           value: proprietary-auth
56         ports:
57         - containerPort: {{ .Values.service.internalPort }}
58         # disable liveness probe when breakpoints set in debugger
59         # so K8s doesn't restart unresponsive container
60         {{- if eq .Values.liveness.enabled true }}
61         livenessProbe:
62           tcpSocket:
63             port: {{ .Values.service.internalPort }}
64           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
65           periodSeconds: {{ .Values.liveness.periodSeconds }}
66         {{ end -}}
67         readinessProbe:
68           tcpSocket:
69             port: {{ .Values.service.internalPort }}
70           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
71           periodSeconds: {{ .Values.readiness.periodSeconds }}
72         volumeMounts:
73         - name: {{ include "common.fullname" . }}-logs
74           mountPath: /share/logs
75         - name: {{ include "common.fullname" . }}-logs
76           mountPath: /share/debug-logs
77         - name: {{ include "common.fullname" . }}-config
78           mountPath: /share/etc/config
79         - name: {{ include "common.fullname" . }}-certs
80           mountPath: /share/etc/certs
81         - name: {{ include "common.fullname" . }}-certs
82           mountPath: /opt/app/cmso/src/main/resources/aaf
83         resources:
84 {{ include "common.resources" . | indent 12 }}
85         {{- if .Values.nodeSelector }}
86         nodeSelector:
87 {{ toYaml .Values.nodeSelector | indent 10 }}
88         {{- end -}}
89         {{- if .Values.affinity }}
90         affinity:
91 {{ toYaml .Values.affinity | indent 10 }}
92         {{- end }}
93       volumes:
94         - name: {{ include "common.fullname" . }}-config
95           configMap:
96             name: {{ include "common.fullname" . }}
97             items:
98             - key: logback.xml
99               path: logback.xml
100             - key: ticketmgt.properties
101               path: ticketmgt.properties
102             - key: cadi.properties
103               path: cadi.properties
104         - name:  {{ include "common.fullname" . }}-logs
105           emptyDir: {}
106         - name: {{ include "common.fullname" . }}-certs
107           secret:
108             secretName: {{ include "common.release" . }}-{{ .Values.global.commonConfigPrefix }}-certs
109       imagePullSecrets:
110       - name: "{{ include "common.namespace" . }}-docker-registry-key"