blob: dd1c047aadcff700b8fcdb5a191574f99824a355 [file] [log] [blame]
Jakub Latusekd71d26c2020-10-21 13:36:29 +02001{{/*
mmis95971132018-07-17 00:13:13 +01002# ============LICENSE_START=======================================================
3# Copyright (C) 2018 Ericsson. All rights reserved.
jhhd4258672020-08-09 12:08:08 -05004# Modifications Copyright (C) 2020 AT&T Intellectual Property.
Sirisha_Manchikantib402a592022-09-09 12:01:20 +01005# Modifications Copyright © 2022 Nordix Foundation
mmis95971132018-07-17 00:13:13 +01006# ================================================================================
7# Licensed under the Apache License, Version 2.0 (the "License");
8# you may not use this file except in compliance with the License.
9# You may obtain a copy of the License at
10#
11# http://www.apache.org/licenses/LICENSE-2.0
12#
13# Unless required by applicable law or agreed to in writing, software
14# distributed under the License is distributed on an "AS IS" BASIS,
15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16# See the License for the specific language governing permissions and
17# limitations under the License.
18#
19# SPDX-License-Identifier: Apache-2.0
20# ============LICENSE_END=========================================================
Jakub Latusekd71d26c2020-10-21 13:36:29 +020021*/}}
mmis95971132018-07-17 00:13:13 +010022
Grzegorz-Lis4fad3022020-07-31 10:18:21 +020023apiVersion: apps/v1
mmis95971132018-07-17 00:13:13 +010024kind: StatefulSet
25metadata:
26 name: {{ include "common.fullname" . }}
27 namespace: {{ include "common.namespace" . }}
28 labels:
29 app: {{ include "common.name" . }}
30 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010031 release: {{ include "common.release" . }}
mmis95971132018-07-17 00:13:13 +010032 heritage: {{ .Release.Service }}
33spec:
34 serviceName: {{ include "common.servicename" . }}
35 replicas: {{ .Values.replicaCount }}
36 selector:
37 matchLabels:
38 app: {{ include "common.name" . }}
39 template:
40 metadata:
41 labels:
42 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010043 release: {{ include "common.release" . }}
mmis95971132018-07-17 00:13:13 +010044 spec:
Dominik Mizynb8c44b42020-04-21 10:48:27 +020045 initContainers:
46 - command:
47 - sh
48 args:
49 - -c
Taka Choebd62952020-10-08 13:50:09 -040050 - "cd /config-input && for PFILE in `ls -1`; do envsubst <${PFILE} >/config/${PFILE}; done"
Dominik Mizynb8c44b42020-04-21 10:48:27 +020051 env:
52 - name: TRUSTSTORE_PASSWORD
53 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "truststore-pass" "key" "password") | indent 10 }}
jhhd4258672020-08-09 12:08:08 -050054 - name: KEYSTORE_PASSWORD
55 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "keystore-pass" "key" "password") | indent 10 }}
Dominik Mizynb8c44b42020-04-21 10:48:27 +020056 - name: RESTSERVER_USER
57 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-creds" "key" "login") | indent 10 }}
58 - name: RESTSERVER_PASSWORD
59 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-creds" "key" "password") | indent 10 }}
Sirisha_Manchikantib402a592022-09-09 12:01:20 +010060{{- if .Values.config.useStrimziKafka }}
61 - name: JAASLOGIN
62 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "policy-kafka-user" "key" "sasl.jaas.config") | indent 10 }}
63{{- end }}
Dominik Mizynb8c44b42020-04-21 10:48:27 +020064 volumeMounts:
65 - mountPath: /config-input
66 name: apexconfig-input
67 - mountPath: /config
68 name: apexconfig
Sylvain Desbureaux7c8c6862020-11-19 18:02:37 +010069 image: {{ include "repositoryGenerator.image.envsubst" . }}
Dominik Mizynb8c44b42020-04-21 10:48:27 +020070 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
71 name: {{ include "common.name" . }}-update-config
jhhd4258672020-08-09 12:08:08 -050072{{ include "common.certInitializer.initContainer" . | indent 6 }}
mmis95971132018-07-17 00:13:13 +010073 containers:
74 - name: {{ include "common.name" . }}
Sylvain Desbureaux7c8c6862020-11-19 18:02:37 +010075 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
mmis95971132018-07-17 00:13:13 +010076 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Taka Cho9658ce82020-12-10 14:34:18 -050077 command: ["sh","-c"]
jhhd4258672020-08-09 12:08:08 -050078 args: ["if [ -f {{ .Values.certInitializer.credsPath }}/.ci ]; then \
Guillaume Lambert2b6f82c2021-03-02 21:45:00 +010079 . {{ .Values.certInitializer.credsPath }}/.ci; fi;\
jhhd4258672020-08-09 12:08:08 -050080 /opt/app/policy/apex-pdp/bin/apexOnapPf.sh -c /home/apexuser/config/OnapPfConfig.json"]
mmis95971132018-07-17 00:13:13 +010081 ports:
82 - containerPort: {{ .Values.service.externalPort }}
83 {{- if eq .Values.liveness.enabled true }}
84 livenessProbe:
85 tcpSocket:
86 port: {{ .Values.service.externalPort }}
87 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
88 periodSeconds: {{ .Values.liveness.periodSeconds }}
89 {{- end }}
90 readinessProbe:
91 tcpSocket:
92 port: {{ .Values.service.externalPort }}
93 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
94 periodSeconds: {{ .Values.readiness.periodSeconds }}
95 env:
96 - name: REPLICAS
97 value: "{{ .Values.replicaCount }}"
jhhd4258672020-08-09 12:08:08 -050098{{- if not .Values.global.aafEnabled }}
99 - name: KEYSTORE_PASSWORD
100 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "keystore-pass" "key" "password") | indent 12 }}
101 - name: TRUSTSTORE_PASSWORD
102 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "truststore-pass" "key" "password") | indent 12 }}
103{{- end }}
mmis95971132018-07-17 00:13:13 +0100104 volumeMounts:
jhhd4258672020-08-09 12:08:08 -0500105{{ include "common.certInitializer.volumeMount" . | indent 10 }}
mmis95971132018-07-17 00:13:13 +0100106 - mountPath: /etc/localtime
107 name: localtime
108 readOnly: true
109 - mountPath: /var/log/onap
110 name: policy-logs
mmis0d92fb72018-09-19 12:44:35 +0100111 - mountPath: /home/apexuser/config
mmis95971132018-07-17 00:13:13 +0100112 name: apexconfig
miroslavmasaryka7ac7f02023-03-01 14:12:26 +0100113 resources: {{ include "common.resources" . | nindent 12 }}
mmis95971132018-07-17 00:13:13 +0100114 {{- if .Values.nodeSelector }}
115 nodeSelector:
116{{ toYaml .Values.nodeSelector | indent 10 }}
117 {{- end -}}
118 {{- if .Values.affinity }}
119 affinity:
120{{ toYaml .Values.affinity | indent 10 }}
121 {{- end }}
farida azmyc1178372021-04-11 12:55:33 +0200122 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
mmis95971132018-07-17 00:13:13 +0100123 volumes:
jhhd4258672020-08-09 12:08:08 -0500124{{ include "common.certInitializer.volumes" . | indent 8 }}
mmis95971132018-07-17 00:13:13 +0100125 - name: localtime
126 hostPath:
127 path: /etc/localtime
128 - name: policy-logs
129 emptyDir: {}
Dominik Mizynb8c44b42020-04-21 10:48:27 +0200130 - name: apexconfig-input
mmis95971132018-07-17 00:13:13 +0100131 configMap:
132 name: {{ include "common.fullname" . }}-configmap
mmis0d92fb72018-09-19 12:44:35 +0100133 defaultMode: 0755
Dominik Mizynb8c44b42020-04-21 10:48:27 +0200134 - name: apexconfig
135 emptyDir:
136 medium: Memory
mmis95971132018-07-17 00:13:13 +0100137 imagePullSecrets:
138 - name: "{{ include "common.namespace" . }}-docker-registry-key"