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