Merge "Remove unneded LoadBalancer annotation"
[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: extensions/v1beta1
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   replicas: {{ .Values.replicaCount }}
29   template:
30     metadata:
31       labels:
32         app: {{ include "common.name" . }}
33         release: {{ include "common.release" . }}
34     spec:
35       initContainers:
36       - command:
37         - sh
38         args:
39         - -c
40         - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done"
41         env:
42         - name: SDNC_DB_USER
43           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
44         - name: SDNC_DB_PASSWORD
45           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
46         - name: ODL_USER
47           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "login") | indent 10 }}
48         - name: ODL_PASSWORD
49           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "odl-creds" "key" "password") | indent 10 }}
50         volumeMounts:
51         - mountPath: /config-input
52           name: config-input
53         - mountPath: /config
54           name: properties
55         image: "{{ .Values.global.envsubstImage }}"
56         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
57         name: {{ include "common.name" . }}-update-config
58
59       - command:
60         - /root/ready.py
61         args:
62         - --container-name
63         - {{ include "common.mariadbService" . }}
64         - --container-name
65         - {{ .Values.config.sdncChartName }}
66         - --container-name
67         - {{ .Values.config.msgRouterContainerName }}
68         env:
69         - name: NAMESPACE
70           valueFrom:
71             fieldRef:
72               apiVersion: v1
73               fieldPath: metadata.namespace
74         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
75         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
76         name: {{ include "common.name" . }}-readiness
77       containers:
78       - command:
79         - /opt/onap/sdnc/dmaap-listener/bin/start-dmaap-listener.sh
80         name: {{ include "common.name" . }}
81         image: "{{ include "common.repository" . }}/{{ .Values.image }}"
82         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
83         env:
84         - name: PROPERTY_DIR
85           value: "{{ .Values.config.configDir }}"
86         - name: SDNC_CONFIG_DIR
87           value: "{{ .Values.config.configDir }}"
88         volumeMounts:
89         - mountPath: /etc/localtime
90           name: localtime
91           readOnly: true
92         - mountPath: {{ .Values.config.configDir }}/dblib.properties
93           name: properties
94           subPath: dblib.properties
95         - mountPath: {{ .Values.config.configDir }}/dhcpalert.properties
96           name: properties
97           subPath: dhcpalert.properties
98         - mountPath: {{ .Values.config.configDir }}/lcm.properties
99           name: properties
100           subPath: lcm.properties
101         - mountPath: {{ .Values.config.configDir }}/aai.properties
102           name: properties
103           subPath: aai.properties
104         resources:
105 {{ include "common.resources" . | indent 12 }}
106         {{- if .Values.nodeSelector }}
107         nodeSelector:
108 {{ toYaml .Values.nodeSelector | indent 10 }}
109         {{- end -}}
110         {{- if .Values.affinity }}
111         affinity:
112 {{ toYaml .Values.affinity | indent 10 }}
113         {{- end }}
114
115       volumes:
116         - name: localtime
117           hostPath:
118             path: /etc/localtime
119         - name: config-input
120           configMap:
121             name: {{ include "common.fullname" . }}
122             defaultMode: 0644
123         - name: properties
124           emptyDir:
125             medium: Memory
126       imagePullSecrets:
127       - name: "{{ include "common.namespace" . }}-docker-registry-key"