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