Merge "[AAI] Add model-loader tracing config"
[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         - --service-name
54         - {{ include "common.mariadbService" . }}
55         - --service-name
56         - {{ .Values.config.sdncChartName }}
57         - --service-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         resources:
69           limits:
70             cpu: "100m"
71             memory: "500Mi"
72           requests:
73             cpu: "3m"
74             memory: "20Mi"
75       containers:
76       - command:
77         - /opt/onap/sdnc/dmaap-listener/bin/start-dmaap-listener.sh
78         name: {{ include "common.name" . }}
79         image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
80         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
81         env:
82         - name: PROPERTY_DIR
83           value: "{{ .Values.config.configDir }}"
84         - name: SDNC_CONFIG_DIR
85           value: "{{ .Values.config.configDir }}"
86         - name: LOG4J_FORMAT_MSG_NO_LOOKUPS
87           value: "true"
88         volumeMounts:
89         - mountPath: {{ .Values.config.configDir }}/dblib.properties
90           name: properties
91           subPath: dblib.properties
92         - mountPath: {{ .Values.config.configDir }}/dhcpalert.properties
93           name: properties
94           subPath: dhcpalert.properties
95         - mountPath: {{ .Values.config.configDir }}/lcm.properties
96           name: properties
97           subPath: lcm.properties
98         - mountPath: {{ .Values.config.configDir }}/aai.properties
99           name: properties
100           subPath: aai.properties
101         - mountPath: {{ .Values.config.configDir }}/dmaap-consumer-CMNotify.properties
102           name: properties
103           subPath: dmaap-consumer-CMNotify.properties
104         - mountPath: {{ .Values.config.configDir }}/dmaap-consumer-a1Adapter-policy.properties
105           name: properties
106           subPath: dmaap-consumer-a1Adapter-policy.properties
107         - mountPath: {{ .Values.config.configDir }}/dmaap-consumer-oofpcipoc.properties
108           name: properties
109           subPath: dmaap-consumer-oofpcipoc.properties
110         - mountPath: {{ .Values.config.configDir }}/dmaap-consumer-RANSlice.properties
111           name: properties
112           subPath: dmaap-consumer-RANSlice.properties
113         resources: {{ include "common.resources" . | nindent 10 }}
114         ports: {{ include "common.containerPorts" . | nindent 10  }}
115       {{- if .Values.nodeSelector }}
116       nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
117       {{- end }}
118       {{- if .Values.affinity }}
119       affinity: {{ toYaml .Values.affinity | nindent 8 }}
120       {{- end }}
121       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
122       volumes:
123         - name: config-input
124           configMap:
125             name: {{ include "common.fullname" . }}
126             defaultMode: 0644
127         - name: properties
128           emptyDir:
129             medium: Memory
130       {{- include "common.imagePullSecrets" . | nindent 6 }}