blob: 5e6f2bc33de568c0a8ea1add8e765ce19400edeb [file] [log] [blame]
Sylvain Desbureaux47eb4d22020-12-10 12:15:27 +01001{{/*
Sylvain Desbureaux70070412020-11-09 21:58:48 +01002#
3# ============LICENSE_START=======================================================
4# org.onap.aai
5# ================================================================================
6# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
7# Copyright (c) 2020 Nokia Intellectual Property. All rights reserved.
Sylvain Desbureaux5b651322020-12-07 15:34:15 +01008# Copyright (c) 2020 Orange Intellectual Property. All rights reserved.
Sylvain Desbureaux70070412020-11-09 21:58:48 +01009# ================================================================================
10# Licensed under the Apache License, Version 2.0 (the "License");
11# you may not use this file except in compliance with the License.
12# You may obtain a copy of the License at
13#
14# http://www.apache.org/licenses/LICENSE-2.0
15#
16# Unless required by applicable law or agreed to in writing, software
17# distributed under the License is distributed on an "AS IS" BASIS,
18# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19# See the License for the specific language governing permissions and
20# limitations under the License.
21# ============LICENSE_END=========================================================
Sylvain Desbureaux47eb4d22020-12-10 12:15:27 +010022*/}}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010023apiVersion: apps/v1
24kind: Deployment
25metadata:
26 name: {{ include "common.fullname" . }}
27 namespace: {{ include "common.namespace" . }}
28 labels:
29 app: {{ include "common.name" . }}
30 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
31 release: {{ include "common.release" . }}
32 heritage: {{ .Release.Service }}
33spec:
34 replicas: {{ .Values.replicaCount }}
35 selector:
36 matchLabels:
37 app: {{ include "common.name" . }}
38 template:
39 metadata:
40 labels:
41 app: {{ include "common.name" . }}
42 release: {{ include "common.release" . }}
43 name: {{ include "common.name" . }}
44 annotations:
45 checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
46 spec:
47 hostname: aai-graphadmin
48 {{ if .Values.global.initContainers.enabled }}
49 initContainers:
50 - command:
51 {{ if .Values.global.jobs.migration.enabled }}
52 - /app/ready.py
53 args:
54 - --job-name
55 - {{ include "common.release" . }}-aai-graphadmin-migration
56 {{ else if .Values.global.jobs.createSchema.enabled }}
57 - /app/ready.py
58 args:
59 - --job-name
60 - {{ include "common.release" . }}-aai-graphadmin-create-db-schema
61 {{ else }}
62 - /app/ready.py
63 args:
64 - --container-name
65 {{- if .Values.global.cassandra.localCluster }}
66 - aai-cassandra
67 {{- else }}
68 - cassandra
69 {{- end }}
70 - --container-name
71 - aai-schema-service
72 {{ end }}
73 env:
74 - name: NAMESPACE
75 valueFrom:
76 fieldRef:
77 apiVersion: v1
78 fieldPath: metadata.namespace
Sylvain Desbureaux5b651322020-12-07 15:34:15 +010079 image: {{ include "repositoryGenerator.image.readiness" . }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010080 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
81 name: {{ include "common.name" . }}-readiness
82 {{ end }}
83 containers:
84 - name: {{ include "common.name" . }}
Sylvain Desbureaux5b651322020-12-07 15:34:15 +010085 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +010086 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
87 env:
88 - name: LOCAL_USER_ID
89 value: {{ .Values.global.config.userId | quote }}
90 - name: LOCAL_GROUP_ID
91 value: {{ .Values.global.config.groupId | quote }}
92 volumeMounts:
93 - mountPath: /etc/localtime
94 name: localtime
95 readOnly: true
96 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-realtime.properties
97 name: {{ include "common.fullname" . }}-config
98 subPath: janusgraph-realtime.properties
99 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/janusgraph-cached.properties
100 name: {{ include "common.fullname" . }}-config
101 subPath: janusgraph-cached.properties
102 - mountPath: /opt/app/aai-graphadmin/resources/etc/appprops/aaiconfig.properties
103 name: {{ include "common.fullname" . }}-config
104 subPath: aaiconfig.properties
105 - mountPath: /opt/aai/logroot/AAI-RES
106 name: {{ include "common.fullname" . }}-logs
107 - mountPath: /opt/app/aai-graphadmin/resources/logback.xml
108 name: {{ include "common.fullname" . }}-config
109 subPath: logback.xml
110 - mountPath: /opt/app/aai-graphadmin/resources/localhost-access-logback.xml
111 name: {{ include "common.fullname" . }}-config
112 subPath: localhost-access-logback.xml
113 - mountPath: /opt/app/aai-graphadmin/resources/etc/auth/realm.properties
114 name: {{ include "common.fullname" . }}-config
115 subPath: realm.properties
116 - mountPath: /opt/app/aai-graphadmin/resources/application.properties
117 name: {{ include "common.fullname" . }}-config
118 subPath: application.properties
119 {{ $global := . }}
120 {{ range $job := .Values.global.config.auth.files }}
121 - mountPath: /opt/app/aai-graphadmin/resources/etc/auth/{{ . }}
122 name: {{ include "common.fullname" $global }}-auth-truststore-sec
123 subPath: {{ . }}
124 {{ end }}
125 ports:
126 - containerPort: {{ .Values.service.internalPort }}
127 - containerPort: {{ .Values.service.internalPort2 }}
128 # disable liveness probe when breakpoints set in debugger
129 # so K8s doesn't restart unresponsive container
130 {{ if .Values.liveness.enabled }}
131 livenessProbe:
132 tcpSocket:
133 port: {{ .Values.service.internalPort }}
134 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
135 periodSeconds: {{ .Values.liveness.periodSeconds }}
136 {{ end }}
137 readinessProbe:
138 tcpSocket:
139 port: {{ .Values.service.internalPort }}
140 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
141 periodSeconds: {{ .Values.readiness.periodSeconds }}
142 resources:
143{{ include "common.resources" . }}
144 {{- if .Values.nodeSelector }}
145 nodeSelector:
146{{ toYaml .Values.nodeSelector | indent 8 }}
147 {{- end -}}
148 {{- if .Values.affinity }}
149 affinity:
150{{ toYaml .Values.affinity | indent 8 }}
151 {{- end }}
152
153 # side car containers
154 - name: filebeat-onap
Sylvain Desbureaux5b651322020-12-07 15:34:15 +0100155 image: {{ include "repositoryGenerator.image.logging" . }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100156 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
157 volumeMounts:
158 - mountPath: /usr/share/filebeat/filebeat.yml
159 subPath: filebeat.yml
160 name: filebeat-conf
161 - mountPath: /var/log/onap
162 name: {{ include "common.fullname" . }}-logs
163 - mountPath: /usr/share/filebeat/data
164 name: {{ include "common.fullname" . }}-filebeat
165
166 volumes:
167 - name: localtime
168 hostPath:
169 path: /etc/localtime
170 - name: filebeat-conf
171 configMap:
172 name: aai-filebeat
173 - name: {{ include "common.fullname" . }}-logs
174 emptyDir: {}
175 - name: {{ include "common.fullname" . }}-filebeat
176 emptyDir: {}
177 - name: {{ include "common.fullname" . }}-config
178 configMap:
Sylvain Desbureaux5b651322020-12-07 15:34:15 +0100179 name: {{ include "common.fullname" . }}-configmap
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100180 - name: {{ include "common.fullname" . }}-auth-truststore-sec
181 secret:
Sylvain Desbureaux5b651322020-12-07 15:34:15 +0100182 secretName: aai-common-truststore
183 items:
184 {{ range $job := .Values.global.config.auth.files }}
185 - key: {{ . }}
186 path: {{ . }}
187 {{ end }}
Sylvain Desbureaux70070412020-11-09 21:58:48 +0100188 restartPolicy: {{ .Values.restartPolicy }}
189 imagePullSecrets:
190 - name: "{{ include "common.namespace" . }}-docker-registry-key"