[DMAAP] Remove AAF dependency
[oom.git] / kubernetes / dmaap / components / dmaap-bc / templates / deployment.yaml
1 {{/*
2 # Modifications Copyright © 2018 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: apps/v1
18 kind: Deployment
19 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
20 spec:
21   selector: {{- include "common.selectors" . | nindent 4 }}
22   replicas: {{ .Values.replicaCount }}
23   template:
24     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
25     spec:
26       {{ include "common.podSecurityContext" . | indent 6 | trim}}
27       initContainers: {{ include "common.readinessCheck.waitFor" . | nindent 6 }}
28       {{- if .Values.usePostgres }}
29       - command:
30         - sh
31         args:
32         - -c
33         - "cd /config-input && for PFILE in `find . -not -type d | grep -v -F ..`; do envsubst <${PFILE} >/config/${PFILE}; done"
34         env:
35           - name: PG_USER
36             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 12 }}
37           - name: PG_PASSWORD
38             {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 12 }}
39         volumeMounts:
40           - mountPath: /config-input
41             name: {{ include "common.name" . }}-config-input
42           - mountPath: /config
43             name: {{ include "common.name" . }}-config
44         name: {{ include "common.name" . }}-update-config
45         image: {{ include "repositoryGenerator.image.envsubst" . }}
46         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
47       - command:
48         - /app/ready.py
49         args:
50         - --container-name
51         - {{ .Values.postgres.nameOverride }}
52         securityContext:
53           runAsUser: 100
54           runAsGroup: 65533
55         env:
56         - name: NAMESPACE
57           valueFrom:
58             fieldRef:
59               apiVersion: v1
60               fieldPath: metadata.namespace
61         name: {{ include "common.name" . }}-postgres-readiness
62         image: {{ include "repositoryGenerator.image.readiness" . }}
63         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
64       {{- end }}
65       containers:
66         - name: {{ include "common.name" . }}
67           image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
68           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
69           ports: {{ include "common.containerPorts" . | nindent 10  }}
70           {{ if eq .Values.liveness.enabled true -}}
71           livenessProbe:
72             httpGet:
73               port: {{ .Values.liveness.port }}
74               path: /webapi/topics
75             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
76             periodSeconds: {{ .Values.liveness.periodSeconds }}
77           {{ end -}}
78           readinessProbe:
79             httpGet:
80               port: {{ .Values.readiness.port }}
81               path: /webapi/topics
82             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
83             periodSeconds: {{ .Values.readiness.periodSeconds }}
84           volumeMounts:
85           - mountPath: /etc/localtime
86             name: localtime
87             readOnly: true
88           - name: {{ include "common.name" . }}-config
89             mountPath: /opt/app/config/conf/
90           - mountPath: /opt/app/dmaapbc/etc/logback.xml
91             name: {{ include "common.fullname" . }}-log-conf
92             subPath: logback.xml
93           resources:
94 {{ include "common.resources" . }}
95         {{- if .Values.nodeSelector }}
96         nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }}
97         {{- end -}}
98         {{- if .Values.affinity }}
99         affinity: {{ toYaml .Values.affinity | nindent 10 }}
100         {{- end }}
101       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
102       volumes:
103         - name: localtime
104           hostPath:
105             path: /etc/localtime
106         - name: {{ include "common.fullname" . }}-log-conf
107           configMap:
108             name: {{ include "common.fullname" . }}-log
109         {{- if .Values.usePostgres }}
110         - name: {{ include "common.name" . }}-config-input
111           configMap:
112             name: {{ include "common.fullname" . }}-config
113         - name: {{ include "common.name" . }}-config
114           emptyDir:
115             medium: Memory
116         {{- else }}
117         - name: {{ include "common.name" . }}-config
118           configMap:
119             name: {{ include "common.fullname" . }}-config
120         {{- end }}
121       imagePullSecrets:
122       - name: "{{ include "common.namespace" . }}-docker-registry-key"