blob: a7362f23e68830cb1080775b1b157530cfaad222 [file] [log] [blame]
Jakub Latusek67f4e8d2020-10-21 13:36:29 +02001{{/*
Durgpal7ad40692018-08-03 07:28:36 +00002# Modifications Copyright © 2018 Amdocs,Bell Canada
Dominic Lunanuovae825fee2018-04-12 14:40:34 +00003#
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*/}}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000016
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010017apiVersion: apps/v1
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000018kind: Deployment
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010019metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000020spec:
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010021 selector: {{- include "common.selectors" . | nindent 4 }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000022 replicas: {{ .Values.replicaCount }}
23 template:
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010024 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000025 spec:
rope252f2db5c12022-01-10 14:15:16 +000026 {{ include "common.podSecurityContext" . | indent 6 | trim}}
efiacor2123fec2022-12-09 13:40:55 +000027 initContainers: {{ include "common.readinessCheck.waitFor" . | nindent 6 }}
28 {{- if .Values.usePostgres }}
Krzysztof Opasiak03a125a2020-05-05 02:11:09 +020029 - 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:
efiacor2123fec2022-12-09 13:40:55 +000035 - 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 }}
Krzysztof Opasiak03a125a2020-05-05 02:11:09 +020039 volumeMounts:
efiacor2123fec2022-12-09 13:40:55 +000040 - 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
Sylvain Desbureaux6b096542020-11-21 22:51:24 +010045 image: {{ include "repositoryGenerator.image.envsubst" . }}
Krzysztof Opasiak03a125a2020-05-05 02:11:09 +020046 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
efiacor2123fec2022-12-09 13:40:55 +000047 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020048 - /app/ready.py
dglFromAttfb58a9d2019-04-12 20:12:26 +000049 args:
50 - --container-name
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000051 - {{ .Values.postgres.nameOverride }}
efiacor2123fec2022-12-09 13:40:55 +000052 securityContext:
53 runAsUser: 100
54 runAsGroup: 65533
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000055 env:
56 - name: NAMESPACE
57 valueFrom:
58 fieldRef:
59 apiVersion: v1
60 fieldPath: metadata.namespace
efiacor2123fec2022-12-09 13:40:55 +000061 name: {{ include "common.name" . }}-postgres-readiness
Sylvain Desbureaux6b096542020-11-21 22:51:24 +010062 image: {{ include "repositoryGenerator.image.readiness" . }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000063 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
efiacor2123fec2022-12-09 13:40:55 +000064 {{- end }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000065 containers:
66 - name: {{ include "common.name" . }}
Sylvain Desbureaux6b096542020-11-21 22:51:24 +010067 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000068 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010069 ports: {{ include "common.containerPorts" . | nindent 10 }}
efiacore62958b2019-09-27 16:54:36 +010070 {{ if eq .Values.liveness.enabled true -}}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000071 livenessProbe:
72 httpGet:
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010073 port: {{ .Values.liveness.port }}
74 path: /webapi/topics
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000075 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
dglFromAttec0918d2018-10-17 19:34:49 +000076 periodSeconds: {{ .Values.liveness.periodSeconds }}
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010077 {{ end -}}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000078 readinessProbe:
79 httpGet:
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010080 port: {{ .Values.readiness.port }}
81 path: /webapi/topics
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000082 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
83 periodSeconds: {{ .Values.readiness.periodSeconds }}
efiacor2123fec2022-12-09 13:40:55 +000084 volumeMounts:
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000085 - mountPath: /etc/localtime
86 name: localtime
87 readOnly: true
88 - name: {{ include "common.name" . }}-config
dglFromAtt82340072018-10-16 21:53:34 +000089 mountPath: /opt/app/config/conf/
efiacor2123fec2022-12-09 13:40:55 +000090 - mountPath: /opt/app/dmaapbc/etc/logback.xml
91 name: {{ include "common.fullname" . }}-log-conf
92 subPath: logback.xml
miroslavmasaryka7ac7f02023-03-01 14:12:26 +010093 resources: {{ include "common.resources" . | nindent 12 }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000094 {{- if .Values.nodeSelector }}
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010095 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000096 {{- end -}}
97 {{- if .Values.affinity }}
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010098 affinity: {{ toYaml .Values.affinity | nindent 10 }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000099 {{- end }}
farida azmy13388ba2021-03-17 11:33:28 +0200100 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
efiacor2123fec2022-12-09 13:40:55 +0000101 volumes:
Dominic Lunanuovae825fee2018-04-12 14:40:34 +0000102 - name: localtime
103 hostPath:
104 path: /etc/localtime
efiacor2123fec2022-12-09 13:40:55 +0000105 - name: {{ include "common.fullname" . }}-log-conf
106 configMap:
107 name: {{ include "common.fullname" . }}-log
108 {{- if .Values.usePostgres }}
Krzysztof Opasiak03a125a2020-05-05 02:11:09 +0200109 - name: {{ include "common.name" . }}-config-input
Dominic Lunanuovae825fee2018-04-12 14:40:34 +0000110 configMap:
111 name: {{ include "common.fullname" . }}-config
Krzysztof Opasiak03a125a2020-05-05 02:11:09 +0200112 - name: {{ include "common.name" . }}-config
113 emptyDir:
114 medium: Memory
efiacor2123fec2022-12-09 13:40:55 +0000115 {{- else }}
116 - name: {{ include "common.name" . }}-config
117 configMap:
118 name: {{ include "common.fullname" . }}-config
119 {{- end }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +0000120 imagePullSecrets:
121 - name: "{{ include "common.namespace" . }}-docker-registry-key"