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