Pick up new tls init container
[oom.git] / kubernetes / dcaegen2 / components / dcae-dashboard / templates / deployment.yaml
1 #============LICENSE_START========================================================
2 # ================================================================================
3 # Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
4 # ================================================================================
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #     http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 # ============LICENSE_END=========================================================
17
18 apiVersion: extensions/v1beta1
19 kind: Deployment
20 metadata:
21   name: {{ include "common.fullname" . }}
22   namespace: {{ include "common.namespace" . }}
23   labels:
24     app: {{ include "common.name" . }}
25     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
26     release: {{ include "common.release" . }}
27     heritage: {{ .Release.Service }}
28 spec:
29   replicas: 1
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" . }}-readiness
38           image: {{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}
39           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
40           command:
41             - /root/ready.py
42           args:
43           - --container-name
44           - dcae-cloudify-manager
45           - --container-name
46           - consul-server
47           - --container-name
48           - dcae-inventory-api
49           - --container-name
50           - dcae-deployment-handler
51           - --container-name
52           - {{ .Values.postgres.nameOverride }}
53           - "-t"
54           - "45"
55           env:
56           - name: NAMESPACE
57             valueFrom:
58               fieldRef:
59                 apiVersion: v1
60                 fieldPath: metadata.namespace
61         - name: init-tls
62           env:
63           - name: POD_IP
64             valueFrom:
65               fieldRef:
66                 apiVersion: v1
67                 fieldPath: status.podIP
68           - name: aaf_locator_fqdn
69             value: dcae
70           image: {{ .Values.global.tlsRepository }}/{{ .Values.global.tlsImage }}
71           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
72           resources: {}
73           volumeMounts:
74             - mountPath: /opt/app/osaaf
75               name: tls-info
76       containers:
77         - name: {{ include "common.name" . }}
78           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
79           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
80           resources:
81 {{ include "common.resources" . | indent 12 }}
82           ports:
83           - containerPort: {{ .Values.service.internalPort }}
84             protocol: TCP
85           # disable liveness probe when breakpoints set in debugger
86           # so K8s doesn't restart unresponsive container
87           {{- if eq .Values.liveness.enabled true }}
88           livenessProbe:
89             tcpSocket:
90               port: {{ .Values.service.internalPort }}
91             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
92             periodSeconds: {{ .Values.liveness.periodSeconds }}
93           {{ end }}
94           readinessProbe:
95             httpGet:
96               path: {{ .Values.readiness.path }}
97               port: {{ .Values.service.internalPort }}
98               scheme: {{ .Values.readiness.scheme }}
99             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
100             periodSeconds: {{ .Values.readiness.periodSeconds }}
101             failureThreshold: 1
102             successThreshold: 1
103             timeoutSeconds: 1
104           volumeMounts:
105             - mountPath: /usr/local/share/ca-certificates/
106               name: tls-info
107           env:
108             - name: CONSUL_HOST
109               value: consul-server.{{ include "common.namespace" . }}
110             - name: CONFIG_BINDING_SERVICE
111               value: config-binding-service
112             - name: inventory_url
113               value: {{ .Values.config.inventory_url }}
114             - name: postgres_port
115               value: "{{ .Values.postgres.config.pgPort }}"
116             - name: cloudify_password
117               value: admin
118             - name: dhandler_url
119               value: {{ .Values.config.dhandler_url }}
120             - name: cfy_url
121               value: {{ .Values.config.cfy_url }}
122             - name: cloudify_user
123               value: admin
124             - name: consul_url
125               value: http://consul-server-ui:8500
126             - name: postgres_user_dashboard
127               value: {{ .Values.postgres.config.pgUserName }}
128             - name: postgres_db_name
129               value: {{ .Values.postgres.config.pgDatabase }}
130             - name: postgres_password_dashboard
131               value: {{ .Values.postgres.config.pgUserPassword }}
132             - name: postgres_ip
133               value: {{ .Values.postgres.service.name2 }}
134             - name: POD_IP
135               valueFrom:
136                 fieldRef:
137                   apiVersion: v1
138                   fieldPath: status.podIP
139         - name: {{ include "common.name" . }}-filebeat
140           env:
141             - name: POD_IP
142               valueFrom:
143                 fieldRef:
144                   apiVersion: v1
145                   fieldPath: status.podIP
146           image: {{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}
147           imagePullPolicy: IfNotPresent
148           resources: {}
149           volumeMounts:
150           - mountPath: /var/log/onap/dashboard
151             name: component-log
152           - mountPath: /usr/share/filebeat/data
153             name: filebeat-data
154           - mountPath: /usr/share/filebeat/filebeat.yml
155             name: filebeat-conf
156             subPath: filebeat.yml
157       volumes:
158         - emptyDir: {}
159           name: component-log
160         - emptyDir: {}
161           name: filebeat-data
162         - configMap:
163             defaultMode: 420
164             name: {{ include "common.fullname" . }}-filebeat-configmap
165           name: filebeat-conf
166         - emptyDir: {}
167           name: tls-info
168       imagePullSecrets:
169       - name: "{{ include "common.namespace" . }}-docker-registry-key"
170