blob: 7c25ab7e61d76f38bf1f16bda5473a9511e1b62a [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
Sylvain Desbureaux70070412020-11-09 21:58:48 +01005#
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
Sylvain Desbureaux47eb4d22020-12-10 12:15:27 +010017*/}}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010018
19apiVersion: apps/v1
20kind: Deployment
21metadata:
22 name: {{ include "common.fullname" . }}
23 namespace: {{ include "common.namespace" . }}
24 labels:
25 app: {{ include "common.name" . }}
26 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
27 release: {{ include "common.release" . }}
28 heritage: {{ .Release.Service }}
29spec:
30 replicas: {{ .Values.replicaCount }}
31 selector:
32 matchLabels:
33 app: {{ include "common.name" . }}
34 template:
35 metadata:
36 labels:
37 app: {{ include "common.name" . }}
38 release: {{ include "common.release" . }}
39 name: {{ include "common.name" . }}
40 annotations:
41 checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
42 spec:
43 containers:
44 - name: {{ include "common.name" . }}
Sylvain Desbureaux5b651322020-12-07 15:34:15 +010045 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010046 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
47 env:
48 - name: LOCAL_USER_ID
49 value: {{ .Values.global.config.userId | quote }}
50 - name: LOCAL_GROUP_ID
51 value: {{ .Values.global.config.groupId | quote }}
52 volumeMounts:
53 - mountPath: /etc/localtime
54 name: localtime
55 readOnly: true
56 - mountPath: /opt/app/aai-schema-service/resources/etc/appprops/aaiconfig.properties
57 name: aaiconfig-conf
58 subPath: aaiconfig.properties
59 - mountPath: /opt/aai/logroot/AAI-SS
Maciej Wereskid523d122021-09-21 11:22:13 +020060 name: logs
Sylvain Desbureaux70070412020-11-09 21:58:48 +010061 - mountPath: /opt/app/aai-schema-service/resources/logback.xml
62 name: {{ include "common.fullname" . }}-log-conf
63 subPath: logback.xml
64 - mountPath: /opt/app/aai-schema-service/resources/localhost-access-logback.xml
65 name: localhost-access-log-conf
66 subPath: localhost-access-logback.xml
67 - mountPath: /opt/app/aai-schema-service/resources/etc/auth/realm.properties
68 name: realm-conf
69 subPath: realm.properties
70 - mountPath: /opt/app/aai-schema-service/resources/application.properties
71 name: springapp-conf
72 subPath: application.properties
73 {{ $global := . }}
74 {{ range $job := .Values.global.config.auth.files }}
75 - mountPath: /opt/app/aai-schema-service/resources/etc/auth/{{ . }}
76 name: auth-truststore-sec
77 subPath: {{ . }}
78 {{ end }}
79 ports:
80 - containerPort: {{ .Values.service.internalPort }}
81 - containerPort: {{ .Values.service.internalPort2 }}
82 # disable liveness probe when breakpoints set in debugger
83 # so K8s doesn't restart unresponsive container
84 {{ if .Values.liveness.enabled }}
85 livenessProbe:
86 tcpSocket:
87 port: {{ .Values.service.internalPort }}
88 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
89 periodSeconds: {{ .Values.liveness.periodSeconds }}
90 {{ end }}
91 readinessProbe:
92 tcpSocket:
93 port: {{ .Values.service.internalPort }}
94 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
95 periodSeconds: {{ .Values.readiness.periodSeconds }}
96 resources:
97{{ include "common.resources" . | indent 12 }}
98 {{- if .Values.nodeSelector }}
99 nodeSelector:
100{{ toYaml .Values.nodeSelector | indent 8 }}
101 {{- end -}}
102 {{- if .Values.affinity }}
103 affinity:
104{{ toYaml .Values.affinity | indent 8 }}
105 {{- end }}
106
107 # side car containers
Maciej Wereskid523d122021-09-21 11:22:13 +0200108 {{ include "common.log.sidecar" . | nindent 6 }}
farida azmyd8937332021-03-09 12:20:42 +0200109 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100110 volumes:
111 - name: aai-common-aai-auth-mount
112 secret:
113 secretName: aai-common-aai-auth
114 - name: localtime
115 hostPath:
116 path: /etc/localtime
Maciej Wereskid523d122021-09-21 11:22:13 +0200117 - name: logs
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100118 emptyDir: {}
Maciej Wereskid523d122021-09-21 11:22:13 +0200119 {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100120 - name: {{ include "common.fullname" . }}-log-conf
121 configMap:
Sylvain Desbureaux5b651322020-12-07 15:34:15 +0100122 name: {{ include "common.fullname" . }}-log
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100123 - name: localhost-access-log-conf
124 configMap:
Sylvain Desbureaux5b651322020-12-07 15:34:15 +0100125 name: {{ include "common.fullname" . }}-localhost-access-log-configmap
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100126 - name: springapp-conf
127 configMap:
Sylvain Desbureaux5b651322020-12-07 15:34:15 +0100128 name: {{ include "common.fullname" . }}-springapp-configmap
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100129 - name: aaiconfig-conf
130 configMap:
Sylvain Desbureaux5b651322020-12-07 15:34:15 +0100131 name: {{ include "common.fullname" . }}-aaiconfig-configmap
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100132 - name: realm-conf
133 configMap:
Sylvain Desbureaux5b651322020-12-07 15:34:15 +0100134 name: {{ include "common.fullname" . }}-realm-configmap
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100135 - name: auth-truststore-sec
136 secret:
Sylvain Desbureaux5b651322020-12-07 15:34:15 +0100137 secretName: aai-common-truststore
138 items:
139 {{ range $job := .Values.global.config.auth.files }}
140 - key: {{ . }}
141 path: {{ . }}
142 {{ end }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100143 restartPolicy: {{ .Values.restartPolicy }}
144 imagePullSecrets:
145 - name: "{{ include "common.namespace" . }}-docker-registry-key"