Remove unneded LoadBalancer annotation
[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.config.db.container }}
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.db.mysqlDatabase }}
60         - name: DB_PASSWORD
61           {{- include "common.secret.envFromSecret" (dict "global" . "uid" "cmso-db-root-password" "key" "password") | indent 10}}
62         terminationMessagePolicy: File
63         volumeMounts:
64         - name: {{ include "common.fullname" . }}-config
65           mountPath: /share/etc/config
66         - name: {{ include "common.fullname" . }}-logs
67           mountPath: /share/logs
68       containers:
69       # side car containers
70       - name: filebeat-onap
71         image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
72         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
73         volumeMounts:
74         - mountPath: /usr/share/filebeat/filebeat.yml
75           subPath: filebeat.yml
76           name: filebeat-conf
77         - mountPath: /var/log/onap
78           name: {{ include "common.fullname" . }}-logs
79         - mountPath: /usr/share/filebeat/data
80           name: {{ include "common.fullname" . }}-filebeat
81         resources:
82 {{ include "common.resources" . }}
83       - name: mso-simulator
84         image: "{{ include "common.repository" . }}/{{ .Values.robotimage }}"
85         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
86         volumeMounts:
87         - name: {{ include "common.fullname" . }}-config
88           mountPath: /share/etc/config
89         ports:
90         - containerPort: 5000
91         resources:
92 {{ include "common.resources" . }}
93       - name: {{ include "common.name" . }}
94         image: "{{ include "common.repository" . }}/{{ .Values.image }}"
95         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
96         env:
97         - name: DB_HOST
98           value: {{ .Values.config.db.host }}.{{.Release.Namespace}}
99         - name: DB_PORT
100           value: {{ .Values.config.db.port | quote}}
101         - name: DB_USERNAME
102           {{- include "common.secret.envFromSecret" (dict "global" . "uid" "cmso-db-user-secret" "key" "login") | indent 10}}
103         - name: DB_SCHEMA
104           value: {{ .Values.config.db.mysqlDatabase }}
105         - name: DB_PASSWORD
106           {{- include "common.secret.envFromSecret" (dict "global" . "uid" "cmso-db-user-secret" "key" "password") | indent 10}}
107         - name: JAVA_TRUSTSTORE
108           value: /share/etc/certs/{{ .Values.global.truststoreFile }}
109         - name: SSL_KEYSTORE
110           value: /share/etc/certs/{{ .Values.global.keystoreFile }}
111         - name: JAVA_TRUSTSTORE_PASSWORD
112           value: {{ .Values.global.truststorePassword }}
113         - name: SSL_KEYSTORE_PASSWORD
114           value: {{ .Values.global.keystorePassword }}
115         - name: AUTHENTICATION
116           value: {{ .Values.global.authentication }}
117         ports:
118         - containerPort: {{ .Values.service.internalPort }}
119         # disable liveness probe when breakpoints set in debugger
120         # so K8s doesn't restart unresponsive container
121         {{- if eq .Values.liveness.enabled true }}
122         livenessProbe:
123           tcpSocket:
124             port: {{ .Values.service.internalPort }}
125           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
126           periodSeconds: {{ .Values.liveness.periodSeconds }}
127         {{ end -}}
128         readinessProbe:
129           tcpSocket:
130             port: {{ .Values.service.internalPort }}
131           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
132           periodSeconds: {{ .Values.readiness.periodSeconds }}
133         volumeMounts:
134         - name: {{ include "common.fullname" . }}-logs
135           mountPath: /share/logs
136         - name: {{ include "common.fullname" . }}-logs
137           mountPath: /share/debug-logs
138         - name: {{ include "common.fullname" . }}-config
139           mountPath: /share/etc/config
140         - name: {{ include "common.fullname" . }}-certs
141           mountPath: /share/etc/certs
142         - name: {{ include "common.fullname" . }}-certs
143           mountPath: /opt/app/cmso/src/main/resources/aaf
144         resources:
145 {{ include "common.resources" . | indent 12 }}
146         {{- if .Values.nodeSelector }}
147         nodeSelector:
148 {{ toYaml .Values.nodeSelector | indent 10 }}
149         {{- end -}}
150         {{- if .Values.affinity }}
151         affinity:
152 {{ toYaml .Values.affinity | indent 10 }}
153         {{- end }}
154       volumes:
155         - name: {{ include "common.fullname" . }}-config
156           configMap:
157             name: {{ include "common.fullname" . }}
158             items:
159             - key: logback.xml
160               path: logback.xml
161             - key: cmso.properties
162               path: cmso.properties
163             - key: cadi.properties
164               path: cadi.properties
165             - key: optimizer.properties
166               path: optimizer.properties
167             - key: ticketmgt.properties
168               path: ticketmgt.properties
169             - key: liquibase.properties
170               path: liquibase.properties
171         - name:  {{ include "common.fullname" . }}-logs
172           emptyDir: {}
173         - name: {{ include "common.fullname" . }}-filebeat
174           emptyDir: {}
175         - name: filebeat-conf
176           configMap:
177             name: {{ include "common.release" . }}-cmso-filebeat-configmap
178         - name: {{ include "common.fullname" . }}-certs
179           secret:
180             secretName: {{ include "common.release" . }}-{{ .Values.global.commonConfigPrefix }}-certs
181       imagePullSecrets:
182       - name: "{{ include "common.namespace" . }}-docker-registry-key"