Merge "Unable to boot SNDC pod without AAF"
[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: 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       containers:
45       - name: {{ include "common.name" . }}
46         image: "{{ include "common.repository" . }}/{{ .Values.image }}"
47         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
48         env:
49         - name: JAVA_TRUSTSTORE
50           value: /share/etc/certs/{{ .Values.global.truststoreFile }}
51         - name: SSL_KEYSTORE
52           value: /share/etc/certs/{{ .Values.global.keystoreFile }}
53         - name: JAVA_TRUSTSTORE_PASSWORD
54           value: {{ .Values.global.truststorePassword }}
55         - name: SSL_KEYSTORE_PASSWORD
56           value: {{ .Values.global.keystorePassword }}
57         - name: AUTHENTICATION
58           value: proprietary-auth
59         ports:
60         - containerPort: {{ .Values.service.internalPort }}
61         # disable liveness probe when breakpoints set in debugger
62         # so K8s doesn't restart unresponsive container
63         {{- if eq .Values.liveness.enabled true }}
64         livenessProbe:
65           tcpSocket:
66             port: {{ .Values.service.internalPort }}
67           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
68           periodSeconds: {{ .Values.liveness.periodSeconds }}
69         {{ end -}}
70         readinessProbe:
71           tcpSocket:
72             port: {{ .Values.service.internalPort }}
73           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
74           periodSeconds: {{ .Values.readiness.periodSeconds }}
75         volumeMounts:
76         - name: {{ include "common.fullname" . }}-logs
77           mountPath: /share/logs
78         - name: {{ include "common.fullname" . }}-logs
79           mountPath: /share/debug-logs
80         - name: {{ include "common.fullname" . }}-config
81           mountPath: /share/etc/config
82         - name: {{ include "common.fullname" . }}-certs
83           mountPath: /share/etc/certs
84         - name: {{ include "common.fullname" . }}-certs
85           mountPath: /opt/app/cmso/src/main/resources/aaf
86         resources:
87 {{ include "common.resources" . | indent 12 }}
88         {{- if .Values.nodeSelector }}
89         nodeSelector:
90 {{ toYaml .Values.nodeSelector | indent 10 }}
91         {{- end -}}
92         {{- if .Values.affinity }}
93         affinity:
94 {{ toYaml .Values.affinity | indent 10 }}
95         {{- end }}
96       volumes:
97         - name: {{ include "common.fullname" . }}-config
98           configMap:
99             name: {{ include "common.fullname" . }}
100             items:
101             - key: logback.xml
102               path: logback.xml
103             - key: ticketmgt.properties
104               path: ticketmgt.properties
105             - key: cadi.properties
106               path: cadi.properties
107         - name:  {{ include "common.fullname" . }}-logs
108           emptyDir: {}
109         - name: {{ include "common.fullname" . }}-certs
110           secret:
111             secretName: {{ include "common.release" . }}-{{ .Values.global.commonConfigPrefix }}-certs
112       imagePullSecrets:
113       - name: "{{ include "common.namespace" . }}-docker-registry-key"