Merge "[AAI] Add model-loader tracing config"
[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   replicas: {{ .Values.replicaCount }}
22   selector: {{- include "common.selectors" . | nindent 4 }}
23   template:
24     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
25     spec:
26       initContainers:
27       - command:
28         - sh
29         args:
30         - -c
31         - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done"
32         env:
33         - name: SDNC_DB_USER
34           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
35         - name: SDNC_DB_PASSWORD
36           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
37         - name: UEB_USER
38           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ueb-creds" "key" "login") | indent 10 }}
39         - name: UEB_PASSWORD
40           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "ueb-creds" "key" "password") | indent 10 }}
41         - name: ODL_USER
42           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 10 }}
43         - name: ODL_PASSWORD
44           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 10 }}
45         volumeMounts:
46         - mountPath: /config-input
47           name: config-input
48         - mountPath: /config
49           name: properties
50         image: {{ include "repositoryGenerator.image.envsubst" . }}
51         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52         name: {{ include "common.name" . }}-update-config
53       - command:
54         - /app/ready.py
55         args:
56         - --service-name
57         - {{ include "common.mariadbService" . }}
58         - --service-name
59         - {{ .Values.config.sdncChartName }}
60         - --service-name
61         - {{ .Values.config.sdcbeChartName }}
62         env:
63         - name: NAMESPACE
64           valueFrom:
65             fieldRef:
66               apiVersion: v1
67               fieldPath: metadata.namespace
68         image: {{ include "repositoryGenerator.image.readiness" . }}
69         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
70         name: {{ include "common.name" . }}-readiness
71         resources:
72           limits:
73             cpu: "100m"
74             memory: "500Mi"
75           requests:
76             cpu: "3m"
77             memory: "20Mi"
78       containers:
79       - command:
80         - /opt/onap/sdnc/ueb-listener/bin/start-ueb-listener.sh
81         name: {{ include "common.name" . }}
82         image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
83         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
84         env:
85         - name: PROPERTY_DIR
86           value: "{{ .Values.config.configDir }}"
87         - name: SDNC_CONFIG_DIR
88           value: "{{ .Values.config.configDir }}"
89         - name: LOG4J_FORMAT_MSG_NO_LOOKUPS
90           value: "true"
91         - name: SASL_JAAS_CONFIG
92           valueFrom:
93             secretKeyRef:
94               name: {{ include "common.name" . }}-ku
95               key: sasl.jaas.config
96         volumeMounts:
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         - mountPath: {{ .Values.config.configDir }}/log4j2.xml
104           name: properties
105           subPath: log4j2.xml
106         resources: {{ include "common.resources" . | nindent 10 }}
107         ports: {{ include "common.containerPorts" . | nindent 10  }}
108       {{- if .Values.nodeSelector }}
109       nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
110       {{- end }}
111       {{- if .Values.affinity }}
112       affinity: {{ toYaml .Values.affinity | nindent 8 }}
113       {{- end }}
114       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
115       volumes:
116         - name: config-input
117           configMap:
118             name: {{ include "common.fullname" . }}
119             defaultMode: 0644
120         - name: properties
121           emptyDir:
122             medium: Memory
123       {{- include "common.imagePullSecrets" . | nindent 6 }}