blob: 51045afae93d6c8fd3016d15b0f71c901adc9e6b [file] [log] [blame]
Jakub Latusek67f4e8d2020-10-21 13:36:29 +02001{{/*
Fiachra Corcoranbe966552018-08-07 16:58:45 +01002# 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.
Jakub Latusek67f4e8d2020-10-21 13:36:29 +020015*/}}
Grzegorz-Lisb1da7722020-07-23 09:32:48 +020016apiVersion: apps/v1
Fiachra Corcoranbe966552018-08-07 16:58:45 +010017kind: Deployment
18metadata:
19 name: {{ include "common.fullname" . }}
20 namespace: {{ include "common.namespace" . }}
21 labels:
22 app: {{ include "common.name" . }}
23 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010024 release: {{ include "common.release" . }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010025 heritage: {{ .Release.Service }}
26spec:
Grzegorz-Lisb1da7722020-07-23 09:32:48 +020027 selector:
28 matchLabels:
29 app: {{ include "common.name" . }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010030 replicas: {{ .Values.replicaCount }}
31 template:
32 metadata:
33 labels:
34 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010035 release: {{ include "common.release" . }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010036 spec:
rope252f2db5c12022-01-10 14:15:16 +000037 {{ include "common.podSecurityContext" . | indent 6 | trim}}
efiacor7b9a0872019-08-28 21:20:22 +000038 hostname: {{ .Values.global.dmaapDrProvName }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010039 initContainers:
efiacore62958b2019-09-27 16:54:36 +010040 - name: {{ include "common.name" . }}-readiness
rope252f2db5c12022-01-10 14:15:16 +000041 securityContext:
42 runAsUser: 100
43 runAsGroup: 65533
Sylvain Desbureaux6b096542020-11-21 22:51:24 +010044 image: {{ include "repositoryGenerator.image.readiness" . }}
efiacore62958b2019-09-27 16:54:36 +010045 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
46 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020047 - /app/ready.py
efiacore62958b2019-09-27 16:54:36 +010048 args:
Mahmoud Abdelhamid7fc530c2021-09-15 20:27:19 +020049 - --job-name
50 - {{ include "common.release" . }}-dmaap-dr-mariadb-init-config-job
efiacore62958b2019-09-27 16:54:36 +010051 env:
52 - name: NAMESPACE
53 valueFrom:
54 fieldRef:
55 apiVersion: v1
56 fieldPath: metadata.namespace
57 {{- if .Values.global.aafEnabled }}
Krzysztof Opasiak2df4a782020-05-08 22:50:24 +020058
59 {{ include "common.certInitializer.initContainer" . | nindent 8 }}
60
efiacore62958b2019-09-27 16:54:36 +010061 - name: {{ include "common.name" . }}-permission-fixer
rope252f2db5c12022-01-10 14:15:16 +000062 securityContext:
63 runAsUser: 0
Sylvain Desbureaux6b096542020-11-21 22:51:24 +010064 image: {{ include "repositoryGenerator.image.busybox" . }}
efiacore62958b2019-09-27 16:54:36 +010065 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Krzysztof Opasiak2df4a782020-05-08 22:50:24 +020066 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
efiacore62958b2019-09-27 16:54:36 +010067 command: ["chown","-Rf","1000:1001", "/opt/app/"]
Krzysztof Opasiak2df4a782020-05-08 22:50:24 +020068
efiacore62958b2019-09-27 16:54:36 +010069 {{ end }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010070 containers:
71 - name: {{ include "common.name" . }}
Sylvain Desbureaux6b096542020-11-21 22:51:24 +010072 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010073 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
74 ports:
efiacor18e43fd2019-10-03 19:57:52 +010075 - containerPort: {{ .Values.config.dmaapDrProv.internalPort }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010076 {{- if eq .Values.liveness.enabled true }}
77 livenessProbe:
78 tcpSocket:
efiacor18e43fd2019-10-03 19:57:52 +010079 port: {{ .Values.config.dmaapDrProv.internalPort }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010080 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
81 periodSeconds: {{ .Values.liveness.periodSeconds }}
82 {{ end -}}
83 readinessProbe:
84 tcpSocket:
efiacor18e43fd2019-10-03 19:57:52 +010085 port: {{ .Values.config.dmaapDrProv.internalPort }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010086 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
87 periodSeconds: {{ .Values.readiness.periodSeconds }}
Krzysztof Opasiake55b4d52020-02-07 22:54:20 +010088 env:
89 - name: DB_USERNAME
Mahmoud Abdelhamid7fc530c2021-09-15 20:27:19 +020090 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-dr-db-user-credentials" "key" "login") | indent 12 }}
Krzysztof Opasiake55b4d52020-02-07 22:54:20 +010091 - name: DB_PASSWORD
Mahmoud Abdelhamid7fc530c2021-09-15 20:27:19 +020092 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-dr-db-user-credentials" "key" "password") | indent 12 }}
Krzysztof Opasiak2df4a782020-05-08 22:50:24 +020093 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010094 - mountPath: /etc/localtime
95 name: localtime
96 readOnly: false
97 - mountPath: /opt/app/datartr/etc/provserver.properties
efiacoreabb6522019-04-08 09:46:09 +000098 name: {{ include "common.fullname" . }}-config
Fiachra Corcoranbe966552018-08-07 16:58:45 +010099 subPath: provserver.properties
efiacor7b9a0872019-08-28 21:20:22 +0000100 - mountPath: /opt/app/datartr/etc/logback.xml
101 name: {{ include "common.fullname" . }}-log-conf
102 subPath: logback.xml
efiacoreabb6522019-04-08 09:46:09 +0000103 - mountPath: {{ .Values.global.loggingDirectory }}
104 name: {{ include "common.fullname" . }}-logs
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100105 resources:
efiacore62958b2019-09-27 16:54:36 +0100106{{ include "common.resources" . }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100107 {{- 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 }}
Sylvain Desbureauxe6153432021-02-04 18:26:23 +0100114 {{- end }}
efiacore62958b2019-09-27 16:54:36 +0100115 # Filebeat sidecar container
Maciej Wereski9075b5c2021-11-04 14:01:26 +0000116 {{ include "common.log.sidecar" . | nindent 8 }}
farida azmy13388ba2021-03-17 11:33:28 +0200117 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Krzysztof Opasiak2df4a782020-05-08 22:50:24 +0200118 volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100119 - name: localtime
120 hostPath:
121 path: /etc/localtime
efiacoreabb6522019-04-08 09:46:09 +0000122 - name: {{ include "common.fullname" . }}-config
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100123 configMap:
efiacoreabb6522019-04-08 09:46:09 +0000124 name: {{ include "common.fullname" . }}-configmap
125 items:
126 - key: provserver.properties
127 path: provserver.properties
econwar378cf192019-01-08 16:19:59 +0000128 - name: {{ include "common.fullname" . }}-log-conf
129 configMap:
130 name: {{ include "common.fullname" . }}-log
Maciej Wereski9075b5c2021-11-04 14:01:26 +0000131 {{ include "common.log.volumes" . | nindent 6 }}
econwar378cf192019-01-08 16:19:59 +0000132 - name: {{ include "common.fullname" . }}-logs
133 emptyDir: {}
Sylvain Desbureaux435ef532018-12-20 10:58:09 +0100134 imagePullSecrets:
135 - name: "{{ include "common.namespace" . }}-docker-registry-key"