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