blob: 4ce90dad1aea947e45dafef1f0cb8fb783b27498 [file] [log] [blame]
Jakub Latusekd71d26c2020-10-21 13:36:29 +02001{{/*
mayankg2703ced85142018-03-20 05:42:53 +00002# Copyright © 2017 Amdocs, Bell Canada
jhh0d1c0e82022-04-08 14:36:15 -05003# Modifications Copyright © 2018-2020, 2022 AT&T Intellectual Property
mayankg2703ced85142018-03-20 05:42:53 +00004#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
Jakub Latusekd71d26c2020-10-21 13:36:29 +020016*/}}
mayankg2703ced85142018-03-20 05:42:53 +000017
Grzegorz-Lis4fad3022020-07-31 10:18:21 +020018apiVersion: apps/v1
mayankg2703c7985462018-03-29 14:24:23 +000019kind: StatefulSet
Andreas Geisslerf10c5552023-03-21 18:09:46 +010020metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
mayankg2703ced85142018-03-20 05:42:53 +000021spec:
Andreas Geisslerf10c5552023-03-21 18:09:46 +010022 selector: {{- include "common.selectors" . | nindent 4 }}
Mahendra Raghuwanshic1395ec2018-04-26 03:19:03 +000023 serviceName: {{ include "common.servicename" . }}
mayankg2703ced85142018-03-20 05:42:53 +000024 replicas: {{ .Values.replicaCount }}
25 template:
Andreas Geisslerf10c5552023-03-21 18:09:46 +010026 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
mayankg2703ced85142018-03-20 05:42:53 +000027 spec:
28 initContainers:
29 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020030 - /app/ready.py
jhhd4258672020-08-09 12:08:08 -050031 args:
32 - --job-name
33 - {{ include "common.release" . }}-policy-galera-config
34 env:
35 - name: NAMESPACE
36 valueFrom:
37 fieldRef:
38 apiVersion: v1
39 fieldPath: metadata.namespace
Sylvain Desbureaux7c8c6862020-11-19 18:02:37 +010040 image: {{ include "repositoryGenerator.image.readiness" . }}
jhhd4258672020-08-09 12:08:08 -050041 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
42 name: {{ include "common.name" . }}-db-readiness
43{{- if not .Values.nexus.offline }}
44 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020045 - /app/ready.py
mayankg2703ced85142018-03-20 05:42:53 +000046 args:
47 - --container-name
jhhd4258672020-08-09 12:08:08 -050048 - {{ .Values.nexus.name }}
mayankg2703ced85142018-03-20 05:42:53 +000049 env:
50 - name: NAMESPACE
51 valueFrom:
52 fieldRef:
53 apiVersion: v1
54 fieldPath: metadata.namespace
Sylvain Desbureaux7c8c6862020-11-19 18:02:37 +010055 image: {{ include "repositoryGenerator.image.readiness" . }}
mayankg2703ced85142018-03-20 05:42:53 +000056 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
57 name: {{ include "common.name" . }}-readiness
jhhd4258672020-08-09 12:08:08 -050058{{- end }}
mayankg2703ced85142018-03-20 05:42:53 +000059 containers:
60 - name: {{ include "common.name" . }}
Sylvain Desbureaux7c8c6862020-11-19 18:02:37 +010061 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
mayankg2703ced85142018-03-20 05:42:53 +000062 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Taka Cho9658ce82020-12-10 14:34:18 -050063 command: ["sh","-c"]
Andreas Geisslerf10c5552023-03-21 18:09:46 +010064 args: ["/opt/app/policy/bin/pdpd-cl-entrypoint.sh boot"]
65 ports: {{ include "common.containerPorts" . | nindent 12 }}
mayankg2703ced85142018-03-20 05:42:53 +000066 {{- if eq .Values.liveness.enabled true }}
67 livenessProbe:
jhh0d1c0e82022-04-08 14:36:15 -050068 httpGet:
69 path: /healthcheck/controllers
70 port: 6968
mayankg2703ced85142018-03-20 05:42:53 +000071 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
72 periodSeconds: {{ .Values.liveness.periodSeconds }}
jhh0d1c0e82022-04-08 14:36:15 -050073 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
mayankg2703ced85142018-03-20 05:42:53 +000074 {{- end }}
75 readinessProbe:
76 tcpSocket:
Andreas Geisslerf10c5552023-03-21 18:09:46 +010077 port: {{ .Values.service.internalPort }}
mayankg2703ced85142018-03-20 05:42:53 +000078 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
79 periodSeconds: {{ .Values.readiness.periodSeconds }}
80 env:
81 - name: REPLICAS
82 value: "{{ .Values.replicaCount }}"
Krzysztof Opasiak68b1c922020-03-26 23:59:36 +010083 - name: SQL_USER
Krzysztof Opasiak4372e832020-09-01 19:17:20 +020084 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }}
Krzysztof Opasiak68b1c922020-03-26 23:59:36 +010085 - name: SQL_PASSWORD
Krzysztof Opasiak4372e832020-09-01 19:17:20 +020086 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }}
mayankg2703ced85142018-03-20 05:42:53 +000087 volumeMounts:
88 - mountPath: /etc/localtime
89 name: localtime
90 readOnly: true
jhh01096592019-09-04 07:47:25 -050091 {{- range $path, $bytes := .Files.Glob "resources/secrets/*" }}
92 - mountPath: /tmp/policy-install/config/{{ base $path }}
mayankg2703ced85142018-03-20 05:42:53 +000093 name: drools-secret
jhh01096592019-09-04 07:47:25 -050094 subPath: {{ base $path }}
95 {{- end }}
96 {{- range $path, $bytes := .Files.Glob "resources/configmaps/*" }}
97 - mountPath: /tmp/policy-install/config/{{ base $path }}
Jorge Hernandez328eadb2018-05-15 07:52:21 -050098 name: drools-config
jhh01096592019-09-04 07:47:25 -050099 subPath: {{ base $path }}
100 {{- end }}
miroslavmasaryka7ac7f02023-03-01 14:12:26 +0100101 resources: {{ include "common.resources" . | nindent 12 }}
mayankg2703ced85142018-03-20 05:42:53 +0000102 {{- if .Values.nodeSelector }}
mayankg2703ced85142018-03-20 05:42:53 +0000103 nodeSelector:
104{{ toYaml .Values.nodeSelector | indent 10 }}
105 {{- end -}}
106 {{- if .Values.affinity }}
107 affinity:
108{{ toYaml .Values.affinity | indent 10 }}
109 {{- end }}
farida azmyc1178372021-04-11 12:55:33 +0200110 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
mayankg2703ced85142018-03-20 05:42:53 +0000111 volumes:
112 - name: localtime
113 hostPath:
114 path: /etc/localtime
mayankg2703ced85142018-03-20 05:42:53 +0000115 - name: drools-config
116 configMap:
117 name: {{ include "common.fullname" . }}-configmap
118 items:
jhh01096592019-09-04 07:47:25 -0500119 {{- range $path, $bytes := .Files.Glob "resources/configmaps/*" }}
120 - key: {{ base $path }}
121 path: {{ base $path }}
mayankg2703ced85142018-03-20 05:42:53 +0000122 mode: 0755
jhh01096592019-09-04 07:47:25 -0500123 {{- end }}
mayankg2703ced85142018-03-20 05:42:53 +0000124 - name: drools-secret
125 secret:
126 secretName: {{ include "common.fullname" . }}-secret
127 items:
jhh01096592019-09-04 07:47:25 -0500128 {{- range $path, $bytes := .Files.Glob "resources/secrets/*" }}
129 - key: {{ base $path }}
130 path: {{ base $path }}
mayankg2703ced85142018-03-20 05:42:53 +0000131 mode: 0644
jhh01096592019-09-04 07:47:25 -0500132 {{- end }}
mayankg2703ced85142018-03-20 05:42:53 +0000133 imagePullSecrets:
134 - name: "{{ include "common.namespace" . }}-docker-registry-key"