[DCAE][DCAEMOD] Deploy R7 container images
[oom.git] / kubernetes / dcaegen2 / components / dcae-config-binding-service / 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             - consul-server
45             - --container-name
46             - aaf-cm
47             - "-t"
48             - "15"
49           env:
50           - name: NAMESPACE
51             valueFrom:
52               fieldRef:
53                 apiVersion: v1
54                 fieldPath: metadata.namespace
55           - name: aaf_locator_fqdn
56             value: dcae
57         {{- if .Values.service.secure.enabled }}
58         - name: init-tls
59           env:
60           - name: POD_IP
61             valueFrom:
62               fieldRef:
63                 apiVersion: v1
64                 fieldPath: status.podIP
65           image: {{ .Values.global.tlsRepository }}/{{ .Values.global.tlsImage }}
66           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
67           resources: {}
68           volumeMounts:
69             - mountPath: /opt/app/osaaf
70               name: tls-info
71         {{ end  }}
72       containers:
73         {{- if .Values.service.secure.enabled }}
74         - name: {{ include "common.name" . }}
75           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
76           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
77           resources:
78 {{ include "common.resources" . | indent 12 }}
79           ports:
80           - containerPort: {{ .Values.service.secure.internalPort }}
81           # disable liveness probe when breakpoints set in debugger
82           # so K8s doesn't restart unresponsive container
83           {{- if eq .Values.liveness.enabled true }}
84           livenessProbe:
85             tcpSocket:
86               port: {{ .Values.service.secure.internalPort }}
87             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
88             periodSeconds: {{ .Values.liveness.periodSeconds }}
89           {{ end -}}
90           readinessProbe:
91             httpGet:
92               scheme: "HTTPS"
93               path: {{ .Values.readiness.path }}
94               port: {{ .Values.service.secure.internalPort }}
95             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
96             periodSeconds: {{ .Values.readiness.periodSeconds }}
97           volumeMounts:
98           - name: {{ include "common.fullname" . }}-logs
99             mountPath: /opt/logs
100           - name: tls-info
101             mountPath: /opt/tls
102           env:
103             - name: CONSUL_HOST
104               value: consul.{{ include "common.namespace" . }}
105             - name: USE_HTTPS
106               value: "1"
107             - name: HTTPS_CERT_PATH
108               value: "/opt/tls/cert.pem"
109             - name: HTTPS_KEY_PATH
110               value: "/opt/tls/key.pem"
111         - name: {{ include "common.name" . }}-fb-onap
112           image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
113           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
114           volumeMounts:
115           - name: {{ include "common.fullname" . }}-fb-conf
116             mountPath: /usr/share/filebeat/filebeat.yml
117             subPath: filebeat.yml
118           - name: {{ include "common.fullname" . }}-data-fb
119             mountPath: /usr/share/filebeat/data
120           - name: {{ include "common.fullname" . }}-logs
121             mountPath: /var/log/onap/config-binding-service
122         {{ end }}
123         {{- if .Values.service.insecure.enabled }}
124         - name: {{ include "common.name" . }}-insecure
125           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
126           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
127           resources:
128 {{ include "common.resources" . | indent 12 }}
129           ports:
130           - containerPort: {{ .Values.service.insecure.internalPort }}
131           # disable liveness probe when breakpoints set in debugger
132           # so K8s doesn't restart unresponsive container
133           {{- if eq .Values.liveness.enabled true }}
134           livenessProbe:
135             tcpSocket:
136               port: {{ .Values.service.insecure.internalPort }}
137             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
138             periodSeconds: {{ .Values.liveness.periodSeconds }}
139           {{ end -}}
140           readinessProbe:
141             httpGet:
142               scheme: "HTTP"
143               path: {{ .Values.readiness.path }}
144               port: {{ .Values.service.insecure.internalPort }}
145             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
146             periodSeconds: {{ .Values.readiness.periodSeconds }}
147           volumeMounts:
148           - name: {{ include "common.fullname" . }}-logs-i
149             mountPath: /opt/logs
150           env:
151             - name: CONSUL_HOST
152               value: consul.{{ include "common.namespace" . }}
153         - name: {{ include "common.name" . }}-fb-onap-i
154           image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
155           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
156           volumeMounts:
157           - name: {{ include "common.fullname" . }}-fb-conf
158             mountPath: /usr/share/filebeat/filebeat.yml
159             subPath: filebeat.yml
160           - name: {{ include "common.fullname" . }}-data-fb-i
161             mountPath: /usr/share/filebeat/data
162           - name: {{ include "common.fullname" . }}-logs-i
163             mountPath: /var/log/onap/config-binding-service
164         {{ end }}
165       volumes:
166         - name: {{ include "common.fullname" . }}-fb-conf
167           configMap:
168             name: {{ include "common.release" . }}-cbs-filebeat-configmap
169         {{- if .Values.service.secure.enabled }}
170         - name: {{ include "common.fullname" . }}-data-fb
171           emptyDir: {}
172         - name:  {{ include "common.fullname" . }}-logs
173           emptyDir: {}
174         - name: tls-info
175           emptyDir: {}
176         {{ end }}
177         {{- if .Values.service.insecure.enabled }}
178         - name: {{ include "common.fullname" . }}-data-fb-i
179           emptyDir: {}
180         - name:  {{ include "common.fullname" . }}-logs-i
181           emptyDir: {}
182         {{ end }}
183
184       imagePullSecrets:
185       - name: "{{ include "common.namespace" . }}-docker-registry-key"