blob: 1685bc500160a13e3690380405dd9aa6ee0497cd [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:
Sylvain Desbureaux70070412020-11-09 21:58:48 +010070 - mountPath: /etc/localtime
71 name: localtime
72 readOnly: true
Maciej Wereskid523d122021-09-21 11:22:13 +020073 - mountPath: {{ .Values.log.path }}
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000074 name: logs
Sylvain Desbureaux70070412020-11-09 21:58:48 +010075 - mountPath: /opt/app/sparky/config/application.properties
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000076 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010077 subPath: application.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010078 - mountPath: /opt/app/sparky/config/application-resources.properties
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000079 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010080 subPath: application-resources.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010081 - mountPath: /opt/app/sparky/config/application-ssl.properties
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000082 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010083 subPath: application-ssl.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010084 - mountPath: /opt/app/sparky/config/application-oxm-default.properties
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000085 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010086 subPath: application-oxm-default.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010087 - mountPath: /opt/app/sparky/config/application-oxm-override.properties
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000088 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010089 subPath: application-oxm-override.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010090 - mountPath: /opt/app/sparky/config/application-oxm-schema-prod.properties
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000091 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010092 subPath: application-oxm-schema-prod.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010093 - mountPath: /opt/app/sparky/config/roles.config
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000094 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010095 subPath: roles.config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010096 - mountPath: /opt/app/sparky/config/users.config
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000097 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010098 subPath: users.config
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000099 - mountPath: /opt/app/sparky/config/logging/logback.xml
100 name: config
101 subPath: logback.xml
Andreas Geissler5846a6e2023-03-30 17:26:14 +0200102 ports: {{ include "common.containerPorts" . | nindent 10 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100103 # disable liveness probe when breakpoints set in debugger
104 # so K8s doesn't restart unresponsive container
105 {{- if eq .Values.liveness.enabled true }}
106 livenessProbe:
107 tcpSocket:
Andreas Geissler5846a6e2023-03-30 17:26:14 +0200108 port: {{ .Values.service.internalPort }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100109 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
110 periodSeconds: {{ .Values.liveness.periodSeconds }}
111 {{ end -}}
112 readinessProbe:
113 tcpSocket:
Andreas Geissler5846a6e2023-03-30 17:26:14 +0200114 port: {{ .Values.service.internalPort }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100115 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
116 periodSeconds: {{ .Values.readiness.periodSeconds }}
miroslavmasaryka7ac7f02023-03-01 14:12:26 +0100117 resources: {{ include "common.resources" . | nindent 10 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100118 {{- if .Values.nodeSelector }}
119 nodeSelector:
120{{ toYaml .Values.nodeSelector | indent 8 }}
121 {{- end -}}
122 {{- if .Values.affinity }}
123 affinity:
124{{ toYaml .Values.affinity | indent 8 }}
125 {{- end }}
126
127 # side car containers
Maciej Wereskid523d122021-09-21 11:22:13 +0200128 {{ include "common.log.sidecar" . | nindent 6 }}
farida azmyd8937332021-03-09 12:20:42 +0200129 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
efiacord12c1672023-03-23 12:10:50 +0000130 volumes:
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100131 - name: localtime
132 hostPath:
133 path: /etc/localtime
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +0000134 - name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100135 configMap:
136 name: {{ include "common.fullname" . }}
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +0000137 - name: logs
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100138 emptyDir: {}
Maciej Wereskid523d122021-09-21 11:22:13 +0200139 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100140 - name: modeldir
141 emptyDir: {}
142 restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
143 imagePullSecrets:
144 - name: "{{ include "common.namespace" . }}-docker-registry-key"