Merge "Migrate oom docs"
[oom.git] / kubernetes / sdnc / charts / 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: extensions/v1beta1
18 kind: Deployment
19 metadata:
20   name: {{ include "common.fullname" . }}
21   namespace: {{ include "common.namespace" . }}
22   labels:
23     app: {{ include "common.name" . }}
24     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
25     release: {{ include "common.release" . }}
26     heritage: {{ .Release.Service }}
27 spec:
28   replicas: {{ .Values.replicaCount }}
29   template:
30     metadata:
31       labels:
32         app: {{ include "common.name" . }}
33         release: {{ include "common.release" . }}
34     spec:
35       initContainers:
36       - command:
37         - sh
38         args:
39         - -c
40         - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done"
41         env:
42         - name: SDNC_DB_USER
43           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
44         - name: SDNC_DB_PASSWORD
45           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
46         - name: UEB_USER
47           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ueb-creds" "key" "login") | indent 10 }}
48         - name: UEB_PASSWORD
49           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ueb-creds" "key" "password") | indent 10 }}
50         - name: ODL_USER
51           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 10 }}
52         - name: ODL_PASSWORD
53           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 10 }}
54         volumeMounts:
55         - mountPath: /config-input
56           name: config-input
57         - mountPath: /config
58           name: properties
59         image: "{{ .Values.global.envsubstImage }}"
60         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
61         name: {{ include "common.name" . }}-update-config
62       - command:
63         - /root/ready.py
64         args:
65         - --container-name
66         - {{ include "common.mariadbService" . }}
67         - --container-name
68         - {{ .Values.config.sdncChartName }}
69         - --container-name
70         - {{ .Values.config.sdcbeChartName }}
71         - --container-name
72         - {{ .Values.config.msgRouterContainerName }}
73         env:
74         - name: NAMESPACE
75           valueFrom:
76             fieldRef:
77               apiVersion: v1
78               fieldPath: metadata.namespace
79         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
80         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
81         name: {{ include "common.name" . }}-readiness
82       containers:
83       - command:
84         - /opt/onap/sdnc/ueb-listener/bin/start-ueb-listener.sh
85         name: {{ include "common.name" . }}
86         image: "{{ include "common.repository" . }}/{{ .Values.image }}"
87         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
88         env:
89         - name: PROPERTY_DIR
90           value: "{{ .Values.config.configDir }}"
91         - name: SDNC_CONFIG_DIR
92           value: "{{ .Values.config.configDir }}"
93         volumeMounts:
94         - mountPath: /etc/localtime
95           name: localtime
96           readOnly: true
97         - mountPath: {{ .Values.config.configDir }}/dblib.properties
98           name: properties
99           subPath: dblib.properties
100         - mountPath: {{ .Values.config.configDir }}/ueb-listener.properties
101           name: properties
102           subPath: ueb-listener.properties
103         resources:
104 {{ include "common.resources" . | indent 12 }}
105         {{- if .Values.nodeSelector }}
106         nodeSelector:
107 {{ toYaml .Values.nodeSelector | indent 10 }}
108         {{- end -}}
109         {{- if .Values.affinity }}
110         affinity:
111 {{ toYaml .Values.affinity | indent 10 }}
112         {{- end }}
113
114       volumes:
115         - name: localtime
116           hostPath:
117             path: /etc/localtime
118         - name: config-input
119           configMap:
120             name: {{ include "common.fullname" . }}
121             defaultMode: 0644
122         - name: properties
123           emptyDir:
124             medium: Memory
125       imagePullSecrets:
126       - name: "{{ include "common.namespace" . }}-docker-registry-key"