blob: cf7a309ef083e118a2873373cfceaaf0f48226df [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
51 containers:
52 - name: {{ include "common.name" . }}
Sylvain Desbureaux5b651322020-12-07 15:34:15 +010053 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010054 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000055 command:
56 - sh
57 args:
58 - -c
59 - |
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000060 echo "*** actual launch of AAI Sparky BE"
61 /opt/app/sparky/bin/start.sh
efiacord12c1672023-03-23 12:10:50 +000062 volumeMounts:
Sylvain Desbureaux70070412020-11-09 21:58:48 +010063 - mountPath: /etc/localtime
64 name: localtime
65 readOnly: true
Maciej Wereskid523d122021-09-21 11:22:13 +020066 - mountPath: {{ .Values.log.path }}
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000067 name: logs
Sylvain Desbureaux70070412020-11-09 21:58:48 +010068 - mountPath: /opt/app/sparky/config/application.properties
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000069 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010070 subPath: application.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010071 - mountPath: /opt/app/sparky/config/application-resources.properties
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000072 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010073 subPath: application-resources.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010074 - mountPath: /opt/app/sparky/config/application-ssl.properties
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000075 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010076 subPath: application-ssl.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010077 - mountPath: /opt/app/sparky/config/application-oxm-default.properties
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000078 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010079 subPath: application-oxm-default.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010080 - mountPath: /opt/app/sparky/config/application-oxm-override.properties
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000081 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010082 subPath: application-oxm-override.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010083 - mountPath: /opt/app/sparky/config/application-oxm-schema-prod.properties
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000084 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010085 subPath: application-oxm-schema-prod.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010086 - mountPath: /opt/app/sparky/config/roles.config
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000087 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010088 subPath: roles.config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010089 - mountPath: /opt/app/sparky/config/users.config
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000090 name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +010091 subPath: users.config
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +000092 - mountPath: /opt/app/sparky/config/logging/logback.xml
93 name: config
94 subPath: logback.xml
Andreas Geissler5846a6e2023-03-30 17:26:14 +020095 ports: {{ include "common.containerPorts" . | nindent 10 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010096 # disable liveness probe when breakpoints set in debugger
97 # so K8s doesn't restart unresponsive container
98 {{- if eq .Values.liveness.enabled true }}
99 livenessProbe:
100 tcpSocket:
Andreas Geissler5846a6e2023-03-30 17:26:14 +0200101 port: {{ .Values.service.internalPort }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100102 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
103 periodSeconds: {{ .Values.liveness.periodSeconds }}
104 {{ end -}}
105 readinessProbe:
106 tcpSocket:
Andreas Geissler5846a6e2023-03-30 17:26:14 +0200107 port: {{ .Values.service.internalPort }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100108 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
109 periodSeconds: {{ .Values.readiness.periodSeconds }}
miroslavmasaryka7ac7f02023-03-01 14:12:26 +0100110 resources: {{ include "common.resources" . | nindent 10 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100111 {{- if .Values.nodeSelector }}
112 nodeSelector:
113{{ toYaml .Values.nodeSelector | indent 8 }}
114 {{- end -}}
115 {{- if .Values.affinity }}
116 affinity:
117{{ toYaml .Values.affinity | indent 8 }}
118 {{- end }}
119
120 # side car containers
Maciej Wereskid523d122021-09-21 11:22:13 +0200121 {{ include "common.log.sidecar" . | nindent 6 }}
farida azmyd8937332021-03-09 12:20:42 +0200122 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
efiacord12c1672023-03-23 12:10:50 +0000123 volumes:
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100124 - name: localtime
125 hostPath:
126 path: /etc/localtime
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +0000127 - name: config
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100128 configMap:
129 name: {{ include "common.fullname" . }}
Sylvain Desbureaux375d0ea2021-03-08 16:52:20 +0000130 - name: logs
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100131 emptyDir: {}
Maciej Wereskid523d122021-09-21 11:22:13 +0200132 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100133 - name: modeldir
134 emptyDir: {}
135 restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
136 imagePullSecrets:
137 - name: "{{ include "common.namespace" . }}-docker-registry-key"