blob: 25be4db147cce701dffc871589213b2fb905eb93 [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
60 name: {{ include "common.fullname" . }}-logs
61 - 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
108 - name: filebeat-onap
Sylvain Desbureaux5b651322020-12-07 15:34:15 +0100109 image: {{ include "repositoryGenerator.image.logging" . }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100110 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
111 volumeMounts:
112 - mountPath: /usr/share/filebeat/filebeat.yml
113 subPath: filebeat.yml
114 name: filebeat-conf
115 - mountPath: /var/log/onap
116 name: {{ include "common.fullname" . }}-logs
117 - mountPath: /usr/share/filebeat/data
118 name: {{ include "common.fullname" . }}-filebeat
119 volumes:
120 - name: aai-common-aai-auth-mount
121 secret:
122 secretName: aai-common-aai-auth
123 - name: localtime
124 hostPath:
125 path: /etc/localtime
126 - name: filebeat-conf
127 configMap:
128 name: aai-filebeat
129 - name: {{ include "common.fullname" . }}-logs
130 emptyDir: {}
131 - name: {{ include "common.fullname" . }}-filebeat
132 emptyDir: {}
133 - name: {{ include "common.fullname" . }}-log-conf
134 configMap:
Sylvain Desbureaux5b651322020-12-07 15:34:15 +0100135 name: {{ include "common.fullname" . }}-log
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100136 - name: localhost-access-log-conf
137 configMap:
Sylvain Desbureaux5b651322020-12-07 15:34:15 +0100138 name: {{ include "common.fullname" . }}-localhost-access-log-configmap
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100139 - name: springapp-conf
140 configMap:
Sylvain Desbureaux5b651322020-12-07 15:34:15 +0100141 name: {{ include "common.fullname" . }}-springapp-configmap
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100142 - name: aaiconfig-conf
143 configMap:
Sylvain Desbureaux5b651322020-12-07 15:34:15 +0100144 name: {{ include "common.fullname" . }}-aaiconfig-configmap
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100145 - name: realm-conf
146 configMap:
Sylvain Desbureaux5b651322020-12-07 15:34:15 +0100147 name: {{ include "common.fullname" . }}-realm-configmap
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100148 - name: auth-truststore-sec
149 secret:
Sylvain Desbureaux5b651322020-12-07 15:34:15 +0100150 secretName: aai-common-truststore
151 items:
152 {{ range $job := .Values.global.config.auth.files }}
153 - key: {{ . }}
154 path: {{ . }}
155 {{ end }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100156 restartPolicy: {{ .Values.restartPolicy }}
157 imagePullSecrets:
158 - name: "{{ include "common.namespace" . }}-docker-registry-key"