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