[DCAEMOD] Uses new tpls for repos / images
[oom.git] / kubernetes / oof / components / oof-cmso / components / oof-cmso-topology / 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: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}"
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 "common.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: {{ .Values.global.authentication }}
60         command:
61         - /bin/sh
62         args:
63         - "-c"
64         - |
65           export SSL_KEYSTORE_PASSWORD=$(cat /share/etc/osaaf/local/.pass)
66           ./startService.sh
67         ports:
68         - containerPort: {{ .Values.service.internalPort }}
69         # disable liveness probe when breakpoints set in debugger
70         # so K8s doesn't restart unresponsive container
71         {{- if eq .Values.liveness.enabled true }}
72         livenessProbe:
73           tcpSocket:
74             port: {{ .Values.service.internalPort }}
75           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
76           periodSeconds: {{ .Values.liveness.periodSeconds }}
77         {{ end -}}
78         readinessProbe:
79           tcpSocket:
80             port: {{ .Values.service.internalPort }}
81           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
82           periodSeconds: {{ .Values.readiness.periodSeconds }}
83         volumeMounts:
84 {{ include "common.certInitializer.volumeMount" . | indent 8 }}
85         - name: {{ include "common.fullname" . }}-logs
86           mountPath: /share/logs
87         - name: {{ include "common.fullname" . }}-logs
88           mountPath: /share/debug-logs
89         - name: {{ include "common.fullname" . }}-config
90           mountPath: /share/etc/config
91         - name: {{ include "common.fullname" . }}-certs
92           mountPath: /share/etc/certs
93         - name: {{ include "common.fullname" . }}-certs
94           mountPath: /opt/app/cmso/src/main/resources/aaf
95         resources:
96 {{ include "common.resources" . | indent 12 }}
97         {{- if .Values.nodeSelector }}
98         nodeSelector:
99 {{ toYaml .Values.nodeSelector | indent 10 }}
100         {{- end -}}
101         {{- if .Values.affinity }}
102         affinity:
103 {{ toYaml .Values.affinity | indent 10 }}
104         {{- end }}
105       volumes:
106         {{ include "common.certInitializer.volumes" . | nindent 8 }}
107         - name: {{ include "common.fullname" . }}-config
108           configMap:
109             name: {{ include "common.fullname" . }}
110             items:
111             - key: logback.xml
112               path: logback.xml
113             - key: cadi.properties
114               path: cadi.properties
115             - key: topology.properties
116               path: topology.properties
117         - name:  {{ include "common.fullname" . }}-logs
118           emptyDir: {}
119         - name: {{ include "common.fullname" . }}-certs
120           secret:
121             secretName: {{ include "common.release" . }}-{{ .Values.global.commonConfigPrefix }}-certs
122       imagePullSecrets:
123       - name: "{{ include "common.namespace" . }}-docker-registry-key"