[GENERAL] Use readiness container v3.0.1
[oom.git] / kubernetes / dcaegen2 / components / dcae-bootstrap / templates / deployment.yaml
1 #============LICENSE_START========================================================
2 # ================================================================================
3 # Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved.
4 # Modifications Copyright © 2018 Amdocs, Bell Canada
5 # ================================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #     http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 # ============LICENSE_END=========================================================
18
19 apiVersion: apps/v1
20 kind: Deployment
21 metadata:
22   name: {{ include "common.fullname" . }}
23   namespace: {{ include "common.namespace" . }}
24   labels:
25     app: {{ include "common.name" . }}
26     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
27     release: {{ include "common.release" . }}
28     heritage: {{ .Release.Service }}
29 spec:
30   replicas: 1
31   selector:
32     matchLabels:
33       app: {{ include "common.name" . }}
34   template:
35     metadata:
36       labels:
37         app: {{ include "common.name" . }}
38         release: {{ include "common.release" . }}
39     spec:
40       initContainers:
41       - command:
42         - sh
43         args:
44         - -c
45         - "cd /config-input && for PFILE in `find . -not -type d | grep -v -F ..`; do envsubst <${PFILE} >/config/${PFILE}; done"
46         env:
47         - name: PG_ROOT_PASSWORD
48           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-root-pass" "key" "password") | indent 10 }}
49         volumeMounts:
50         - mountPath: /config-input
51           name: {{ include "common.fullname" . }}-dcae-inputs-input
52         - mountPath: /config
53           name: {{ include "common.fullname" . }}-dcae-inputs
54         image: "{{ .Values.global.envsubstImage }}"
55         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
56         name: {{ include "common.name" . }}-update-config
57
58       - name: {{ include "common.name" . }}-readiness
59         image: {{ include "common.repository" . }}/{{ .Values.global.readinessImage }}
60         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
61         command:
62           - /app/ready.py
63         args:
64           - --container-name
65           - dcae-cloudify-manager
66           - --container-name
67           - consul-server
68           - --container-name
69           - msb-discovery
70           - --container-name
71           - kube2msb
72           - --container-name
73           - dcae-config-binding-service
74           - --container-name
75           - dcae-db
76           - --container-name
77           - dcae-inventory-api
78           - "-t"
79           - "15"
80         env:
81         - name: NAMESPACE
82           valueFrom:
83             fieldRef:
84               apiVersion: v1
85               fieldPath: metadata.namespace
86       - name: init-tls
87         env:
88         - name: POD_IP
89           valueFrom:
90             fieldRef:
91               apiVersion: v1
92               fieldPath: status.podIP
93         - name: aaf_locator_fqdn
94           value: dcae
95         image: {{ .Values.global.tlsRepository }}/{{ .Values.global.tlsImage }}
96         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
97         resources: {}
98         volumeMounts:
99         - mountPath: /opt/app/osaaf
100           name: tls-info
101       - name: init-consul
102         image: {{ .Values.global.consulLoaderRepository }}/{{ .Values.global.consulLoaderImage }}
103         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
104         args:
105         - --service
106         - "config-binding-service|config-binding-service.{{ include "common.namespace" . }}|10000"
107         - --service
108         - "config_binding_service|config-binding-service.{{ include "common.namespace" . }}|10000"
109         resources: {}
110       containers:
111         - name: {{ include "common.name" . }}
112           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
113           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
114           resources:
115 {{ include "common.resources" . | indent 12 }}
116           volumeMounts:
117             - mountPath: /inputs
118               name: {{ include "common.fullname" . }}-dcae-inputs
119             - mountPath: /dcae-configs
120               name: {{ include "common.fullname" . }}-dcae-config
121             - mountPath: /etc/localtime
122               name: localtime
123               readOnly: true
124             - mountPath: /certs
125               name: tls-info
126               readOnly: true
127           env:
128             - name: CMADDR
129               value: {{ .Values.config.address.cm.host }}
130             - name: CMPASS
131               valueFrom:
132                 secretKeyRef:
133                   name: {{ include "common.name" . }}-cmpass
134                   key: password
135             - name: CMPROTO
136               value: {{ .Values.config.address.cm.proto }}
137             - name: CMPORT
138               value: !!string {{ .Values.config.address.cm.port }}
139             - name: CONSUL
140               value: {{ .Values.config.address.consul.host }}:{{ .Values.config.address.consul.port }}
141             - name: DCAE_NAMESPACE
142               value: {{ .Values.dcae_ns | default "" }}
143             - name: ONAP_NAMESPACE
144               value: {{ include "common.namespace" . }}
145       volumes:
146         - name: {{ include "common.fullname" . }}-dcae-inputs-input
147           configMap:
148             name: {{ include "common.fullname" . }}-dcae-inputs
149         - name: {{ include "common.fullname" . }}-dcae-inputs
150           emptyDir:
151             medium: Memory
152         - name: {{ include "common.fullname" . }}-dcae-config
153           configMap:
154             name: {{ include "common.fullname" . }}-dcae-config
155         - name: localtime
156           hostPath:
157             path: /etc/localtime
158         - name: tls-info
159           emptyDir: {}
160       imagePullSecrets:
161         - name: "{{ include "common.namespace" . }}-docker-registry-key"