Merge "[DMAAP] DMaaP ServiceMesh compatibility"
[oom.git] / kubernetes / sdnc / components / dmaap-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: ODL_USER
41           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 10 }}
42         - name: ODL_PASSWORD
43           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 10 }}
44         volumeMounts:
45         - mountPath: /config-input
46           name: config-input
47         - mountPath: /config
48           name: properties
49         image: {{ include "repositoryGenerator.image.envsubst" . }}
50         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
51         name: {{ include "common.name" . }}-update-config
52
53       - command:
54         - /app/ready.py
55         args:
56         - --container-name
57         - {{ include "common.mariadbService" . }}
58         - --container-name
59         - {{ .Values.config.sdncChartName }}
60         - --container-name
61         - {{ .Values.config.msgRouterContainerName }}
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       containers:
72       - command:
73         - /opt/onap/sdnc/dmaap-listener/bin/start-dmaap-listener.sh
74         name: {{ include "common.name" . }}
75         image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
76         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
77         env:
78         - name: PROPERTY_DIR
79           value: "{{ .Values.config.configDir }}"
80         - name: SDNC_CONFIG_DIR
81           value: "{{ .Values.config.configDir }}"
82         - name: LOG4J_FORMAT_MSG_NO_LOOKUPS
83           value: "true"
84         volumeMounts:
85         - mountPath: /etc/localtime
86           name: localtime
87           readOnly: true
88         - mountPath: {{ .Values.config.configDir }}/dblib.properties
89           name: properties
90           subPath: dblib.properties
91         - mountPath: {{ .Values.config.configDir }}/dhcpalert.properties
92           name: properties
93           subPath: dhcpalert.properties
94         - mountPath: {{ .Values.config.configDir }}/lcm.properties
95           name: properties
96           subPath: lcm.properties
97         - mountPath: {{ .Values.config.configDir }}/aai.properties
98           name: properties
99           subPath: aai.properties
100         - mountPath: {{ .Values.config.configDir }}/dmaap-consumer-CMNotify.properties
101           name: properties
102           subPath: dmaap-consumer-CMNotify.properties
103         - mountPath: {{ .Values.config.configDir }}/dmaap-consumer-a1Adapter-policy.properties
104           name: properties
105           subPath: dmaap-consumer-a1Adapter-policy.properties
106         - mountPath: {{ .Values.config.configDir }}/dmaap-consumer-oofpcipoc.properties
107           name: properties
108           subPath: dmaap-consumer-oofpcipoc.properties
109         - mountPath: {{ .Values.config.configDir }}/dmaap-consumer-RANSlice.properties
110           name: properties
111           subPath: dmaap-consumer-RANSlice.properties
112         resources: {{ include "common.resources" . | nindent 10 }}
113       {{- if .Values.nodeSelector }}
114       nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
115       {{- end }}
116       {{- if .Values.affinity }}
117       affinity: {{ toYaml .Values.affinity | nindent 8 }}
118       {{- end }}
119       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
120       volumes:
121         - name: localtime
122           hostPath:
123             path: /etc/localtime
124         - name: config-input
125           configMap:
126             name: {{ include "common.fullname" . }}
127             defaultMode: 0644
128         - name: properties
129           emptyDir:
130             medium: Memory
131       imagePullSecrets:
132       - name: "{{ include "common.namespace" . }}-docker-registry-key"