[CLAMP] Update mariadb db to latest
[oom.git] / kubernetes / sdnc / charts / 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:
20   name: {{ include "common.fullname" . }}
21   namespace: {{ include "common.namespace" . }}
22   labels:
23     app: {{ include "common.name" . }}
24     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
25     release: {{ include "common.release" . }}
26     heritage: {{ .Release.Service }}
27 spec:
28   selector:
29     matchLabels:
30       app: {{ include "common.name" . }}
31   replicas: {{ .Values.replicaCount }}
32   template:
33     metadata:
34       labels:
35         app: {{ include "common.name" . }}
36         release: {{ include "common.release" . }}
37     spec:
38       initContainers:
39       - command:
40         - sh
41         args:
42         - -c
43         - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done"
44         env:
45         - name: SDNC_DB_USER
46           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
47         - name: SDNC_DB_PASSWORD
48           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
49         - name: ODL_USER
50           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 10 }}
51         - name: ODL_PASSWORD
52           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 10 }}
53         volumeMounts:
54         - mountPath: /config-input
55           name: config-input
56         - mountPath: /config
57           name: properties
58         image: "{{ .Values.global.envsubstImage }}"
59         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
60         name: {{ include "common.name" . }}-update-config
61
62       - command:
63         - /root/ready.py
64         args:
65         - --container-name
66         - {{ include "common.mariadbService" . }}
67         - --container-name
68         - {{ .Values.config.sdncChartName }}
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/dmaap-listener/bin/start-dmaap-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 }}/dhcpalert.properties
99           name: properties
100           subPath: dhcpalert.properties
101         - mountPath: {{ .Values.config.configDir }}/lcm.properties
102           name: properties
103           subPath: lcm.properties
104         - mountPath: {{ .Values.config.configDir }}/aai.properties
105           name: properties
106           subPath: aai.properties
107         - mountPath: {{ .Values.config.configDir }}/dmaap-consumer-CMNotify.properties
108           name: properties
109           subPath: dmaap-consumer-CMNotify.properties
110         - mountPath: {{ .Values.config.configDir }}/dmaap-consumer-a1Adapter-policy.properties
111           name: properties
112           subPath: dmaap-consumer-a1Adapter-policy.properties
113         - mountPath: {{ .Values.config.configDir }}/dmaap-consumer-oofpcipoc.properties
114           name: properties
115           subPath: dmaap-consumer-oofpcipoc.properties
116         resources:
117 {{ include "common.resources" . | indent 12 }}
118         {{- if .Values.nodeSelector }}
119         nodeSelector:
120 {{ toYaml .Values.nodeSelector | indent 10 }}
121         {{- end -}}
122         {{- if .Values.affinity }}
123         affinity:
124 {{ toYaml .Values.affinity | indent 10 }}
125         {{- end }}
126
127       volumes:
128         - name: localtime
129           hostPath:
130             path: /etc/localtime
131         - name: config-input
132           configMap:
133             name: {{ include "common.fullname" . }}
134             defaultMode: 0644
135         - name: properties
136           emptyDir:
137             medium: Memory
138       imagePullSecrets:
139       - name: "{{ include "common.namespace" . }}-docker-registry-key"