blob: e68c9fd8d9d1bb9ed4df23f7acbc9ade8f67a030 [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
Andreas Geisslerf10c5552023-03-21 18:09:46 +01006# Modification (C) 2023 Deutsche Telekom. All rights reserved.
mmis95971132018-07-17 00:13:13 +01007# ================================================================================
8# Licensed under the Apache License, Version 2.0 (the "License");
9# you may not use this file except in compliance with the License.
10# You may obtain a copy of the License at
11#
12# http://www.apache.org/licenses/LICENSE-2.0
13#
14# Unless required by applicable law or agreed to in writing, software
15# distributed under the License is distributed on an "AS IS" BASIS,
16# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17# See the License for the specific language governing permissions and
18# limitations under the License.
19#
20# SPDX-License-Identifier: Apache-2.0
21# ============LICENSE_END=========================================================
Jakub Latusekd71d26c2020-10-21 13:36:29 +020022*/}}
mmis95971132018-07-17 00:13:13 +010023
Grzegorz-Lis4fad3022020-07-31 10:18:21 +020024apiVersion: apps/v1
saul.gillef208b02023-04-26 16:16:05 +010025kind: Deployment
Andreas Geisslerf10c5552023-03-21 18:09:46 +010026metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
mmis95971132018-07-17 00:13:13 +010027spec:
Andreas Geisslerf10c5552023-03-21 18:09:46 +010028 selector: {{- include "common.selectors" . | nindent 4 }}
mmis95971132018-07-17 00:13:13 +010029 replicas: {{ .Values.replicaCount }}
mmis95971132018-07-17 00:13:13 +010030 template:
Andreas Geisslerf10c5552023-03-21 18:09:46 +010031 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
mmis95971132018-07-17 00:13:13 +010032 spec:
Dominik Mizynb8c44b42020-04-21 10:48:27 +020033 initContainers:
saul.gillef208b02023-04-26 16:16:05 +010034{{- if not .Values.global.useStrimziKafkaPf }}
35{{ include "common.readinessCheck.waitFor" . | nindent 6 }}
36{{- end }}
37 - command: ["/bin/sh", "-cx"]
38{{- if .Values.global.useStrimziKafkaPf }}
Dominik Mizynb8c44b42020-04-21 10:48:27 +020039 args:
saul.gillef208b02023-04-26 16:16:05 +010040 - JAASLOGIN=`echo $JAASLOGIN | tr -d '"'`;
41 cd /config-input && for PFILE in `ls -1`;
42 do envsubst <${PFILE} >/config/${PFILE}; done
43{{ else }}
44 args:
45 - cd /config-input && for PFILE in `ls -1`;
46 do envsubst <${PFILE} >/config/${PFILE}; done
47{{ end }}
Dominik Mizynb8c44b42020-04-21 10:48:27 +020048 env:
Dominik Mizynb8c44b42020-04-21 10:48:27 +020049 - name: RESTSERVER_USER
50 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-creds" "key" "login") | indent 10 }}
51 - name: RESTSERVER_PASSWORD
52 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-creds" "key" "password") | indent 10 }}
saul.gillef208b02023-04-26 16:16:05 +010053{{- if .Values.global.useStrimziKafkaPf }}
Sirisha_Manchikantib402a592022-09-09 12:01:20 +010054 - name: JAASLOGIN
saul.gillef208b02023-04-26 16:16:05 +010055 valueFrom:
56 secretKeyRef:
57 name: {{ include "common.name" . }}-ku
58 key: sasl.jaas.config
59 - name: KAFKA_URL
60 value: {{ include "common.release" . }}-strimzi-kafka-bootstrap:9092
61 - name: SASL
62 value: {{ .Values.kafkaUser.authenticationType | upper }}
63 - name: GROUP_ID
64 value: {{ .Values.config.kafka.consumer.groupId }}
65 - name: PAP_TOPIC
66 value: {{ .Values.config.app.listener.policyPdpPapTopic }}
67{{ else }}
68 - name: KAFKA_URL
69 value: message-router
70 - name: PAP_TOPIC
71 value: {{ .Values.config.app.listener.policyPdpPapTopic | upper }}
Sirisha_Manchikantib402a592022-09-09 12:01:20 +010072{{- end }}
Dominik Mizynb8c44b42020-04-21 10:48:27 +020073 volumeMounts:
74 - mountPath: /config-input
75 name: apexconfig-input
76 - mountPath: /config
77 name: apexconfig
Sylvain Desbureaux7c8c6862020-11-19 18:02:37 +010078 image: {{ include "repositoryGenerator.image.envsubst" . }}
Dominik Mizynb8c44b42020-04-21 10:48:27 +020079 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
80 name: {{ include "common.name" . }}-update-config
mmis95971132018-07-17 00:13:13 +010081 containers:
82 - name: {{ include "common.name" . }}
Sylvain Desbureaux7c8c6862020-11-19 18:02:37 +010083 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
mmis95971132018-07-17 00:13:13 +010084 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
saul.gillef208b02023-04-26 16:16:05 +010085 command: [ "/bin/sh", "-cx" ]
86 args:
87 - id apexuser;
88 cat /home/apexuser/config/OnapPfConfig.json;
89 /opt/app/policy/apex-pdp/bin/apexOnapPf.sh -c /home/apexuser/config/OnapPfConfig.json
Andreas Geisslerf10c5552023-03-21 18:09:46 +010090 ports: {{ include "common.containerPorts" . | nindent 12 }}
mmis95971132018-07-17 00:13:13 +010091 {{- if eq .Values.liveness.enabled true }}
92 livenessProbe:
93 tcpSocket:
Andreas Geisslerf10c5552023-03-21 18:09:46 +010094 port: {{ .Values.service.internalPort }}
mmis95971132018-07-17 00:13:13 +010095 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
96 periodSeconds: {{ .Values.liveness.periodSeconds }}
97 {{- end }}
98 readinessProbe:
99 tcpSocket:
Andreas Geisslerf10c5552023-03-21 18:09:46 +0100100 port: {{ .Values.service.internalPort }}
mmis95971132018-07-17 00:13:13 +0100101 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
102 periodSeconds: {{ .Values.readiness.periodSeconds }}
103 env:
104 - name: REPLICAS
105 value: "{{ .Values.replicaCount }}"
106 volumeMounts:
107 - mountPath: /etc/localtime
108 name: localtime
109 readOnly: true
110 - mountPath: /var/log/onap
111 name: policy-logs
mmis0d92fb72018-09-19 12:44:35 +0100112 - mountPath: /home/apexuser/config
mmis95971132018-07-17 00:13:13 +0100113 name: apexconfig
miroslavmasaryka7ac7f02023-03-01 14:12:26 +0100114 resources: {{ include "common.resources" . | nindent 12 }}
saul.gillef208b02023-04-26 16:16:05 +0100115 {{- if .Values.nodeSelector }}
116 nodeSelector:
mmis95971132018-07-17 00:13:13 +0100117{{ toYaml .Values.nodeSelector | indent 10 }}
118 {{- end -}}
saul.gillef208b02023-04-26 16:16:05 +0100119 {{- if .Values.affinity }}
120 affinity:
mmis95971132018-07-17 00:13:13 +0100121{{ toYaml .Values.affinity | indent 10 }}
122 {{- end }}
farida azmyc1178372021-04-11 12:55:33 +0200123 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
mmis95971132018-07-17 00:13:13 +0100124 volumes:
125 - 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"