[GENERAL] Use readiness container v3.0.1
[oom.git] / kubernetes / sdnc / components / ueb-listener / templates / deployment.yaml
1 {{/*
2 # Copyright © 2017 Amdocs, Bell Canada
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 */}}
16
17 apiVersion: apps/v1
18 kind: Deployment
19 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
20 spec:
21   selector:
22     matchLabels:
23       app: {{ include "common.name" . }}
24   replicas: {{ .Values.replicaCount }}
25   selector: {{- include "common.selectors" . | nindent 4 }}
26   template:
27     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
28     spec:
29       initContainers:
30       - command:
31         - sh
32         args:
33         - -c
34         - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done"
35         env:
36         - name: SDNC_DB_USER
37           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
38         - name: SDNC_DB_PASSWORD
39           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
40         - name: UEB_USER
41           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ueb-creds" "key" "login") | indent 10 }}
42         - name: UEB_PASSWORD
43           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ueb-creds" "key" "password") | indent 10 }}
44         - name: ODL_USER
45           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 10 }}
46         - name: ODL_PASSWORD
47           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 10 }}
48         volumeMounts:
49         - mountPath: /config-input
50           name: config-input
51         - mountPath: /config
52           name: properties
53         image: "{{ .Values.global.envsubstImage }}"
54         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
55         name: {{ include "common.name" . }}-update-config
56       - command:
57         - /app/ready.py
58         args:
59         - --container-name
60         - {{ include "common.mariadbService" . }}
61         - --container-name
62         - {{ .Values.config.sdncChartName }}
63         - --container-name
64         - {{ .Values.config.sdcbeChartName }}
65         - --container-name
66         - {{ .Values.config.msgRouterContainerName }}
67         env:
68         - name: NAMESPACE
69           valueFrom:
70             fieldRef:
71               apiVersion: v1
72               fieldPath: metadata.namespace
73         image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
74         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
75         name: {{ include "common.name" . }}-readiness
76       containers:
77       - command:
78         - /opt/onap/sdnc/ueb-listener/bin/start-ueb-listener.sh
79         name: {{ include "common.name" . }}
80         image: "{{ include "common.repository" . }}/{{ .Values.image }}"
81         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
82         env:
83         - name: PROPERTY_DIR
84           value: "{{ .Values.config.configDir }}"
85         - name: SDNC_CONFIG_DIR
86           value: "{{ .Values.config.configDir }}"
87         volumeMounts:
88         - mountPath: /etc/localtime
89           name: localtime
90           readOnly: true
91         - mountPath: {{ .Values.config.configDir }}/dblib.properties
92           name: properties
93           subPath: dblib.properties
94         - mountPath: {{ .Values.config.configDir }}/ueb-listener.properties
95           name: properties
96           subPath: ueb-listener.properties
97         resources:
98 {{ include "common.resources" . | indent 12 }}
99         {{- if .Values.nodeSelector }}
100         nodeSelector:
101 {{ toYaml .Values.nodeSelector | indent 10 }}
102         {{- end -}}
103         {{- if .Values.affinity }}
104         affinity:
105 {{ toYaml .Values.affinity | indent 10 }}
106         {{- end }}
107
108       volumes:
109         - name: localtime
110           hostPath:
111             path: /etc/localtime
112         - name: config-input
113           configMap:
114             name: {{ include "common.fullname" . }}
115             defaultMode: 0644
116         - name: properties
117           emptyDir:
118             medium: Memory
119       imagePullSecrets:
120       - name: "{{ include "common.namespace" . }}-docker-registry-key"