Change port mapping on DMaaP DR prov
[oom.git] / kubernetes / dmaap / components / dmaap-dr-prov / templates / deployment.yaml
1 # Copyright © 2017 Amdocs, Bell Canada
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 apiVersion: extensions/v1beta1
15 kind: Deployment
16 metadata:
17   name: {{ include "common.fullname" . }}
18   namespace: {{ include "common.namespace" . }}
19   labels:
20     app: {{ include "common.name" . }}
21     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
22     release: {{ .Release.Name }}
23     heritage: {{ .Release.Service }}
24 spec:
25   replicas: {{ .Values.replicaCount }}
26   template:
27     metadata:
28       labels:
29         app: {{ include "common.name" . }}
30         release: {{ .Release.Name }}
31     spec:
32       hostname: {{ .Values.global.dmaapDrProvName }}
33       initContainers:
34       - command:
35         - /root/ready.py
36         args:
37         - --container-name
38         - {{ .Values.config.dmaapDrDb.mariadbContName }}
39         env:
40         - name: NAMESPACE
41           valueFrom:
42             fieldRef:
43               apiVersion: v1
44               fieldPath: metadata.namespace
45         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
46         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
47         name: {{ include "common.name" . }}-readiness
48       containers:
49         - name: {{ include "common.name" . }}
50           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
51           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52           ports:
53           - containerPort: {{ .Values.config.dmaapDrProv.internalPort }}
54           {{- if eq .Values.liveness.enabled true }}
55           livenessProbe:
56             tcpSocket:
57               port: {{ .Values.config.dmaapDrProv.internalPort }}
58             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
59             periodSeconds: {{ .Values.liveness.periodSeconds }}
60           {{ end -}}
61           readinessProbe:
62             tcpSocket:
63               port: {{ .Values.config.dmaapDrProv.internalPort }}
64             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
65             periodSeconds: {{ .Values.readiness.periodSeconds }}
66           volumeMounts:
67           - mountPath: /etc/localtime
68             name: localtime
69             readOnly: false
70           - mountPath: /opt/app/datartr/etc/provserver.properties
71             name: {{ include "common.fullname" . }}-config
72             subPath: provserver.properties
73           - mountPath: /opt/app/datartr/etc/drProvCadi.properties
74             name: {{ include "common.fullname" . }}-config
75             subPath: drProvCadi.properties
76           - mountPath: /opt/app/datartr/etc/logback.xml
77             name: {{ include "common.fullname" . }}-log-conf
78             subPath: logback.xml
79           - mountPath: {{ .Values.global.loggingDirectory }}
80             name: {{ include "common.fullname" . }}-logs
81           resources:
82 {{ include "common.resources" . | indent 12 }}
83         {{- if .Values.nodeSelector }}
84         nodeSelector:
85 {{ toYaml .Values.nodeSelector | indent 10 }}
86         {{- end -}}
87         {{- if .Values.affinity }}
88         affinity:
89 {{ toYaml .Values.affinity | indent 10 }}
90         {{- end }}
91         # Filebeat sidecar container
92         - name: {{ include "common.name" . }}-filebeat-onap
93           image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
94           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
95           volumeMounts:
96           - name: {{ include "common.fullname" . }}-filebeat-conf
97             mountPath: /usr/share/filebeat/filebeat.yml
98             subPath: filebeat.yml
99           - name: {{ include "common.fullname" . }}-data-filebeat
100             mountPath: /usr/share/filebeat/data
101           - name: {{ include "common.fullname" . }}-logs
102             mountPath: /var/log/onap/datarouter-prov
103       volumes:
104       - name: localtime
105         hostPath:
106           path: /etc/localtime
107       - name: {{ include "common.fullname" . }}-config
108         configMap:
109           name: {{ include "common.fullname" . }}-configmap
110           items:
111           - key: provserver.properties
112             path: provserver.properties
113           - key: drProvCadi.properties
114             path: drProvCadi.properties
115       - name: {{ include "common.fullname" . }}-log-conf
116         configMap:
117           name: {{ include "common.fullname" . }}-log
118       - name: {{ include "common.fullname" . }}-filebeat-conf
119         configMap:
120           name: {{ include "common.fullname" . }}-dmaap-dr-prov-filebeat-configmap
121       - name: {{ include "common.fullname" . }}-data-filebeat
122         emptyDir: {}
123       - name:  {{ include "common.fullname" . }}-logs
124         emptyDir: {}
125       imagePullSecrets:
126       - name: "{{ include "common.namespace" . }}-docker-registry-key"