blob: 69f6fc1d6e8ab48c2f801568e5bc74e0ea57cef0 [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}}
Krzysztof Opasiak58685d02021-07-29 22:45:45 +020027 initContainers: {{ include "common.certInitializer.initContainer" . | nindent 8 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010028 - name: {{ include "common.name" . }}-readiness
rope252f2db5c12022-01-10 14:15:16 +000029 securityContext:
30 runAsUser: 100
31 runAsGroup: 65533
Sylvain Desbureaux6b096542020-11-21 22:51:24 +010032 image: {{ include "repositoryGenerator.image.readiness" . }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010033 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
34 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020035 - /app/ready.py
Fiachra Corcoranbe966552018-08-07 16:58:45 +010036 args:
37 - --container-name
econwar28266fa2019-03-05 16:39:00 +000038 - dmaap-dr-prov
Fiachra Corcoranbe966552018-08-07 16:58:45 +010039 env:
40 - name: NAMESPACE
41 valueFrom:
42 fieldRef:
43 apiVersion: v1
44 fieldPath: metadata.namespace
econwar4d9f35f2019-04-16 08:02:13 +000045 - name: {{ include "common.name" . }}-permission-fixer
rope252f2db5c12022-01-10 14:15:16 +000046 securityContext:
47 runAsUser: 0
Sylvain Desbureaux6b096542020-11-21 22:51:24 +010048 image: {{ include "repositoryGenerator.image.busybox" . }}
econwar4d9f35f2019-04-16 08:02:13 +000049 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Krzysztof Opasiak58685d02021-07-29 22:45:45 +020050 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010051 - mountPath: {{ .Values.persistence.spool.path }}
52 name: {{ include "common.fullname" . }}-spool
53 - mountPath: {{ .Values.persistence.event.path }}
Sylvain Desbureaux60141122019-11-29 15:55:11 +010054 name: {{ include "common.fullname" . }}-event-logs
efiacore62958b2019-09-27 16:54:36 +010055 command: ["chown","-Rf","1000:1001", "/opt/app/"]
Fiachra Corcoranbe966552018-08-07 16:58:45 +010056 containers:
57 - name: {{ include "common.name" . }}
Sylvain Desbureaux6b096542020-11-21 22:51:24 +010058 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010059 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010060 ports: {{ include "common.containerPorts" . | nindent 12 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010061 {{- if eq .Values.liveness.enabled true }}
62 livenessProbe:
63 tcpSocket:
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010064 port: {{.Values.liveness.port}}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010065 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
66 periodSeconds: {{ .Values.liveness.periodSeconds }}
67 {{ end -}}
68 readinessProbe:
69 tcpSocket:
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010070 port: {{.Values.readiness.port}}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010071 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
72 periodSeconds: {{ .Values.readiness.periodSeconds }}
Krzysztof Opasiak58685d02021-07-29 22:45:45 +020073 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010074 - mountPath: {{ .Values.persistence.spool.path }}
75 name: {{ include "common.fullname" . }}-spool
76 - mountPath: {{ .Values.persistence.event.path }}
Sylvain Desbureaux60141122019-11-29 15:55:11 +010077 name: {{ include "common.fullname" . }}-event-logs
Fiachra Corcoranbe966552018-08-07 16:58:45 +010078 - mountPath: /etc/localtime
79 name: localtime
80 readOnly: false
Fiachra Corcoranbe966552018-08-07 16:58:45 +010081 - mountPath: /opt/app/datartr/etc/node.properties
efiacoreabb6522019-04-08 09:46:09 +000082 name: {{ include "common.fullname" . }}-config
Fiachra Corcoranbe966552018-08-07 16:58:45 +010083 subPath: node.properties
efiacor7b9a0872019-08-28 21:20:22 +000084 - mountPath: /opt/app/datartr/etc/logback.xml
85 name: {{ include "common.fullname" . }}-log-conf
86 subPath: logback.xml
87 - mountPath: {{ .Values.global.loggingDirectory }}
Maciej Wereski128e9d22022-01-10 11:03:27 +010088 name: logs
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010089 resources: {{ include "common.resources" . | nindent 12 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010090 {{- if .Values.nodeSelector }}
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010091 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010092 {{- end -}}
93 {{- if .Values.affinity }}
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010094 affinity: {{ toYaml .Values.affinity | nindent 10 }}
Sylvain Desbureauxe6153432021-02-04 18:26:23 +010095 {{- end }}
Krzysztof Opasiak03b10092020-01-24 22:45:16 +010096 # Filebeat sidecar container
Maciej Wereski9075b5c2021-11-04 14:01:26 +000097 {{ include "common.log.sidecar" . | nindent 8 }}
Sylvain Desbureaux789d79a2018-12-20 11:04:34 +010098 imagePullSecrets:
99 - name: "{{ include "common.namespace" . }}-docker-registry-key"
farida azmy13388ba2021-03-17 11:33:28 +0200100 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Krzysztof Opasiak58685d02021-07-29 22:45:45 +0200101 volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
efiacor4808baa2019-03-11 23:36:05 +0000102 - name: localtime
103 hostPath:
104 path: /etc/localtime
efiacoreabb6522019-04-08 09:46:09 +0000105 - name: {{ include "common.fullname" . }}-config
efiacor4808baa2019-03-11 23:36:05 +0000106 configMap:
efiacoreabb6522019-04-08 09:46:09 +0000107 name: {{ include "common.fullname" . }}-configmap
108 items:
109 - key: node.properties
110 path: node.properties
efiacor4808baa2019-03-11 23:36:05 +0000111 - name: {{ include "common.fullname" . }}-log-conf
112 configMap:
113 name: {{ include "common.fullname" . }}-log
Maciej Wereski9075b5c2021-11-04 14:01:26 +0000114 {{ include "common.log.volumes" . | nindent 8 }}
Maciej Wereski128e9d22022-01-10 11:03:27 +0100115 - name: logs
Sylvain Desbureaux60141122019-11-29 15:55:11 +0100116 emptyDir: {}
117 {{- if not .Values.persistence.enabled }}
mprzybyse1ea50d2020-01-31 10:09:02 +0000118 - name: {{ include "common.fullname" . }}-event-logs
efiacor4808baa2019-03-11 23:36:05 +0000119 emptyDir: {}
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +0100120 - name: {{ include "common.fullname" . }}-spool
efiacor7b9a0872019-08-28 21:20:22 +0000121 emptyDir: {}
Sylvain Desbureaux60141122019-11-29 15:55:11 +0100122 {{- end }}
123{{- if .Values.persistence.enabled }}
efiacor4808baa2019-03-11 23:36:05 +0000124 volumeClaimTemplates:
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +0100125 - {{ include "common.PVCTemplate" (dict "dot" . "suffix" "spool" "persistenceInfos" .Values.persistence.spool) | indent 4 | trim }}
126 - {{ include "common.PVCTemplate" (dict "dot" . "suffix" "event-logs" "persistenceInfos" .Values.persistence.event) | indent 4 | trim }}
efiacore62958b2019-09-27 16:54:36 +0100127{{- end }}