blob: c29dca9c7d01273bf5aa1e7b68d9db3dfee6c6b0 [file] [log] [blame]
rameshiyer2701b8cc02021-09-21 15:07:50 +01001{{/*
2# ============LICENSE_START=======================================================
efiacor6910bbe2023-03-03 14:53:16 +00003# Copyright (C) 2021-2023 Nordix Foundation.
Andreas Geissler57681132024-07-29 10:18:26 +02004# Modifications Copyright © 2024 Deutsche Telekom
rameshiyer2701b8cc02021-09-21 15:07:50 +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=========================================================
20*/}}
21
22apiVersion: apps/v1
23kind: Deployment
24metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
25spec:
26 selector: {{- include "common.selectors" . | nindent 4 }}
27 replicas: {{ .Values.replicaCount }}
28 template:
29 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
30 spec:
Andreas Geissler57681132024-07-29 10:18:26 +020031 {{ include "common.podSecurityContext" . | indent 6 | trim }}
rameshiyer2701b8cc02021-09-21 15:07:50 +010032 initContainers:
33 - command:
34 - sh
35 args:
36 - -c
37 - "cd /config-input && for PFILE in `ls -1`; do envsubst <${PFILE} >/config/${PFILE}; done"
38 env:
FrancescoFioraEst9c79e262022-02-22 13:12:19 +000039 - name: API_USER
40 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "api-secret" "key" "login") | indent 10 }}
41 - name: API_PASSWORD
42 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "api-secret" "key" "password") | indent 10 }}
43 - name: PAP_USER
44 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pap-secret" "key" "login") | indent 10 }}
45 - name: PAP_PASSWORD
46 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pap-secret" "key" "password") | indent 10 }}
rameshiyer2701b8cc02021-09-21 15:07:50 +010047 - name: RESTSERVER_USER
48 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-secret" "key" "login") | indent 10 }}
49 - name: RESTSERVER_PASSWORD
50 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-secret" "key" "password") | indent 10 }}
efiacor6910bbe2023-03-03 14:53:16 +000051 - name: SASL_JAAS_CONFIG
52 valueFrom:
53 secretKeyRef:
54 name: {{ include "common.name" . }}-ku
55 key: sasl.jaas.config
rameshiyer2701b8cc02021-09-21 15:07:50 +010056 volumeMounts:
57 - mountPath: /config-input
FrancescoFioraEst9c79e262022-02-22 13:12:19 +000058 name: ac-pf-ppnt-config
rameshiyer2701b8cc02021-09-21 15:07:50 +010059 - mountPath: /config
FrancescoFioraEst9c79e262022-02-22 13:12:19 +000060 name: ac-pf-ppnt-config-processed
rameshiyer2701b8cc02021-09-21 15:07:50 +010061 image: {{ include "repositoryGenerator.image.envsubst" . }}
62 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Andreas Geissler57681132024-07-29 10:18:26 +020063 {{ include "common.containerSecurityContext" . | indent 8 | trim }}
rameshiyer2701b8cc02021-09-21 15:07:50 +010064 name: {{ include "common.name" . }}-update-config
rameshiyer2701b8cc02021-09-21 15:07:50 +010065 containers:
66 - name: {{ include "common.name" . }}
Andreas Geissler57681132024-07-29 10:18:26 +020067 {{ include "common.containerSecurityContext" . | indent 10 | trim }}
rameshiyer2701b8cc02021-09-21 15:07:50 +010068 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
69 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
FrancescoFioraEst9c79e262022-02-22 13:12:19 +000070 command: ["/opt/app/policy/clamp/bin/policy-participant.sh"]
71 args: ["/opt/app/policy/clamp/etc/mounted/PolicyParticipantParameters.yaml"]
rameshiyer2701b8cc02021-09-21 15:07:50 +010072 ports: {{ include "common.containerPorts" . | nindent 12 }}
73 # disable liveness probe when breakpoints set in debugger
74 # so K8s doesn't restart unresponsive container
75 {{- if eq .Values.liveness.enabled true }}
76 livenessProbe:
77 tcpSocket:
78 port: {{ .Values.liveness.port }}
79 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
80 periodSeconds: {{ .Values.liveness.periodSeconds }}
81 {{ end -}}
82 readinessProbe:
83 tcpSocket:
84 port: {{ .Values.readiness.port }}
85 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
86 periodSeconds: {{ .Values.readiness.periodSeconds }}
87 volumeMounts:
rameshiyer2701b8cc02021-09-21 15:07:50 +010088 - mountPath: /opt/app/policy/clamp/etc/mounted
FrancescoFioraEst9c79e262022-02-22 13:12:19 +000089 name: ac-pf-ppnt-config-processed
Andreas Geissler57681132024-07-29 10:18:26 +020090 - name: logs
91 mountPath: /var/log/onap
92 - name: empty-dir
93 mountPath: /tmp
94 subPath: tmp-dir
95 - mountPath: /opt/app/policy/clamp/etc/logback.xml
96 subPath: logback.xml
97 name: ac-pf-ppnt-config-processed
miroslavmasaryka7ac7f02023-03-01 14:12:26 +010098 resources: {{ include "common.resources" . | nindent 12 }}
rameshiyer2701b8cc02021-09-21 15:07:50 +010099 {{- if .Values.nodeSelector }}
100 nodeSelector:
101{{ toYaml .Values.nodeSelector | indent 10 }}
102 {{- end -}}
103 {{- if .Values.affinity }}
104 affinity:
105{{ toYaml .Values.affinity | indent 10 }}
106 {{- end }}
FrancescoFioraEst9c79e262022-02-22 13:12:19 +0000107 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
rameshiyer2701b8cc02021-09-21 15:07:50 +0100108 volumes:
FrancescoFioraEst9c79e262022-02-22 13:12:19 +0000109 - name: ac-pf-ppnt-config
rameshiyer2701b8cc02021-09-21 15:07:50 +0100110 configMap:
111 name: {{ include "common.fullname" . }}-configmap
112 defaultMode: 0755
FrancescoFioraEst9c79e262022-02-22 13:12:19 +0000113 - name: ac-pf-ppnt-config-processed
rameshiyer2701b8cc02021-09-21 15:07:50 +0100114 emptyDir:
115 medium: Memory
Andreas Geissler57681132024-07-29 10:18:26 +0200116 sizeLimit: 64Mi
117 - name: empty-dir
118 emptyDir:
119 sizeLimit: {{ .Values.dirSizes.emptyDir.sizeLimit }}
120 - name: logs
121 emptyDir:
122 sizeLimit: {{ .Values.dirSizes.logDir.sizeLimit }}
Andreas Geisslerbd0d31a2024-03-20 09:51:32 +0100123 {{- include "common.imagePullSecrets" . | nindent 6 }}