Merge "[SO] bump the SO modules"
[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: {{ include "common.release" . }}
23     heritage: {{ .Release.Service }}
24 spec:
25   replicas: {{ .Values.replicaCount }}
26   template:
27     metadata:
28       labels:
29         app: {{ include "common.name" . }}
30         release: {{ include "common.release" . }}
31     spec:
32       hostname: {{ .Values.global.dmaapDrProvName }}
33       initContainers:
34         - name: {{ include "common.name" . }}-readiness
35           image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
36           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
37           command:
38           - /root/ready.py
39           args:
40           - --container-name
41           - {{ .Values.config.dmaapDrDb.mariadbContName }}
42           env:
43           - name: NAMESPACE
44             valueFrom:
45               fieldRef:
46                 apiVersion: v1
47                 fieldPath: metadata.namespace
48         {{- if .Values.global.aafEnabled }}
49
50         {{ include "common.certInitializer.initContainer" . | nindent 8 }}
51
52         - name: {{ include "common.name" . }}-permission-fixer
53           image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}"
54           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
55           volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
56           command: ["chown","-Rf","1000:1001", "/opt/app/"]
57
58         {{ end }}
59       containers:
60         - name: {{ include "common.name" . }}
61           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
62           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
63           ports:
64           - containerPort: {{ .Values.config.dmaapDrProv.internalPort }}
65           {{- if eq .Values.liveness.enabled true }}
66           livenessProbe:
67             tcpSocket:
68               port: {{ .Values.config.dmaapDrProv.internalPort }}
69             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
70             periodSeconds: {{ .Values.liveness.periodSeconds }}
71           {{ end -}}
72           readinessProbe:
73             tcpSocket:
74               port: {{ .Values.config.dmaapDrProv.internalPort }}
75             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
76             periodSeconds: {{ .Values.readiness.periodSeconds }}
77           env:
78           - name: DB_USERNAME
79             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-dr-db-user-secret" "key" "login") | indent 12 }}
80           - name: DB_PASSWORD
81             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-dr-db-user-secret" "key" "password") | indent 12 }}
82           volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
83           - mountPath: /etc/localtime
84             name: localtime
85             readOnly: false
86           - mountPath: /opt/app/datartr/etc/provserver.properties
87             name: {{ include "common.fullname" . }}-config
88             subPath: provserver.properties
89           - mountPath: /opt/app/datartr/etc/logback.xml
90             name: {{ include "common.fullname" . }}-log-conf
91             subPath: logback.xml
92           - mountPath: {{ .Values.global.loggingDirectory }}
93             name: {{ include "common.fullname" . }}-logs
94           resources:
95 {{ include "common.resources" . }}
96         {{- if .Values.nodeSelector }}
97         nodeSelector:
98 {{ toYaml .Values.nodeSelector | indent 10 }}
99         {{- end -}}
100         {{- if .Values.affinity }}
101         affinity:
102 {{ toYaml .Values.affinity | indent 10 }}
103         {{- end -}}
104       # Filebeat sidecar container
105         - name: {{ include "common.name" . }}-filebeat-onap
106           image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
107           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
108           volumeMounts:
109           - name: {{ include "common.fullname" . }}-filebeat-conf
110             mountPath: /usr/share/filebeat/filebeat.yml
111             subPath: filebeat.yml
112           - name: {{ include "common.fullname" . }}-data-filebeat
113             mountPath: /usr/share/filebeat/data
114           - name: {{ include "common.fullname" . }}-logs
115             mountPath: /var/log/onap/datarouter-prov
116       volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }}
117       - name: localtime
118         hostPath:
119           path: /etc/localtime
120       - name: {{ include "common.fullname" . }}-config
121         configMap:
122           name: {{ include "common.fullname" . }}-configmap
123           items:
124           - key: provserver.properties
125             path: provserver.properties
126       - name: {{ include "common.fullname" . }}-log-conf
127         configMap:
128           name: {{ include "common.fullname" . }}-log
129       - name: {{ include "common.fullname" . }}-filebeat-conf
130         configMap:
131           name: {{ include "common.fullname" . }}-dmaap-dr-prov-filebeat-configmap
132       - name: {{ include "common.fullname" . }}-data-filebeat
133         emptyDir: {}
134       - name:  {{ include "common.fullname" . }}-logs
135         emptyDir: {}
136       imagePullSecrets:
137       - name: "{{ include "common.namespace" . }}-docker-registry-key"