blob: 6a992dd6187be5fca4604c54c635b79e26c1be98 [file] [log] [blame]
kj9bf27312018-03-19 15:07:44 +02001# Copyright © 2017 Amdocs, Bell Canada
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +00002# Modifications Copyright © 2018 AT&T
kj9bf27312018-03-19 15:07:44 +02003#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16apiVersion: extensions/v1beta1
17kind: Deployment
18metadata:
19 name: {{ include "common.fullname" . }}
20 namespace: {{ include "common.namespace" . }}
21 labels:
22 app: {{ include "common.name" . }}
23 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
24 release: {{ .Release.Name }}
25 heritage: {{ .Release.Service }}
26spec:
27 replicas: {{ .Values.replicaCount }}
28 selector:
29 matchLabels:
30 app: {{ include "common.name" . }}
31 template:
32 metadata:
33 labels:
34 app: {{ include "common.name" . }}
35 release: {{ .Release.Name }}
36 name: {{ include "common.name" . }}
37 spec:
Arul.Nambib8c668f2018-07-17 16:02:30 -040038 initContainers:
39 - command:
40 - /root/ready.py
41 args:
42 - --container-name
43 - aai-elasticsearch
44 - --container-name
45 - aai-search-data
46 - --container-name
47 - aai
48 env:
49 - name: NAMESPACE
50 valueFrom:
51 fieldRef:
52 apiVersion: v1
53 fieldPath: metadata.namespace
54 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
55 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
56 name: {{ include "common.name" . }}-readiness
kj9bf27312018-03-19 15:07:44 +020057 containers:
58 - name: {{ include "common.name" . }}
BorislavGdf11cd52018-05-06 12:55:20 +000059 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
kj9bf27312018-03-19 15:07:44 +020060 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
rv871fb59b7fd2018-09-05 13:33:10 -040061
kj9bf27312018-03-19 15:07:44 +020062 volumeMounts:
63 - mountPath: /etc/localtime
64 name: localtime
65 readOnly: true
rv871fb59b7fd2018-09-05 13:33:10 -040066 - mountPath: /opt/app/sparky/config/auth/
kj9bf27312018-03-19 15:07:44 +020067 name: {{ include "common.fullname" . }}-auth-config
rv871fb59b7fd2018-09-05 13:33:10 -040068
69 - mountPath: /opt/app/sparky/config/portal/
kj9bf27312018-03-19 15:07:44 +020070 name: {{ include "common.fullname" . }}-portal-config
rv871fb59b7fd2018-09-05 13:33:10 -040071
72 - mountPath: /opt/app/sparky/config/portal/BOOT-INF/classes/
73 name: {{ include "common.fullname" . }}-portal-config-props
74
kj9bf27312018-03-19 15:07:44 +020075 - mountPath: /var/log/onap
76 name: {{ include "common.fullname" . }}-logs
rv871fb59b7fd2018-09-05 13:33:10 -040077
78 - mountPath: /opt/app/sparky/config/application.properties
79 name: {{ include "common.fullname" . }}-properties
80 subPath: application.properties
81
82 - mountPath: /opt/app/sparky/config/application-resources.properties
83 name: {{ include "common.fullname" . }}-properties
84 subPath: application-resources.properties
85
86 - mountPath: /opt/app/sparky/config/application-ssl.properties
87 name: {{ include "common.fullname" . }}-properties
88 subPath: application-ssl.properties
89
90 - mountPath: /opt/app/sparky/config/application-oxm-default.properties
91 name: {{ include "common.fullname" . }}-properties
92 subPath: application-oxm-default.properties
93
94 - mountPath: /opt/app/sparky/config/application-oxm-override.properties
95 name: {{ include "common.fullname" . }}-properties
96 subPath: application-oxm-override.properties
97
98 - mountPath: /opt/app/sparky/config/application-oxm-schema-prod.properties
99 name: {{ include "common.fullname" . }}-properties
100 subPath: application-oxm-schema-prod.properties
Arul.Nambi279c43e2018-10-10 16:14:55 -0400101
102 - mountPath: /opt/app/sparky/config/roles.config
103 name: {{ include "common.fullname" . }}-properties
104 subPath: roles.config
105
106 mountPath: /opt/app/sparky/config/users.config
107 name: {{ include "common.fullname" . }}-properties
108 subPath: users.config
rv871fb59b7fd2018-09-05 13:33:10 -0400109
kj9bf27312018-03-19 15:07:44 +0200110 ports:
111 - containerPort: {{ .Values.service.internalPort }}
Keren Joseph5689d5f2018-04-22 15:22:46 +0300112 - containerPort: {{ .Values.service.internalPort2 }}
kj9bf27312018-03-19 15:07:44 +0200113 # disable liveness probe when breakpoints set in debugger
114 # so K8s doesn't restart unresponsive container
115 {{- if eq .Values.liveness.enabled true }}
116 livenessProbe:
117 tcpSocket:
Arul.Nambi89c02792018-06-20 11:40:17 -0400118 port: {{ .Values.service.internalPort }}
kj9bf27312018-03-19 15:07:44 +0200119 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
120 periodSeconds: {{ .Values.liveness.periodSeconds }}
121 {{ end -}}
122 readinessProbe:
123 tcpSocket:
Arul.Nambi89c02792018-06-20 11:40:17 -0400124 port: {{ .Values.service.internalPort }}
kj9bf27312018-03-19 15:07:44 +0200125 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
126 periodSeconds: {{ .Values.readiness.periodSeconds }}
127 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000128{{ include "common.resources" . | indent 12 }}
kj9bf27312018-03-19 15:07:44 +0200129 {{- if .Values.nodeSelector }}
130 nodeSelector:
131{{ toYaml .Values.nodeSelector | indent 8 }}
132 {{- end -}}
133 {{- if .Values.affinity }}
134 affinity:
135{{ toYaml .Values.affinity | indent 8 }}
136 {{- end }}
137
138 # side car containers
139 - name: filebeat-onap
140 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
141 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
142 volumeMounts:
143 - mountPath: /usr/share/filebeat/filebeat.yml
144 subPath: filebeat.yml
145 name: filebeat-conf
146 - mountPath: /var/log/onap
147 name: {{ include "common.fullname" . }}-logs
148 - mountPath: /usr/share/filebeat/data
149 name: aai-sparky-filebeat
150
151 volumes:
152 - name: localtime
153 hostPath:
154 path: /etc/localtime
rv871fb59b7fd2018-09-05 13:33:10 -0400155
156 - name: {{ include "common.fullname" . }}-properties
157 configMap:
158 name: {{ include "common.fullname" . }}-prop
159
kj9bf27312018-03-19 15:07:44 +0200160 - name: {{ include "common.fullname" . }}-config
161 configMap:
162 name: {{ include "common.fullname" . }}
rv871fb59b7fd2018-09-05 13:33:10 -0400163
Keren Joseph5689d5f2018-04-22 15:22:46 +0300164 - name: {{ include "common.fullname" . }}-portal-config
165 configMap:
166 name: {{ include "common.fullname" . }}-portal
rv871fb59b7fd2018-09-05 13:33:10 -0400167
168 - name: {{ include "common.fullname" . }}-portal-config-props
Keren Joseph5689d5f2018-04-22 15:22:46 +0300169 configMap:
rv871fb59b7fd2018-09-05 13:33:10 -0400170 name: {{ include "common.fullname" . }}-portal-props
171
172 - name: {{ include "common.fullname" . }}-auth-config
173 secret:
174 secretName: {{ include "common.fullname" . }}
kj9bf27312018-03-19 15:07:44 +0200175 - name: filebeat-conf
176 configMap:
177 name: aai-filebeat
178 - name: {{ include "common.fullname" . }}-logs
179 emptyDir: {}
180 - name: aai-sparky-filebeat
181 emptyDir: {}
rv871fb59b7fd2018-09-05 13:33:10 -0400182 - name: modeldir
183 emptyDir: {}
kj9bf27312018-03-19 15:07:44 +0200184 restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}
185 imagePullSecrets:
186 - name: "{{ include "common.namespace" . }}-docker-registry-key"