blob: 3b1411381c59c58c90b29d8bcbcf0289df788574 [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
22metadata:
23 name: {{ include "common.fullname" . }}
24 namespace: {{ include "common.namespace" . }}
25 labels:
26 app: {{ include "common.name" . }}
27 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
28 release: {{ include "common.release" . }}
29 heritage: {{ .Release.Service }}
30spec:
31 replicas: {{ .Values.replicaCount }}
Rommel Pawar63db7162022-11-16 10:11:24 -080032 strategy:
33 type: {{ .Values.updateStrategy.type }}
34 {{- if (eq "RollingUpdate" .Values.updateStrategy.type) }}
35 rollingUpdate:
36 maxUnavailable: {{ .Values.updateStrategy.maxUnavailable }}
37 maxSurge: {{ .Values.updateStrategy.maxSurge }}
38 {{- end }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010039 selector:
40 matchLabels:
41 app: {{ include "common.name" . }}
42 template:
43 metadata:
Andreas Geissler8624d222022-05-13 17:16:41 +020044 annotations:
45 sidecar.istio.io/rewriteAppHTTPProbers: "false"
Sylvain Desbureaux70070412020-11-09 21:58:48 +010046 labels:
47 app: {{ include "common.name" . }}
48 release: {{ include "common.release" . }}
49 name: {{ include "common.name" . }}
50 spec:
efiacord12c1672023-03-23 12:10:50 +000051 initContainers:
Sylvain Desbureaux70070412020-11-09 21:58:48 +010052 - command:
53 - /app/ready.py
54 args:
55 - --container-name
Sylvain Desbureaux70070412020-11-09 21:58:48 +010056 - aai
57 env:
58 - name: NAMESPACE
59 valueFrom:
60 fieldRef:
61 apiVersion: v1
62 fieldPath: metadata.namespace
Sylvain Desbureaux5b651322020-12-07 15:34:15 +010063 image: {{ include "repositoryGenerator.image.readiness" . }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010064 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
65 name: {{ include "common.name" . }}-readiness
66 containers:
67 - name: {{ include "common.name" . }}
Sylvain Desbureaux5b651322020-12-07 15:34:15 +010068 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010069 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000070 command:
71 - sh
72 args:
73 - -c
74 - |
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000075 echo "*** actual launch of AAI Sparky BE"
76 /opt/app/sparky/bin/start.sh
efiacord12c1672023-03-23 12:10:50 +000077 volumeMounts:
Sylvain Desbureaux70070412020-11-09 21:58:48 +010078 - mountPath: /etc/localtime
79 name: localtime
80 readOnly: true
Maciej Wereskid523d122021-09-21 11:22:13 +020081 - mountPath: {{ .Values.log.path }}
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000082 name: logs
Sylvain Desbureaux70070412020-11-09 21:58:48 +010083 - mountPath: /opt/app/sparky/config/application.properties
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000084 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010085 subPath: application.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010086 - mountPath: /opt/app/sparky/config/application-resources.properties
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000087 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010088 subPath: application-resources.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010089 - mountPath: /opt/app/sparky/config/application-ssl.properties
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000090 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010091 subPath: application-ssl.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010092 - mountPath: /opt/app/sparky/config/application-oxm-default.properties
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000093 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010094 subPath: application-oxm-default.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010095 - mountPath: /opt/app/sparky/config/application-oxm-override.properties
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000096 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010097 subPath: application-oxm-override.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010098 - mountPath: /opt/app/sparky/config/application-oxm-schema-prod.properties
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000099 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100100 subPath: application-oxm-schema-prod.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100101 - mountPath: /opt/app/sparky/config/roles.config
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +0000102 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100103 subPath: roles.config
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100104 - mountPath: /opt/app/sparky/config/users.config
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +0000105 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100106 subPath: users.config
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +0000107 - mountPath: /opt/app/sparky/config/logging/logback.xml
108 name: config
109 subPath: logback.xml
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100110 ports:
111 - containerPort: {{ .Values.service.internalPort }}
Andreas Geissler46067c72022-11-14 19:58:53 +0100112 - containerPort: {{ .Values.service.internalPlainPort }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100113 # disable liveness probe when breakpoints set in debugger
114 # so K8s doesn't restart unresponsive container
115 {{- if eq .Values.liveness.enabled true }}
116 livenessProbe:
117 tcpSocket:
efiacord12c1672023-03-23 12:10:50 +0000118 port: {{ .Values.service.internalPlainPort }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100119 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
120 periodSeconds: {{ .Values.liveness.periodSeconds }}
121 {{ end -}}
122 readinessProbe:
123 tcpSocket:
efiacord12c1672023-03-23 12:10:50 +0000124 port: {{ .Values.service.internalPlainPort }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100125 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
126 periodSeconds: {{ .Values.readiness.periodSeconds }}
miroslavmasaryka7ac7f02023-03-01 14:12:26 +0100127 resources: {{ include "common.resources" . | nindent 10 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100128 {{- if .Values.nodeSelector }}
129 nodeSelector:
130{{ toYaml .Values.nodeSelector | indent 8 }}
131 {{- end -}}
132 {{- if .Values.affinity }}
133 affinity:
134{{ toYaml .Values.affinity | indent 8 }}
135 {{- end }}
136
137 # side car containers
Maciej Wereskid523d122021-09-21 11:22:13 +0200138 {{ include "common.log.sidecar" . | nindent 6 }}
farida azmyd8937332021-03-09 12:20:42 +0200139 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
efiacord12c1672023-03-23 12:10:50 +0000140 volumes:
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100141 - name: localtime
142 hostPath:
143 path: /etc/localtime
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +0000144 - name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100145 configMap:
146 name: {{ include "common.fullname" . }}
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +0000147 - name: logs
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100148 emptyDir: {}
Maciej Wereskid523d122021-09-21 11:22:13 +0200149 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100150 - name: modeldir
151 emptyDir: {}
152 restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
153 imagePullSecrets:
154 - name: "{{ include "common.namespace" . }}-docker-registry-key"