[CONSUL] Add limits to consul chart.
[oom.git] / kubernetes / oof / components / oof-cmso / components / 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: apps/v1
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   selector:
27     matchLabels:
28       app: {{ include "common.name" . }}
29   replicas: {{ .Values.replicaCount }}
30   template:
31     metadata:
32       labels:
33         app: {{ include "common.name" . }}
34         release: {{ include "common.release" . }}
35     spec:
36       initContainers:
37       - name: {{ include "common.name" . }}-chown
38         command: ["/bin/sh", "-c", "chown -Rf 1000:1000 /share/"]
39         image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}"
40         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
41         volumeMounts:
42           - name: {{ include "common.fullname" . }}-logs
43             mountPath: /share/logs
44 {{ include "common.certInitializer.initContainer" . | indent 6 }}
45       containers:
46       - name: {{ include "common.name" . }}
47         image: "{{ include "common.repository" . }}/{{ .Values.image }}"
48         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
49         env:
50         - name: JAVA_TRUSTSTORE
51           value: /share/etc/osaaf/local/{{ .Values.global.truststoreFile }}
52         - name: SSL_KEYSTORE
53           value: /share/etc/osaaf/local/{{ .Values.global.keystoreFile }}
54         - name: JAVA_TRUSTSTORE_PASSWORD
55           value: {{ .Values.global.truststorePassword }}
56         - name: AUTHENTICATION
57           value: proprietary-auth
58         command:
59         - /bin/sh
60         args:
61         - "-c"
62         - |
63           export SSL_KEYSTORE_PASSWORD=$(cat /share/etc/osaaf/local/.pass)
64           ./startService.sh
65         ports:
66         - containerPort: {{ .Values.service.internalPort }}
67         # disable liveness probe when breakpoints set in debugger
68         # so K8s doesn't restart unresponsive container
69         {{- if eq .Values.liveness.enabled true }}
70         livenessProbe:
71           tcpSocket:
72             port: {{ .Values.service.internalPort }}
73           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
74           periodSeconds: {{ .Values.liveness.periodSeconds }}
75         {{ end -}}
76         readinessProbe:
77           tcpSocket:
78             port: {{ .Values.service.internalPort }}
79           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
80           periodSeconds: {{ .Values.readiness.periodSeconds }}
81         volumeMounts:
82 {{ include "common.certInitializer.volumeMount" . | indent 8 }}
83         - name: {{ include "common.fullname" . }}-logs
84           mountPath: /share/logs
85         - name: {{ include "common.fullname" . }}-logs
86           mountPath: /share/debug-logs
87         - name: {{ include "common.fullname" . }}-config
88           mountPath: /share/etc/config
89         - name: {{ include "common.fullname" . }}-certs
90           mountPath: /share/etc/certs
91         - name: {{ include "common.fullname" . }}-certs
92           mountPath: /opt/app/cmso/src/main/resources/aaf
93         resources:
94 {{ include "common.resources" . | indent 12 }}
95         {{- if .Values.nodeSelector }}
96         nodeSelector:
97 {{ toYaml .Values.nodeSelector | indent 10 }}
98         {{- end -}}
99         {{- if .Values.affinity }}
100         affinity:
101 {{ toYaml .Values.affinity | indent 10 }}
102         {{- end }}
103       volumes:
104         {{ include "common.certInitializer.volumes" . | nindent 8 }}
105         - name: {{ include "common.fullname" . }}-config
106           configMap:
107             name: {{ include "common.fullname" . }}
108             items:
109             - key: logback.xml
110               path: logback.xml
111             - key: ticketmgt.properties
112               path: ticketmgt.properties
113             - key: cadi.properties
114               path: cadi.properties
115         - name:  {{ include "common.fullname" . }}-logs
116           emptyDir: {}
117         - name: {{ include "common.fullname" . }}-certs
118           secret:
119             secretName: {{ include "common.release" . }}-{{ .Values.global.commonConfigPrefix }}-certs
120       imagePullSecrets:
121       - name: "{{ include "common.namespace" . }}-docker-registry-key"