AAI parameterization
[oom.git] / kubernetes / aai / templates / aai-traversal-deployment.yaml
1 # Copyright © 2017 Amdocs, Bell Canada
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 #{{ if not .Values.disableAaiAaiTraversal }}
16 apiVersion: extensions/v1beta1
17 kind: Deployment
18 metadata:
19   name: aai-traversal
20   namespace: "{{ .Values.nsPrefix }}"
21 spec:
22   replicas: {{ .Values.aaiTraversalReplicas }}
23   selector:
24     matchLabels:
25       app: aai-traversal
26   template:
27     metadata:
28       labels:
29         app: aai-traversal
30       name: aai-traversal
31       annotations:
32         msb.onap.org/service-info: '[
33           {
34               "serviceName": "_aai-generic-query",
35               "version": "v11",
36               "url": "/aai/v11/search/generic-query",
37               "protocol": "REST",
38               "port": "8446",
39               "enable_ssl": true,
40               "lb_policy":"ip_hash",
41               "visualRange": "1",
42               "path": "/aai/v11/search/generic-query"
43           },
44           {
45               "serviceName": "_aai-generic-query",
46               "version": "v12",
47               "url": "/aai/v12/search/generic-query",
48               "protocol": "REST",
49               "port": "8446",
50               "enable_ssl": true,
51               "lb_policy":"ip_hash",
52               "visualRange": "1",
53               "path": "/aai/v12/search/generic-query"
54           },
55           {
56               "serviceName": "_aai-generic-query",
57               "version": "v13",
58               "url": "/aai/v13/search/generic-query",
59               "protocol": "REST",
60               "port": "8446",
61               "enable_ssl": true,
62               "lb_policy":"ip_hash",
63               "visualRange": "1",
64               "path": "/aai/v13/search/generic-query"
65           },
66           {
67               "serviceName": "_aai-nodes-query",
68               "version": "v11",
69               "url": "/aai/v11/search/nodes-query",
70               "protocol": "REST",
71               "port": "8446",
72               "enable_ssl": true,
73               "lb_policy":"ip_hash",
74               "visualRange": "1",
75               "path": "/aai/v11/search/nodes-query"
76           },
77           {
78               "serviceName": "_aai-nodes-query",
79               "version": "v12",
80               "url": "/aai/v12/search/nodes-query",
81               "protocol": "REST",
82               "port": "8446",
83               "enable_ssl": true,
84               "lb_policy":"ip_hash",
85               "visualRange": "1",
86               "path": "/aai/v12/search/nodes-query"
87           },
88           {
89               "serviceName": "_aai-nodes-query",
90               "version": "v13",
91               "url": "/aai/v13/search/nodes-query",
92               "protocol": "REST",
93               "port": "8446",
94               "enable_ssl": true,
95               "lb_policy":"ip_hash",
96               "visualRange": "1",
97               "path": "/aai/v13/search/nodes-query"
98           },
99           {
100               "serviceName": "_aai-query",
101               "version": "v11",
102               "url": "/aai/v11/query",
103               "protocol": "REST",
104               "port": "8446",
105               "enable_ssl": true,
106               "lb_policy":"ip_hash",
107               "visualRange": "1",
108               "path": "/aai/v11/query"
109           },
110           {
111               "serviceName": "_aai-query",
112               "version": "v12",
113               "url": "/aai/v12/query",
114               "protocol": "REST",
115               "port": "8446",
116               "enable_ssl": true,
117               "lb_policy":"ip_hash",
118               "visualRange": "1",
119               "path": "/aai/v12/query"
120           },
121           {
122               "serviceName": "_aai-query",
123               "version": "v13",
124               "url": "/aai/v13/query",
125               "protocol": "REST",
126               "port": "8446",
127               "enable_ssl": true,
128               "lb_policy":"ip_hash",
129               "visualRange": "1",
130               "path": "/aai/v13/query"
131           },
132           {
133               "serviceName": "_aai-named-query",
134               "url": "/aai/search",
135               "protocol": "REST",
136               "port": "8446",
137               "enable_ssl": true,
138               "lb_policy":"ip_hash",
139               "visualRange": "1",
140               "path": "/aai/search"
141           },
142           {
143               "serviceName": "aai-generic-query",
144               "version": "v11",
145               "url": "/aai/v11/search/generic-query",
146               "protocol": "REST",
147               "port": "8446",
148               "enable_ssl": true,
149               "lb_policy":"ip_hash",
150               "visualRange": "1"
151           },
152           {
153               "serviceName": "aai-generic-query",
154               "version": "v12",
155               "url": "/aai/v12/search/generic-query",
156               "protocol": "REST",
157               "port": "8446",
158               "enable_ssl": true,
159               "lb_policy":"ip_hash",
160               "visualRange": "1"
161           },
162           {
163               "serviceName": "aai-generic-query",
164               "version": "v13",
165               "url": "/aai/v13/search/generic-query",
166               "protocol": "REST",
167               "port": "8446",
168               "enable_ssl": true,
169               "lb_policy":"ip_hash",
170               "visualRange": "1"
171           },
172           {
173               "serviceName": "aai-nodes-query",
174               "version": "v11",
175               "url": "/aai/v11/search/nodes-query",
176               "protocol": "REST",
177               "port": "8446",
178               "enable_ssl": true,
179               "lb_policy":"ip_hash",
180               "visualRange": "1"
181           },
182           {
183               "serviceName": "aai-nodes-query",
184               "version": "v12",
185               "url": "/aai/v12/search/nodes-query",
186               "protocol": "REST",
187               "port": "8446",
188               "enable_ssl": true,
189               "lb_policy":"ip_hash",
190               "visualRange": "1"
191           },
192           {
193               "serviceName": "aai-nodes-query",
194               "version": "v13",
195               "url": "/aai/v13/search/nodes-query",
196               "protocol": "REST",
197               "port": "8446",
198               "enable_ssl": true,
199               "lb_policy":"ip_hash",
200               "visualRange": "1"
201           },
202           {
203               "serviceName": "aai-query",
204               "version": "v11",
205               "url": "/aai/v11/query",
206               "protocol": "REST",
207               "port": "8446",
208               "enable_ssl": true,
209               "lb_policy":"ip_hash",
210               "visualRange": "1"
211           },
212           {
213               "serviceName": "aai-query",
214               "version": "v12",
215               "url": "/aai/v12/query",
216               "protocol": "REST",
217               "port": "8446",
218               "enable_ssl": true,
219               "lb_policy":"ip_hash",
220               "visualRange": "1"
221           },
222           {
223               "serviceName": "aai-query",
224               "version": "v13",
225               "url": "/aai/v13/query",
226               "protocol": "REST",
227               "port": "8446",
228               "enable_ssl": true,
229               "lb_policy":"ip_hash",
230               "visualRange": "1"
231           },
232           {
233               "serviceName": "aai-named-query",
234               "url": "/aai/search",
235               "protocol": "REST",
236               "port": "8446",
237               "enable_ssl": true,
238               "lb_policy":"ip_hash",
239               "visualRange": "1"
240           }
241           ]'
242     spec:
243       initContainers:
244       - command:
245         - /root/ready.py
246         args:
247         - --container-name
248         - hbase
249         - --container-name
250         - aai-resources
251         env:
252         - name: NAMESPACE
253           valueFrom:
254             fieldRef:
255               apiVersion: v1
256               fieldPath: metadata.namespace
257         image: {{ .Values.image.readiness }}
258         imagePullPolicy: {{ .Values.pullPolicy }}
259         name: aai-traversal-readiness
260       containers:
261       - name: aai-traversal
262         image: "{{ .Values.image.aaiTraversalImage }}:{{ .Values.image.aaiTraversalVersion }}"
263         imagePullPolicy: {{ .Values.pullPolicy }}
264         env:
265         - name: CHEF_BRANCH
266           value: master
267         - name: AAI_CHEF_ENV
268           value: simpledemo
269         - name: AAI_CORE_VERSION
270           value: {{ .Values.aaicoreversion }}
271         - name: AAI_CHEF_LOC
272           value: /var/chef/aai-data/environments
273         - name: CHEF_GIT_URL
274           value: http://gerrit.onap.org/r/aai
275         - name: RESOURCES_HOSTNAME
276           value: aai-resources.{{ .Values.nsPrefix }}
277         volumeMounts:
278         - mountPath: /etc/localtime
279           name: localtime
280           readOnly: true
281         - mountPath: /var/chef/aai-data/chef-config/dev/.knife/solo.rb
282           subPath: solo.rb
283           name: aai-chef-config
284         - mountPath: /var/chef/aai-data/environments/
285           name: aai-data
286         - mountPath: /var/log/onap
287           name: aai-traversal-logs
288         - mountPath: /opt/app/aai-traversal/bundleconfig/etc/logback.xml
289           name: aai-traversal-log-conf
290           subPath: logback.xml
291         ports:
292         - containerPort: 8446
293         readinessProbe:
294           tcpSocket:
295             port: 8446
296           initialDelaySeconds: 5
297           periodSeconds: 10
298       - name: filebeat-onap-aai-traversal
299         image: {{ .Values.image.filebeat }}
300         imagePullPolicy: {{ .Values.pullPolicy }}
301         volumeMounts:
302         - mountPath: /usr/share/filebeat/filebeat.yml
303           subPath: filebeat.yml
304           name: filebeat-conf
305         - mountPath: /var/log/onap
306           name: aai-traversal-logs
307         - mountPath: /usr/share/filebeat/data
308           name: aai-traversal-filebeat
309       volumes:
310       - name: localtime
311         hostPath:
312           path: /etc/localtime
313       - name: aai-chef-config
314         configMap:
315           name: aai-chef-config-configmap
316       - name: aai-data
317         configMap:
318           name: aai-resources-environments-configmap
319       - name: filebeat-conf
320         configMap:
321           name: aai-filebeat-configmap
322       - name: aai-traversal-logs
323         emptyDir: {}
324       - name: aai-traversal-filebeat
325         emptyDir: {}
326       - name: aai-traversal-log-conf
327         configMap:
328          name: aai-traversal-log-configmap
329       restartPolicy: Always
330       imagePullSecrets:
331       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
332 #{{ end }}
333