Removed use of vfc-redis from etsicatalog component
[oom.git] / kubernetes / oof / charts / oof-cmso / charts / oof-cmso-service / templates / deployment.yaml
1 # Copyright (c) 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       - command:
35         - /root/ready.py
36         args:
37         - --container-name
38         - {{ .Values.mariadb.nameOverride }}
39         env:
40         - name: NAMESPACE
41           valueFrom:
42             fieldRef:
43               apiVersion: v1
44               fieldPath: metadata.namespace
45         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
46         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
47         name: {{ include "common.name" . }}-readiness
48       - name: db-init
49         image: "{{ include "common.repository" . }}/{{ .Values.dbinit.image }}"
50         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
51         env:
52         - name: DB_HOST
53           value: {{ .Values.config.db_host }}.{{.Release.Namespace}}
54         - name: DB_PORT
55           value: {{ .Values.config.db_port | quote}}
56         - name: DB_USERNAME
57           value: {{ .Values.config.db_root }}
58         - name: DB_SCHEMA
59           value: {{ .Values.config.mysqlDatabase }}
60         - name: DB_PASSWORD
61           valueFrom:
62             secretKeyRef:
63               name: {{ include "common.release" . }}-cmso-db
64               key: db-root-password
65         terminationMessagePolicy: File
66         volumeMounts:
67         - name: {{ include "common.fullname" . }}-config
68           mountPath: /share/etc/config
69         - name: {{ include "common.fullname" . }}-logs
70           mountPath: /share/logs
71       containers:
72       # side car containers
73       - name: filebeat-onap
74         image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
75         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
76         volumeMounts:
77         - mountPath: /usr/share/filebeat/filebeat.yml
78           subPath: filebeat.yml
79           name: filebeat-conf
80         - mountPath: /var/log/onap
81           name: {{ include "common.fullname" . }}-logs
82         - mountPath: /usr/share/filebeat/data
83           name: {{ include "common.fullname" . }}-filebeat
84         resources:
85 {{ include "common.resources" . }}
86       - name: mso-simulator
87         image: "{{ include "common.repository" . }}/{{ .Values.robotimage }}"
88         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
89         volumeMounts:
90         - name: {{ include "common.fullname" . }}-config
91           mountPath: /share/etc/config
92         ports:
93         - containerPort: 5000        
94         resources:
95 {{ include "common.resources" . }}
96       - name: {{ include "common.name" . }}
97         image: "{{ include "common.repository" . }}/{{ .Values.image }}"
98         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
99         env:
100         - name: DB_HOST
101           value: {{ .Values.config.db_host }}.{{.Release.Namespace}}
102         - name: DB_PORT
103           value: {{ .Values.config.db_port | quote}}
104         - name: DB_USERNAME
105           value: {{ .Values.config.db_user }}
106         - name: DB_SCHEMA
107           value: {{ .Values.config.mysqlDatabase }}
108         - name: DB_PASSWORD
109           valueFrom:
110             secretKeyRef:
111               name: {{ include "common.release" . }}-cmso-db
112               key: user-password
113         - name: JAVA_TRUSTSTORE
114           value: /share/etc/certs/{{ .Values.global.truststoreFile }}
115         - name: SSL_KEYSTORE
116           value: /share/etc/certs/{{ .Values.global.keystoreFile }}
117         - name: JAVA_TRUSTSTORE_PASSWORD
118           value: {{ .Values.global.truststorePassword }}
119         - name: SSL_KEYSTORE_PASSWORD
120           value: {{ .Values.global.keystorePassword }}
121         - name: AUTHENTICATION
122           value: {{ .Values.global.authentication }}
123         ports:
124         - containerPort: {{ .Values.service.internalPort }}
125         # disable liveness probe when breakpoints set in debugger
126         # so K8s doesn't restart unresponsive container
127         {{- if eq .Values.liveness.enabled true }}
128         livenessProbe:
129           tcpSocket:
130             port: {{ .Values.service.internalPort }}
131           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
132           periodSeconds: {{ .Values.liveness.periodSeconds }}
133         {{ end -}}
134         readinessProbe:
135           tcpSocket:
136             port: {{ .Values.service.internalPort }}
137           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
138           periodSeconds: {{ .Values.readiness.periodSeconds }}
139         volumeMounts:
140         - name: {{ include "common.fullname" . }}-logs
141           mountPath: /share/logs
142         - name: {{ include "common.fullname" . }}-logs
143           mountPath: /share/debug-logs
144         - name: {{ include "common.fullname" . }}-config
145           mountPath: /share/etc/config
146         - name: {{ include "common.fullname" . }}-certs
147           mountPath: /share/etc/certs
148         - name: {{ include "common.fullname" . }}-certs
149           mountPath: /opt/app/cmso/src/main/resources/aaf
150         resources:
151 {{ include "common.resources" . | indent 12 }}
152         {{- if .Values.nodeSelector }}
153         nodeSelector:
154 {{ toYaml .Values.nodeSelector | indent 10 }}
155         {{- end -}}
156         {{- if .Values.affinity }}
157         affinity:
158 {{ toYaml .Values.affinity | indent 10 }}
159         {{- end }}
160       volumes:
161         - name: {{ include "common.fullname" . }}-config
162           configMap:
163             name: {{ include "common.fullname" . }}
164             items:
165             - key: logback.xml
166               path: logback.xml
167             - key: cmso.properties
168               path: cmso.properties
169             - key: cadi.properties
170               path: cadi.properties
171             - key: optimizer.properties
172               path: optimizer.properties
173             - key: ticketmgt.properties
174               path: ticketmgt.properties
175             - key: liquibase.properties
176               path: liquibase.properties
177         - name:  {{ include "common.fullname" . }}-logs
178           emptyDir: {}
179         - name: {{ include "common.fullname" . }}-filebeat
180           emptyDir: {}
181         - name: filebeat-conf
182           configMap:
183             name: {{ include "common.release" . }}-cmso-filebeat-configmap
184         - name: {{ include "common.fullname" . }}-certs
185           secret:
186             secretName: {{ include "common.release" . }}-{{ .Values.global.commonConfigPrefix }}-certs
187       imagePullSecrets:
188       - name: "{{ include "common.namespace" . }}-docker-registry-key"