blob: dd7db7acee2952eb016247ffa98de0c3abc2bc48 [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:
39 - name: RESTSERVER_USER
40 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-secret" "key" "login") | indent 10 }}
41 - name: RESTSERVER_PASSWORD
42 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-secret" "key" "password") | indent 10 }}
efiacor6910bbe2023-03-03 14:53:16 +000043 - name: SASL_JAAS_CONFIG
44 valueFrom:
45 secretKeyRef:
46 name: {{ include "common.name" . }}-ku
47 key: sasl.jaas.config
rameshiyer2701b8cc02021-09-21 15:07:50 +010048 volumeMounts:
49 - mountPath: /config-input
FrancescoFioraEst9c79e262022-02-22 13:12:19 +000050 name: ac-http-ppnt-config
rameshiyer2701b8cc02021-09-21 15:07:50 +010051 - mountPath: /config
FrancescoFioraEst9c79e262022-02-22 13:12:19 +000052 name: ac-http-ppnt-config-processed
rameshiyer2701b8cc02021-09-21 15:07:50 +010053 image: {{ include "repositoryGenerator.image.envsubst" . }}
54 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Andreas Geissler57681132024-07-29 10:18:26 +020055 {{ include "common.containerSecurityContext" . | indent 8 | trim }}
rameshiyer2701b8cc02021-09-21 15:07:50 +010056 name: {{ include "common.name" . }}-update-config
rameshiyer2701b8cc02021-09-21 15:07:50 +010057 containers:
58 - name: {{ include "common.name" . }}
Andreas Geissler57681132024-07-29 10:18:26 +020059 {{ include "common.containerSecurityContext" . | indent 10 | trim }}
rameshiyer2701b8cc02021-09-21 15:07:50 +010060 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
61 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
FrancescoFioraEst9c79e262022-02-22 13:12:19 +000062 command: ["/opt/app/policy/clamp/bin/http-participant.sh"]
63 args: ["/opt/app/policy/clamp/etc/mounted/HttpParticipantParameters.yaml"]
rameshiyer2701b8cc02021-09-21 15:07:50 +010064 ports: {{ include "common.containerPorts" . | nindent 12 }}
65 # disable liveness probe when breakpoints set in debugger
66 # so K8s doesn't restart unresponsive container
67 {{- if eq .Values.liveness.enabled true }}
68 livenessProbe:
69 tcpSocket:
70 port: {{ .Values.liveness.port }}
71 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
72 periodSeconds: {{ .Values.liveness.periodSeconds }}
73 {{ end -}}
74 readinessProbe:
75 tcpSocket:
76 port: {{ .Values.readiness.port }}
77 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
78 periodSeconds: {{ .Values.readiness.periodSeconds }}
79 volumeMounts:
rameshiyer2701b8cc02021-09-21 15:07:50 +010080 - mountPath: /opt/app/policy/clamp/etc/mounted
FrancescoFioraEst9c79e262022-02-22 13:12:19 +000081 name: ac-http-ppnt-config-processed
Andreas Geissler57681132024-07-29 10:18:26 +020082 - name: logs
83 mountPath: /var/log/onap
84 - name: empty-dir
85 mountPath: /tmp
86 subPath: tmp-dir
87 - mountPath: /opt/app/policy/clamp/etc/logback.xml
88 subPath: logback.xml
89 name: ac-http-ppnt-config-processed
miroslavmasaryka7ac7f02023-03-01 14:12:26 +010090 resources: {{ include "common.resources" . | nindent 12 }}
rameshiyer2701b8cc02021-09-21 15:07:50 +010091 {{- if .Values.nodeSelector }}
92 nodeSelector:
93{{ toYaml .Values.nodeSelector | indent 10 }}
94 {{- end -}}
95 {{- if .Values.affinity }}
96 affinity:
97{{ toYaml .Values.affinity | indent 10 }}
98 {{- end }}
FrancescoFioraEst9c79e262022-02-22 13:12:19 +000099 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
rameshiyer2701b8cc02021-09-21 15:07:50 +0100100 volumes:
FrancescoFioraEst9c79e262022-02-22 13:12:19 +0000101 - name: ac-http-ppnt-config
rameshiyer2701b8cc02021-09-21 15:07:50 +0100102 configMap:
103 name: {{ include "common.fullname" . }}-configmap
104 defaultMode: 0755
FrancescoFioraEst9c79e262022-02-22 13:12:19 +0000105 - name: ac-http-ppnt-config-processed
rameshiyer2701b8cc02021-09-21 15:07:50 +0100106 emptyDir:
107 medium: Memory
Andreas Geissler57681132024-07-29 10:18:26 +0200108 sizeLimit: 64Mi
109 - name: empty-dir
110 emptyDir:
111 sizeLimit: {{ .Values.dirSizes.emptyDir.sizeLimit }}
112 - name: logs
113 emptyDir:
114 sizeLimit: {{ .Values.dirSizes.logDir.sizeLimit }}
Andreas Geisslerbd0d31a2024-03-20 09:51:32 +0100115 {{- include "common.imagePullSecrets" . | nindent 6 }}