076fab3cf398062e5bf991fa7c428250511b5fdb
[oom.git] / kubernetes / dmaap / components / dmaap-dr-prov / 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 apiVersion: apps/v1
17 kind: Deployment
18 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
19 spec:
20   selector: {{- include "common.selectors" . | nindent 4 }}
21   template:
22     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
23     spec:
24       {{ include "common.podSecurityContext" . | indent 6 | trim}}
25       initContainers: {{ include "common.readinessCheck.waitFor" . | nindent 6 }}
26       containers:
27         - name: {{ include "common.name" . }}
28           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
29           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
30           ports: {{ include "common.containerPorts" . | nindent 12  }}
31           {{- if eq .Values.liveness.enabled true }}
32           livenessProbe:
33             httpGet:
34               port: {{ .Values.liveness.port }}
35               path: /internal/prov
36             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
37             periodSeconds: {{ .Values.liveness.periodSeconds }}
38           {{ end -}}
39           readinessProbe:
40             httpGet:
41               port: {{ .Values.liveness.port }}
42               path: /internal/prov
43             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
44             periodSeconds: {{ .Values.liveness.periodSeconds }}
45           env:
46           - name: DB_USERNAME
47             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-dr-db-user-credentials" "key" "login") | indent 12 }}
48           - name: DB_PASSWORD
49             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-dr-db-user-credentials" "key" "password") | indent 12 }}
50           volumeMounts:
51             - mountPath: /etc/localtime
52               name: localtime
53               readOnly: false
54             - mountPath: /opt/app/datartr/etc/provserver.properties
55               name: {{ include "common.fullname" . }}-config
56               subPath: provserver.properties
57             - mountPath: /opt/app/datartr/etc/logback.xml
58               name: {{ include "common.fullname" . }}-log-conf
59               subPath: logback.xml
60           resources: {{ include "common.resources" . | nindent 12 }}
61         {{- if .Values.nodeSelector }}
62         nodeSelector:
63 {{ toYaml .Values.nodeSelector | indent 10 }}
64         {{- end -}}
65         {{- if .Values.affinity }}
66         affinity:
67 {{ toYaml .Values.affinity | indent 10 }}
68         {{- end }}
69       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
70       volumes:
71       - name: localtime
72         hostPath:
73           path: /etc/localtime
74       - name: {{ include "common.fullname" . }}-config
75         configMap:
76           name: {{ include "common.fullname" . }}-configmap
77           items:
78           - key: provserver.properties
79             path: provserver.properties
80       - name: {{ include "common.fullname" . }}-log-conf
81         configMap:
82           name: {{ include "common.fullname" . }}-log
83       {{- include "common.imagePullSecrets" . | nindent 6 }}