[DCAE][DCAEMOD] Deploy R7 container images
[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: extensions/v1beta1
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   template:
32     metadata:
33       labels:
34         app: {{ include "common.name" . }}
35         release: {{ include "common.release" . }}
36     spec:
37       initContainers:
38       - command:
39         - sh
40         args:
41         - -c
42         - "cd /config-input && for PFILE in `find . -not -type d | grep -v -F ..`; do envsubst <${PFILE} >/config/${PFILE}; done"
43         env:
44         - name: PG_ROOT_PASSWORD
45           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-root-pass" "key" "password") | indent 10 }}
46         volumeMounts:
47         - mountPath: /config-input
48           name: {{ include "common.fullname" . }}-dcae-inputs-input
49         - mountPath: /config
50           name: {{ include "common.fullname" . }}-dcae-inputs
51         image: "{{ .Values.global.envsubstImage }}"
52         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
53         name: {{ include "common.name" . }}-update-config
54
55       - name: {{ include "common.name" . }}-readiness
56         image: {{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}
57         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
58         command:
59           - /root/ready.py
60         args:
61           - --container-name
62           - dcae-cloudify-manager
63           - --container-name
64           - consul-server
65           - --container-name
66           - msb-discovery
67           - --container-name
68           - kube2msb
69           - --container-name
70           - dcae-config-binding-service
71           - --container-name
72           - dcae-db
73           - --container-name
74           - dcae-inventory-api
75           - "-t"
76           - "15"
77         env:
78         - name: NAMESPACE
79           valueFrom:
80             fieldRef:
81               apiVersion: v1
82               fieldPath: metadata.namespace
83       - name: init-tls
84         env:
85         - name: POD_IP
86           valueFrom:
87             fieldRef:
88               apiVersion: v1
89               fieldPath: status.podIP
90         - name: aaf_locator_fqdn
91           value: dcae
92         image: {{ .Values.global.tlsRepository }}/{{ .Values.global.tlsImage }}
93         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
94         resources: {}
95         volumeMounts:
96         - mountPath: /opt/app/osaaf
97           name: tls-info
98       - name: init-consul
99         image: {{ .Values.global.consulLoaderRepository }}/{{ .Values.global.consulLoaderImage }}
100         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
101         args:
102         - --service
103         - "config-binding-service|config-binding-service.{{ include "common.namespace" . }}|10000"
104         - --service
105         - "config_binding_service|config-binding-service.{{ include "common.namespace" . }}|10000"
106         resources: {}
107       containers:
108         - name: {{ include "common.name" . }}
109           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
110           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
111           resources:
112 {{ include "common.resources" . | indent 12 }}
113           volumeMounts:
114             - mountPath: /inputs
115               name: {{ include "common.fullname" . }}-dcae-inputs
116             - mountPath: /dcae-configs
117               name: {{ include "common.fullname" . }}-dcae-config
118             - mountPath: /etc/localtime
119               name: localtime
120               readOnly: true
121             - mountPath: /certs
122               name: tls-info
123               readOnly: true
124           env:
125             - name: CMADDR
126               value: {{ .Values.config.address.cm.host }}
127             - name: CMPASS
128               valueFrom:
129                 secretKeyRef:
130                   name: {{ include "common.name" . }}-cmpass
131                   key: password
132             - name: CMPROTO
133               value: {{ .Values.config.address.cm.proto }}
134             - name: CMPORT
135               value: !!string {{ .Values.config.address.cm.port }}
136             - name: CONSUL
137               value: {{ .Values.config.address.consul.host }}:{{ .Values.config.address.consul.port }}
138             - name: DCAE_NAMESPACE
139               value: {{ .Values.dcae_ns | default "" }}
140             - name: ONAP_NAMESPACE
141               value: {{ include "common.namespace" . }}
142       volumes:
143         - name: {{ include "common.fullname" . }}-dcae-inputs-input
144           configMap:
145             name: {{ include "common.fullname" . }}-dcae-inputs
146         - name: {{ include "common.fullname" . }}-dcae-inputs
147           emptyDir:
148             medium: Memory
149         - name: {{ include "common.fullname" . }}-dcae-config
150           configMap:
151             name: {{ include "common.fullname" . }}-dcae-config
152         - name: localtime
153           hostPath:
154             path: /etc/localtime
155         - name: tls-info
156           emptyDir: {}
157       imagePullSecrets:
158         - name: "{{ include "common.namespace" . }}-docker-registry-key"