blob: 994e7cb97d1130319bf2d182cf4f998842567805 [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*/}}
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010016apiVersion: apps/v1
efiacor4808baa2019-03-11 23:36:05 +000017kind: StatefulSet
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010018metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010019spec:
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010020 selector: {{- include "common.selectors" . | nindent 4 }}
21 serviceName: {{ include "common.servicename" . }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010022 replicas: {{ .Values.replicaCount }}
23 template:
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010024 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010025 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 8 }}
econwar4d9f35f2019-04-16 08:02:13 +000028 - name: {{ include "common.name" . }}-permission-fixer
rope252f2db5c12022-01-10 14:15:16 +000029 securityContext:
30 runAsUser: 0
Sylvain Desbureaux6b096542020-11-21 22:51:24 +010031 image: {{ include "repositoryGenerator.image.busybox" . }}
econwar4d9f35f2019-04-16 08:02:13 +000032 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
efiacore62958b2019-09-27 16:54:36 +010033 command: ["chown","-Rf","1000:1001", "/opt/app/"]
efiacor2123fec2022-12-09 13:40:55 +000034 volumeMounts:
35 - name: {{ include "common.fullname" . }}-spool
36 mountPath: {{ .Values.persistence.spool.path }}
37 - name: {{ include "common.fullname" . }}-event-logs
38 mountPath: {{ .Values.persistence.event.path }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010039 containers:
40 - name: {{ include "common.name" . }}
Sylvain Desbureaux6b096542020-11-21 22:51:24 +010041 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010042 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010043 ports: {{ include "common.containerPorts" . | nindent 12 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010044 {{- if eq .Values.liveness.enabled true }}
45 livenessProbe:
46 tcpSocket:
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010047 port: {{.Values.liveness.port}}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010048 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
49 periodSeconds: {{ .Values.liveness.periodSeconds }}
50 {{ end -}}
51 readinessProbe:
52 tcpSocket:
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010053 port: {{.Values.readiness.port}}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010054 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
55 periodSeconds: {{ .Values.readiness.periodSeconds }}
efiacor2123fec2022-12-09 13:40:55 +000056 volumeMounts:
57 - mountPath: {{ .Values.persistence.spool.path }}
58 name: {{ include "common.fullname" . }}-spool
59 - mountPath: {{ .Values.persistence.event.path }}
60 name: {{ include "common.fullname" . }}-event-logs
61 - mountPath: /etc/localtime
62 name: localtime
63 readOnly: false
64 - mountPath: /opt/app/datartr/etc/node.properties
65 name: {{ include "common.fullname" . }}-config
66 subPath: node.properties
67 - mountPath: /opt/app/datartr/etc/logback.xml
68 name: {{ include "common.fullname" . }}-log-conf
69 subPath: logback.xml
miroslavmasaryka7ac7f02023-03-01 14:12:26 +010070 resources: {{ include "common.resources" . | nindent 12 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010071 {{- if .Values.nodeSelector }}
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010072 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010073 {{- end -}}
74 {{- if .Values.affinity }}
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010075 affinity: {{ toYaml .Values.affinity | nindent 10 }}
Sylvain Desbureauxe6153432021-02-04 18:26:23 +010076 {{- end }}
Sylvain Desbureaux789d79a2018-12-20 11:04:34 +010077 imagePullSecrets:
78 - name: "{{ include "common.namespace" . }}-docker-registry-key"
farida azmy13388ba2021-03-17 11:33:28 +020079 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
efiacor2123fec2022-12-09 13:40:55 +000080 volumes:
efiacor4808baa2019-03-11 23:36:05 +000081 - name: localtime
82 hostPath:
83 path: /etc/localtime
efiacoreabb6522019-04-08 09:46:09 +000084 - name: {{ include "common.fullname" . }}-config
efiacor4808baa2019-03-11 23:36:05 +000085 configMap:
efiacor2123fec2022-12-09 13:40:55 +000086 name: {{ include "common.fullname" . }}-node-props
efiacoreabb6522019-04-08 09:46:09 +000087 items:
88 - key: node.properties
89 path: node.properties
efiacor4808baa2019-03-11 23:36:05 +000090 - name: {{ include "common.fullname" . }}-log-conf
91 configMap:
92 name: {{ include "common.fullname" . }}-log
Sylvain Desbureaux60141122019-11-29 15:55:11 +010093 {{- if not .Values.persistence.enabled }}
mprzybyse1ea50d2020-01-31 10:09:02 +000094 - name: {{ include "common.fullname" . }}-event-logs
efiacor4808baa2019-03-11 23:36:05 +000095 emptyDir: {}
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010096 - name: {{ include "common.fullname" . }}-spool
efiacor7b9a0872019-08-28 21:20:22 +000097 emptyDir: {}
Sylvain Desbureaux60141122019-11-29 15:55:11 +010098 {{- end }}
99{{- if .Values.persistence.enabled }}
efiacor4808baa2019-03-11 23:36:05 +0000100 volumeClaimTemplates:
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +0100101 - {{ include "common.PVCTemplate" (dict "dot" . "suffix" "spool" "persistenceInfos" .Values.persistence.spool) | indent 4 | trim }}
102 - {{ include "common.PVCTemplate" (dict "dot" . "suffix" "event-logs" "persistenceInfos" .Values.persistence.event) | indent 4 | trim }}
efiacore62958b2019-09-27 16:54:36 +0100103{{- end }}