Jakub Latusek | 67f4e8d | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 2 | # 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 Latusek | 67f4e8d | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 15 | */}} |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 16 | apiVersion: apps/v1 |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 17 | kind: StatefulSet |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 18 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 19 | spec: |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 20 | selector: {{- include "common.selectors" . | nindent 4 }} |
| 21 | serviceName: {{ include "common.servicename" . }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 22 | replicas: {{ .Values.replicaCount }} |
| 23 | template: |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 24 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 25 | spec: |
Andreas Geissler | dc8c054 | 2024-05-08 15:18:55 +0200 | [diff] [blame] | 26 | # temporarily use less restrictions |
| 27 | securityContext: |
| 28 | runAsUser: {{ .Values.securityContext.user_id }} |
| 29 | runAsGroup: {{ .Values.securityContext.group_id }} |
| 30 | fsGroup: {{ .Values.securityContext.group_id }} |
efiacor | 2123fec | 2022-12-09 13:40:55 +0000 | [diff] [blame] | 31 | initContainers: {{ include "common.readinessCheck.waitFor" . | nindent 8 }} |
econwar | 4d9f35f | 2019-04-16 08:02:13 +0000 | [diff] [blame] | 32 | - name: {{ include "common.name" . }}-permission-fixer |
rope252 | f2db5c1 | 2022-01-10 14:15:16 +0000 | [diff] [blame] | 33 | securityContext: |
| 34 | runAsUser: 0 |
Sylvain Desbureaux | 6b09654 | 2020-11-21 22:51:24 +0100 | [diff] [blame] | 35 | image: {{ include "repositoryGenerator.image.busybox" . }} |
econwar | 4d9f35f | 2019-04-16 08:02:13 +0000 | [diff] [blame] | 36 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 37 | command: ["chown","-Rf","1000:1001", "/opt/app/"] |
efiacor | 2123fec | 2022-12-09 13:40:55 +0000 | [diff] [blame] | 38 | volumeMounts: |
| 39 | - name: {{ include "common.fullname" . }}-spool |
| 40 | mountPath: {{ .Values.persistence.spool.path }} |
| 41 | - name: {{ include "common.fullname" . }}-event-logs |
| 42 | mountPath: {{ .Values.persistence.event.path }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 43 | containers: |
| 44 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 6b09654 | 2020-11-21 22:51:24 +0100 | [diff] [blame] | 45 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 46 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 47 | ports: {{ include "common.containerPorts" . | nindent 12 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 48 | {{- if eq .Values.liveness.enabled true }} |
| 49 | livenessProbe: |
| 50 | tcpSocket: |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 51 | port: {{.Values.liveness.port}} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 52 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 53 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 54 | {{ end -}} |
| 55 | readinessProbe: |
| 56 | tcpSocket: |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 57 | port: {{.Values.readiness.port}} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 58 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 59 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
efiacor | 2123fec | 2022-12-09 13:40:55 +0000 | [diff] [blame] | 60 | volumeMounts: |
| 61 | - mountPath: {{ .Values.persistence.spool.path }} |
| 62 | name: {{ include "common.fullname" . }}-spool |
| 63 | - mountPath: {{ .Values.persistence.event.path }} |
| 64 | name: {{ include "common.fullname" . }}-event-logs |
efiacor | 2123fec | 2022-12-09 13:40:55 +0000 | [diff] [blame] | 65 | - mountPath: /opt/app/datartr/etc/node.properties |
| 66 | name: {{ include "common.fullname" . }}-config |
| 67 | subPath: node.properties |
| 68 | - mountPath: /opt/app/datartr/etc/logback.xml |
| 69 | name: {{ include "common.fullname" . }}-log-conf |
| 70 | subPath: logback.xml |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 71 | resources: {{ include "common.resources" . | nindent 12 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 72 | {{- if .Values.nodeSelector }} |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 73 | nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 74 | {{- end -}} |
| 75 | {{- if .Values.affinity }} |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 76 | affinity: {{ toYaml .Values.affinity | nindent 10 }} |
Sylvain Desbureaux | e615343 | 2021-02-04 18:26:23 +0100 | [diff] [blame] | 77 | {{- end }} |
Andreas Geissler | bd0d31a | 2024-03-20 09:51:32 +0100 | [diff] [blame] | 78 | {{- include "common.imagePullSecrets" . | nindent 6 }} |
farida azmy | 13388ba | 2021-03-17 11:33:28 +0200 | [diff] [blame] | 79 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
efiacor | 2123fec | 2022-12-09 13:40:55 +0000 | [diff] [blame] | 80 | volumes: |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 81 | - name: {{ include "common.fullname" . }}-config |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 82 | configMap: |
efiacor | 2123fec | 2022-12-09 13:40:55 +0000 | [diff] [blame] | 83 | name: {{ include "common.fullname" . }}-node-props |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 84 | items: |
| 85 | - key: node.properties |
| 86 | path: node.properties |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 87 | - name: {{ include "common.fullname" . }}-log-conf |
| 88 | configMap: |
| 89 | name: {{ include "common.fullname" . }}-log |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 90 | {{- if not .Values.persistence.enabled }} |
mprzybys | e1ea50d | 2020-01-31 10:09:02 +0000 | [diff] [blame] | 91 | - name: {{ include "common.fullname" . }}-event-logs |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 92 | emptyDir: {} |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 93 | - name: {{ include "common.fullname" . }}-spool |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 94 | emptyDir: {} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 95 | {{- end }} |
| 96 | {{- if .Values.persistence.enabled }} |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 97 | volumeClaimTemplates: |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 98 | - {{ include "common.PVCTemplate" (dict "dot" . "suffix" "spool" "persistenceInfos" .Values.persistence.spool) | indent 4 | trim }} |
| 99 | - {{ include "common.PVCTemplate" (dict "dot" . "suffix" "event-logs" "persistenceInfos" .Values.persistence.event) | indent 4 | trim }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 100 | {{- end }} |