blob: 3322918ae5565d40fce2850e17b7df1778cc55f4 [file] [log] [blame]
Sylvain Desbureaux47eb4d22020-12-10 12:15:27 +01001{{/*
Sylvain Desbureaux70070412020-11-09 21:58:48 +01002# Copyright © 2017 Amdocs, Bell Canada
3# Modifications Copyright © 2018 AT&T
Sylvain Desbureaux5b651322020-12-07 15:34:15 +01004# Modifications Copyright © 2020 Orange
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:
44 labels:
45 app: {{ include "common.name" . }}
46 release: {{ include "common.release" . }}
47 name: {{ include "common.name" . }}
48 annotations:
49 checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
50 spec:
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 }}
55 env:
56 - name: LOCAL_USER_ID
Sylvain Desbureauxc57b58d2021-02-23 18:07:34 +010057 value: {{ .Values.securityContext.user_id | quote }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010058 - name: LOCAL_GROUP_ID
Sylvain Desbureauxc57b58d2021-02-23 18:07:34 +010059 value: {{ .Values.securityContext.group_id | quote }}
efiacord12c1672023-03-23 12:10:50 +000060 volumeMounts:
Sylvain Desbureaux70070412020-11-09 21:58:48 +010061 - mountPath: /etc/localtime
62 name: localtime
63 readOnly: true
64 - mountPath: /opt/app/aai-schema-service/resources/etc/appprops/aaiconfig.properties
65 name: aaiconfig-conf
66 subPath: aaiconfig.properties
67 - mountPath: /opt/aai/logroot/AAI-SS
Maciej Wereskid523d122021-09-21 11:22:13 +020068 name: logs
Sylvain Desbureaux70070412020-11-09 21:58:48 +010069 - mountPath: /opt/app/aai-schema-service/resources/logback.xml
Sylvain Desbureauxc57b58d2021-02-23 18:07:34 +010070 name: log-conf
Sylvain Desbureaux70070412020-11-09 21:58:48 +010071 subPath: logback.xml
72 - mountPath: /opt/app/aai-schema-service/resources/localhost-access-logback.xml
73 name: localhost-access-log-conf
74 subPath: localhost-access-logback.xml
75 - mountPath: /opt/app/aai-schema-service/resources/etc/auth/realm.properties
76 name: realm-conf
77 subPath: realm.properties
78 - mountPath: /opt/app/aai-schema-service/resources/application.properties
79 name: springapp-conf
80 subPath: application.properties
Sylvain Desbureaux70070412020-11-09 21:58:48 +010081 ports:
82 - containerPort: {{ .Values.service.internalPort }}
83 - containerPort: {{ .Values.service.internalPort2 }}
84 # disable liveness probe when breakpoints set in debugger
85 # so K8s doesn't restart unresponsive container
86 {{ if .Values.liveness.enabled }}
87 livenessProbe:
88 tcpSocket:
89 port: {{ .Values.service.internalPort }}
90 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
91 periodSeconds: {{ .Values.liveness.periodSeconds }}
92 {{ end }}
93 readinessProbe:
94 tcpSocket:
95 port: {{ .Values.service.internalPort }}
96 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
97 periodSeconds: {{ .Values.readiness.periodSeconds }}
miroslavmasaryka7ac7f02023-03-01 14:12:26 +010098 resources: {{ include "common.resources" . | nindent 10 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010099 {{- if .Values.nodeSelector }}
100 nodeSelector:
101{{ toYaml .Values.nodeSelector | indent 8 }}
102 {{- end -}}
103 {{- if .Values.affinity }}
104 affinity:
105{{ toYaml .Values.affinity | indent 8 }}
106 {{- end }}
107
108 # side car containers
Maciej Wereskid523d122021-09-21 11:22:13 +0200109 {{ include "common.log.sidecar" . | nindent 6 }}
farida azmyd8937332021-03-09 12:20:42 +0200110 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
efiacord12c1672023-03-23 12:10:50 +0000111 volumes:
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100112 - name: aai-common-aai-auth-mount
113 secret:
114 secretName: aai-common-aai-auth
115 - name: localtime
116 hostPath:
117 path: /etc/localtime
Maciej Wereskid523d122021-09-21 11:22:13 +0200118 - name: logs
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100119 emptyDir: {}
Maciej Wereskid523d122021-09-21 11:22:13 +0200120 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }}
Sylvain Desbureauxc57b58d2021-02-23 18:07:34 +0100121 - name: log-conf
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100122 configMap:
Sylvain Desbureaux5b651322020-12-07 15:34:15 +0100123 name: {{ include "common.fullname" . }}-log
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100124 - name: localhost-access-log-conf
125 configMap:
Sylvain Desbureauxc57b58d2021-02-23 18:07:34 +0100126 name: {{ include "common.fullname" . }}-localhost-access-log
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100127 - name: springapp-conf
128 configMap:
Sylvain Desbureauxc57b58d2021-02-23 18:07:34 +0100129 name: {{ include "common.fullname" . }}-springapp
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100130 - name: aaiconfig-conf
131 configMap:
Sylvain Desbureauxc57b58d2021-02-23 18:07:34 +0100132 name: {{ include "common.fullname" . }}-aaiconfig
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100133 - name: realm-conf
134 configMap:
Sylvain Desbureauxc57b58d2021-02-23 18:07:34 +0100135 name: {{ include "common.fullname" . }}-realm
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100136 restartPolicy: {{ .Values.restartPolicy }}
137 imagePullSecrets:
138 - name: "{{ include "common.namespace" . }}-docker-registry-key"