blob: 00e43d2c214cd13ca26e3ae8a963ca16d12d6c71 [file] [log] [blame]
Sylvain Desbureaux47eb4d22020-12-10 12:15:27 +01001{{/*
Sylvain Desbureaux70070412020-11-09 21:58:48 +01002# Copyright (c) 2017 Amdocs, Bell Canada
3# Modifications Copyright (c) 2018 AT&T
4# Modifications Copyright (c) 2020 Nokia
efiacord12c1672023-03-23 12:10:50 +00005# Modifications Copyright © 2023 Nordix Foundation
Sylvain Desbureaux70070412020-11-09 21:58:48 +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.
Sylvain Desbureaux47eb4d22020-12-10 12:15:27 +010018*/}}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010019
20apiVersion: apps/v1
21kind: Deployment
Andreas Geissler5846a6e2023-03-30 17:26:14 +020022metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010023spec:
Andreas Geissler5846a6e2023-03-30 17:26:14 +020024 selector: {{- include "common.selectors" . | nindent 4 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010025 replicas: {{ .Values.replicaCount }}
Rommel Pawar63db7162022-11-16 10:11:24 -080026 strategy:
27 type: {{ .Values.updateStrategy.type }}
28 {{- if (eq "RollingUpdate" .Values.updateStrategy.type) }}
29 rollingUpdate:
30 maxUnavailable: {{ .Values.updateStrategy.maxUnavailable }}
31 maxSurge: {{ .Values.updateStrategy.maxSurge }}
32 {{- end }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010033 template:
Andreas Geissler5846a6e2023-03-30 17:26:14 +020034 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010035 spec:
efiacord12c1672023-03-23 12:10:50 +000036 initContainers:
Sylvain Desbureaux70070412020-11-09 21:58:48 +010037 - command:
38 - /app/ready.py
39 args:
40 - --container-name
Sylvain Desbureaux70070412020-11-09 21:58:48 +010041 - aai
42 env:
43 - name: NAMESPACE
44 valueFrom:
45 fieldRef:
46 apiVersion: v1
47 fieldPath: metadata.namespace
Sylvain Desbureaux5b651322020-12-07 15:34:15 +010048 image: {{ include "repositoryGenerator.image.readiness" . }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010049 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
50 name: {{ include "common.name" . }}-readiness
Andreas Geissler47537432024-02-27 08:55:23 +010051 resources:
52 limits:
53 cpu: "100m"
Andreas Geissler8cbb3d92024-03-12 16:44:56 +010054 memory: "500Mi"
Andreas Geissler47537432024-02-27 08:55:23 +010055 requests:
56 cpu: "3m"
Andreas Geissler8cbb3d92024-03-12 16:44:56 +010057 memory: "20Mi"
Sylvain Desbureaux70070412020-11-09 21:58:48 +010058 containers:
59 - name: {{ include "common.name" . }}
Sylvain Desbureaux5b651322020-12-07 15:34:15 +010060 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010061 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000062 command:
63 - sh
64 args:
65 - -c
66 - |
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000067 echo "*** actual launch of AAI Sparky BE"
68 /opt/app/sparky/bin/start.sh
efiacord12c1672023-03-23 12:10:50 +000069 volumeMounts:
Maciej Wereskid523d122021-09-21 11:22:13 +020070 - mountPath: {{ .Values.log.path }}
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000071 name: logs
Sylvain Desbureaux70070412020-11-09 21:58:48 +010072 - mountPath: /opt/app/sparky/config/application.properties
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000073 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010074 subPath: application.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010075 - mountPath: /opt/app/sparky/config/application-resources.properties
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000076 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010077 subPath: application-resources.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010078 - mountPath: /opt/app/sparky/config/application-ssl.properties
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000079 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010080 subPath: application-ssl.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010081 - mountPath: /opt/app/sparky/config/application-oxm-default.properties
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000082 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010083 subPath: application-oxm-default.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010084 - mountPath: /opt/app/sparky/config/application-oxm-override.properties
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000085 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010086 subPath: application-oxm-override.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010087 - mountPath: /opt/app/sparky/config/application-oxm-schema-prod.properties
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000088 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010089 subPath: application-oxm-schema-prod.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010090 - mountPath: /opt/app/sparky/config/roles.config
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000091 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010092 subPath: roles.config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010093 - mountPath: /opt/app/sparky/config/users.config
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000094 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010095 subPath: users.config
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000096 - mountPath: /opt/app/sparky/config/logging/logback.xml
97 name: config
98 subPath: logback.xml
Andreas Geissler5846a6e2023-03-30 17:26:14 +020099 ports: {{ include "common.containerPorts" . | nindent 10 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100100 # disable liveness probe when breakpoints set in debugger
101 # so K8s doesn't restart unresponsive container
102 {{- if eq .Values.liveness.enabled true }}
103 livenessProbe:
104 tcpSocket:
Andreas Geissler5846a6e2023-03-30 17:26:14 +0200105 port: {{ .Values.service.internalPort }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100106 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
107 periodSeconds: {{ .Values.liveness.periodSeconds }}
108 {{ end -}}
109 readinessProbe:
110 tcpSocket:
Andreas Geissler5846a6e2023-03-30 17:26:14 +0200111 port: {{ .Values.service.internalPort }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100112 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
113 periodSeconds: {{ .Values.readiness.periodSeconds }}
miroslavmasaryka7ac7f02023-03-01 14:12:26 +0100114 resources: {{ include "common.resources" . | nindent 10 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100115 {{- if .Values.nodeSelector }}
116 nodeSelector:
117{{ toYaml .Values.nodeSelector | indent 8 }}
118 {{- end -}}
119 {{- if .Values.affinity }}
120 affinity:
121{{ toYaml .Values.affinity | indent 8 }}
122 {{- end }}
123
124 # side car containers
Maciej Wereskid523d122021-09-21 11:22:13 +0200125 {{ include "common.log.sidecar" . | nindent 6 }}
farida azmyd8937332021-03-09 12:20:42 +0200126 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
efiacord12c1672023-03-23 12:10:50 +0000127 volumes:
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +0000128 - name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100129 configMap:
130 name: {{ include "common.fullname" . }}
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +0000131 - name: logs
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100132 emptyDir: {}
Maciej Wereskid523d122021-09-21 11:22:13 +0200133 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100134 - name: modeldir
135 emptyDir: {}
136 restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
Andreas Geisslerbd0d31a2024-03-20 09:51:32 +0100137 {{- include "common.imagePullSecrets" . | nindent 6 }}