blob: 10c2a054e7c7ff9fe4eef9e8bb4f3f87b8893c47 [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.
mmis95971132018-07-17 00:13:13 +01005# ================================================================================
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.
17#
18# SPDX-License-Identifier: Apache-2.0
19# ============LICENSE_END=========================================================
Jakub Latusekd71d26c2020-10-21 13:36:29 +020020*/}}
mmis95971132018-07-17 00:13:13 +010021
Grzegorz-Lis4fad3022020-07-31 10:18:21 +020022apiVersion: apps/v1
mmis95971132018-07-17 00:13:13 +010023kind: StatefulSet
24metadata:
25 name: {{ include "common.fullname" . }}
26 namespace: {{ include "common.namespace" . }}
27 labels:
28 app: {{ include "common.name" . }}
29 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010030 release: {{ include "common.release" . }}
mmis95971132018-07-17 00:13:13 +010031 heritage: {{ .Release.Service }}
32spec:
33 serviceName: {{ include "common.servicename" . }}
34 replicas: {{ .Values.replicaCount }}
35 selector:
36 matchLabels:
37 app: {{ include "common.name" . }}
38 template:
39 metadata:
40 labels:
41 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010042 release: {{ include "common.release" . }}
mmis95971132018-07-17 00:13:13 +010043 spec:
Dominik Mizynb8c44b42020-04-21 10:48:27 +020044 initContainers:
45 - command:
46 - sh
47 args:
48 - -c
Taka Choebd62952020-10-08 13:50:09 -040049 - "cd /config-input && for PFILE in `ls -1`; do envsubst <${PFILE} >/config/${PFILE}; done"
Dominik Mizynb8c44b42020-04-21 10:48:27 +020050 env:
51 - name: TRUSTSTORE_PASSWORD
52 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "truststore-pass" "key" "password") | indent 10 }}
jhhd4258672020-08-09 12:08:08 -050053 - name: KEYSTORE_PASSWORD
54 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "keystore-pass" "key" "password") | indent 10 }}
Dominik Mizynb8c44b42020-04-21 10:48:27 +020055 - name: RESTSERVER_USER
56 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-creds" "key" "login") | indent 10 }}
57 - name: RESTSERVER_PASSWORD
58 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-creds" "key" "password") | indent 10 }}
59 volumeMounts:
60 - mountPath: /config-input
61 name: apexconfig-input
62 - mountPath: /config
63 name: apexconfig
Sylvain Desbureaux7c8c6862020-11-19 18:02:37 +010064 image: {{ include "repositoryGenerator.image.envsubst" . }}
Dominik Mizynb8c44b42020-04-21 10:48:27 +020065 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
66 name: {{ include "common.name" . }}-update-config
jhhd4258672020-08-09 12:08:08 -050067{{ include "common.certInitializer.initContainer" . | indent 6 }}
mmis95971132018-07-17 00:13:13 +010068 containers:
69 - name: {{ include "common.name" . }}
Sylvain Desbureaux7c8c6862020-11-19 18:02:37 +010070 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
mmis95971132018-07-17 00:13:13 +010071 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Taka Cho9658ce82020-12-10 14:34:18 -050072 command: ["sh","-c"]
jhhd4258672020-08-09 12:08:08 -050073 args: ["if [ -f {{ .Values.certInitializer.credsPath }}/.ci ]; then \
74 source {{ .Values.certInitializer.credsPath }}/.ci; fi;\
75 /opt/app/policy/apex-pdp/bin/apexOnapPf.sh -c /home/apexuser/config/OnapPfConfig.json"]
mmis95971132018-07-17 00:13:13 +010076 ports:
77 - containerPort: {{ .Values.service.externalPort }}
78 {{- if eq .Values.liveness.enabled true }}
79 livenessProbe:
80 tcpSocket:
81 port: {{ .Values.service.externalPort }}
82 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
83 periodSeconds: {{ .Values.liveness.periodSeconds }}
84 {{- end }}
85 readinessProbe:
86 tcpSocket:
87 port: {{ .Values.service.externalPort }}
88 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
89 periodSeconds: {{ .Values.readiness.periodSeconds }}
90 env:
91 - name: REPLICAS
92 value: "{{ .Values.replicaCount }}"
jhhd4258672020-08-09 12:08:08 -050093{{- if not .Values.global.aafEnabled }}
94 - name: KEYSTORE_PASSWORD
95 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "keystore-pass" "key" "password") | indent 12 }}
96 - name: TRUSTSTORE_PASSWORD
97 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "truststore-pass" "key" "password") | indent 12 }}
98{{- end }}
mmis95971132018-07-17 00:13:13 +010099 volumeMounts:
jhhd4258672020-08-09 12:08:08 -0500100{{ include "common.certInitializer.volumeMount" . | indent 10 }}
mmis95971132018-07-17 00:13:13 +0100101 - mountPath: /etc/localtime
102 name: localtime
103 readOnly: true
104 - mountPath: /var/log/onap
105 name: policy-logs
mmis0d92fb72018-09-19 12:44:35 +0100106 - mountPath: /home/apexuser/config
mmis95971132018-07-17 00:13:13 +0100107 name: apexconfig
mmis95971132018-07-17 00:13:13 +0100108 resources:
jhhd4258672020-08-09 12:08:08 -0500109{{ include "common.resources" . }}
mmis95971132018-07-17 00:13:13 +0100110 {{- if .Values.nodeSelector }}
111 nodeSelector:
112{{ toYaml .Values.nodeSelector | indent 10 }}
113 {{- end -}}
114 {{- if .Values.affinity }}
115 affinity:
116{{ toYaml .Values.affinity | indent 10 }}
117 {{- end }}
118 volumes:
jhhd4258672020-08-09 12:08:08 -0500119{{ include "common.certInitializer.volumes" . | indent 8 }}
mmis95971132018-07-17 00:13:13 +0100120 - name: localtime
121 hostPath:
122 path: /etc/localtime
123 - name: policy-logs
124 emptyDir: {}
Dominik Mizynb8c44b42020-04-21 10:48:27 +0200125 - name: apexconfig-input
mmis95971132018-07-17 00:13:13 +0100126 configMap:
127 name: {{ include "common.fullname" . }}-configmap
mmis0d92fb72018-09-19 12:44:35 +0100128 defaultMode: 0755
Dominik Mizynb8c44b42020-04-21 10:48:27 +0200129 - name: apexconfig
130 emptyDir:
131 medium: Memory
mmis95971132018-07-17 00:13:13 +0100132 imagePullSecrets:
133 - name: "{{ include "common.namespace" . }}-docker-registry-key"