blob: 3f25d964e482d16f0fc7fefdacb0c2e95e13332c [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
Andreas Geissler57681132024-07-29 10:18:26 +02004# Modifications Copyright © 2024 Deutsche Telekom
mayankg2703ced85142018-03-20 05:42:53 +00005#
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
Jakub Latusekd71d26c2020-10-21 13:36:29 +020017*/}}
mayankg2703ced85142018-03-20 05:42:53 +000018
Grzegorz-Lis4fad3022020-07-31 10:18:21 +020019apiVersion: apps/v1
mayankg2703c7985462018-03-29 14:24:23 +000020kind: StatefulSet
Andreas Geisslerf10c5552023-03-21 18:09:46 +010021metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
mayankg2703ced85142018-03-20 05:42:53 +000022spec:
Andreas Geisslerf10c5552023-03-21 18:09:46 +010023 selector: {{- include "common.selectors" . | nindent 4 }}
Mahendra Raghuwanshic1395ec2018-04-26 03:19:03 +000024 serviceName: {{ include "common.servicename" . }}
mayankg2703ced85142018-03-20 05:42:53 +000025 replicas: {{ .Values.replicaCount }}
26 template:
Andreas Geisslerf10c5552023-03-21 18:09:46 +010027 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
mayankg2703ced85142018-03-20 05:42:53 +000028 spec:
Andreas Geissler57681132024-07-29 10:18:26 +020029 {{ include "common.podSecurityContext" . | indent 6 | trim }}
mayankg2703ced85142018-03-20 05:42:53 +000030 initContainers:
31 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020032 - /app/ready.py
jhhd4258672020-08-09 12:08:08 -050033 args:
34 - --job-name
35 - {{ include "common.release" . }}-policy-galera-config
36 env:
37 - name: NAMESPACE
38 valueFrom:
39 fieldRef:
40 apiVersion: v1
41 fieldPath: metadata.namespace
Sylvain Desbureaux7c8c6862020-11-19 18:02:37 +010042 image: {{ include "repositoryGenerator.image.readiness" . }}
jhhd4258672020-08-09 12:08:08 -050043 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Andreas Geissler57681132024-07-29 10:18:26 +020044 {{ include "common.containerSecurityContext" . | indent 8 | trim }}
jhhd4258672020-08-09 12:08:08 -050045 name: {{ include "common.name" . }}-db-readiness
Andreas Geissler47537432024-02-27 08:55:23 +010046 resources:
47 limits:
48 cpu: "100m"
Andreas Geissler8cbb3d92024-03-12 16:44:56 +010049 memory: "500Mi"
Andreas Geissler47537432024-02-27 08:55:23 +010050 requests:
51 cpu: "3m"
Andreas Geissler8cbb3d92024-03-12 16:44:56 +010052 memory: "20Mi"
jhhd4258672020-08-09 12:08:08 -050053{{- if not .Values.nexus.offline }}
54 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020055 - /app/ready.py
mayankg2703ced85142018-03-20 05:42:53 +000056 args:
Andreas Geissleree119102024-04-11 13:53:39 +020057 - --service-name
jhhd4258672020-08-09 12:08:08 -050058 - {{ .Values.nexus.name }}
mayankg2703ced85142018-03-20 05:42:53 +000059 env:
60 - name: NAMESPACE
61 valueFrom:
62 fieldRef:
63 apiVersion: v1
64 fieldPath: metadata.namespace
rameshiyer27bc8a6a42024-03-11 17:18:11 +000065 - name: KAFKA_URL
66 value: {{ include "common.release" . }}-{{ .Values.global.kafkaBootstrap }}
67 - name: SASL
68 value: {{ .Values.kafkaUser.authenticationType | upper }}
69 - name: GROUP_ID
70 value: {{ .Values.config.kafka.consumer.groupId }}
71 - name: PAP_TOPIC
72 value: {{ .Values.config.app.listener.policyPdpPapTopic }}
Sylvain Desbureaux7c8c6862020-11-19 18:02:37 +010073 image: {{ include "repositoryGenerator.image.readiness" . }}
mayankg2703ced85142018-03-20 05:42:53 +000074 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Andreas Geissler57681132024-07-29 10:18:26 +020075 {{ include "common.containerSecurityContext" . | indent 8 | trim }}
mayankg2703ced85142018-03-20 05:42:53 +000076 name: {{ include "common.name" . }}-readiness
Andreas Geissler47537432024-02-27 08:55:23 +010077 resources:
78 limits:
79 cpu: "100m"
Andreas Geissler8cbb3d92024-03-12 16:44:56 +010080 memory: "500Mi"
Andreas Geissler47537432024-02-27 08:55:23 +010081 requests:
82 cpu: "3m"
Andreas Geissler8cbb3d92024-03-12 16:44:56 +010083 memory: "20Mi"
jhhd4258672020-08-09 12:08:08 -050084{{- end }}
mayankg2703ced85142018-03-20 05:42:53 +000085 containers:
86 - name: {{ include "common.name" . }}
Andreas Geissler57681132024-07-29 10:18:26 +020087 {{ include "common.containerSecurityContext" . | indent 10 | trim }}
Sylvain Desbureaux7c8c6862020-11-19 18:02:37 +010088 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
mayankg2703ced85142018-03-20 05:42:53 +000089 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Taka Cho9658ce82020-12-10 14:34:18 -050090 command: ["sh","-c"]
Andreas Geisslerf10c5552023-03-21 18:09:46 +010091 args: ["/opt/app/policy/bin/pdpd-cl-entrypoint.sh boot"]
92 ports: {{ include "common.containerPorts" . | nindent 12 }}
mayankg2703ced85142018-03-20 05:42:53 +000093 {{- if eq .Values.liveness.enabled true }}
94 livenessProbe:
jhh0d1c0e82022-04-08 14:36:15 -050095 httpGet:
96 path: /healthcheck/controllers
97 port: 6968
mayankg2703ced85142018-03-20 05:42:53 +000098 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
99 periodSeconds: {{ .Values.liveness.periodSeconds }}
jhh0d1c0e82022-04-08 14:36:15 -0500100 timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
mayankg2703ced85142018-03-20 05:42:53 +0000101 {{- end }}
102 readinessProbe:
103 tcpSocket:
Andreas Geisslerf10c5552023-03-21 18:09:46 +0100104 port: {{ .Values.service.internalPort }}
mayankg2703ced85142018-03-20 05:42:53 +0000105 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
106 periodSeconds: {{ .Values.readiness.periodSeconds }}
107 env:
108 - name: REPLICAS
109 value: "{{ .Values.replicaCount }}"
Krzysztof Opasiak68b1c922020-03-26 23:59:36 +0100110 - name: SQL_USER
Krzysztof Opasiak4372e832020-09-01 19:17:20 +0200111 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }}
Krzysztof Opasiak68b1c922020-03-26 23:59:36 +0100112 - name: SQL_PASSWORD
Krzysztof Opasiak4372e832020-09-01 19:17:20 +0200113 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }}
mayankg2703ced85142018-03-20 05:42:53 +0000114 volumeMounts:
Andreas Geissler57681132024-07-29 10:18:26 +0200115 - name: logs
116 mountPath: /var/log/onap
117 - name: empty-dir
118 mountPath: /tmp
119 subPath: tmp-dir
120 - mountPath: /opt/app/policy/etc/profile.d/base.conf
121 subPath: base.conf
122 name: drools-config
jhh01096592019-09-04 07:47:25 -0500123 {{- range $path, $bytes := .Files.Glob "resources/secrets/*" }}
124 - mountPath: /tmp/policy-install/config/{{ base $path }}
mayankg2703ced85142018-03-20 05:42:53 +0000125 name: drools-secret
jhh01096592019-09-04 07:47:25 -0500126 subPath: {{ base $path }}
127 {{- end }}
128 {{- range $path, $bytes := .Files.Glob "resources/configmaps/*" }}
129 - mountPath: /tmp/policy-install/config/{{ base $path }}
Jorge Hernandez328eadb2018-05-15 07:52:21 -0500130 name: drools-config
jhh01096592019-09-04 07:47:25 -0500131 subPath: {{ base $path }}
132 {{- end }}
miroslavmasaryka7ac7f02023-03-01 14:12:26 +0100133 resources: {{ include "common.resources" . | nindent 12 }}
mayankg2703ced85142018-03-20 05:42:53 +0000134 {{- if .Values.nodeSelector }}
mayankg2703ced85142018-03-20 05:42:53 +0000135 nodeSelector:
136{{ toYaml .Values.nodeSelector | indent 10 }}
137 {{- end -}}
138 {{- if .Values.affinity }}
139 affinity:
140{{ toYaml .Values.affinity | indent 10 }}
141 {{- end }}
farida azmyc1178372021-04-11 12:55:33 +0200142 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
mayankg2703ced85142018-03-20 05:42:53 +0000143 volumes:
Andreas Geissler57681132024-07-29 10:18:26 +0200144 - name: empty-dir
145 emptyDir:
146 sizeLimit: {{ .Values.dirSizes.emptyDir.sizeLimit }}
147 - name: logs
148 emptyDir:
149 sizeLimit: {{ .Values.dirSizes.logDir.sizeLimit }}
mayankg2703ced85142018-03-20 05:42:53 +0000150 - name: drools-config
151 configMap:
152 name: {{ include "common.fullname" . }}-configmap
153 items:
jhh01096592019-09-04 07:47:25 -0500154 {{- range $path, $bytes := .Files.Glob "resources/configmaps/*" }}
155 - key: {{ base $path }}
156 path: {{ base $path }}
mayankg2703ced85142018-03-20 05:42:53 +0000157 mode: 0755
jhh01096592019-09-04 07:47:25 -0500158 {{- end }}
mayankg2703ced85142018-03-20 05:42:53 +0000159 - name: drools-secret
160 secret:
161 secretName: {{ include "common.fullname" . }}-secret
162 items:
jhh01096592019-09-04 07:47:25 -0500163 {{- range $path, $bytes := .Files.Glob "resources/secrets/*" }}
164 - key: {{ base $path }}
165 path: {{ base $path }}
mayankg2703ced85142018-03-20 05:42:53 +0000166 mode: 0644
jhh01096592019-09-04 07:47:25 -0500167 {{- end }}
Andreas Geisslerbd0d31a2024-03-20 09:51:32 +0100168 {{- include "common.imagePullSecrets" . | nindent 6 }}