AAI Rolling upgrade using helm hooks
[oom.git] / kubernetes / aai / charts / aai-resources / templates / deployment.yaml
1 # Copyright © 2017 Amdocs, Bell Canada
2 # Modifications Copyright © 2018 AT&T
3 #
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
16 apiVersion: extensions/v1beta1
17 kind: Deployment
18 metadata:
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 }}
26 spec:
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       annotations:
38         checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
39         msb.onap.org/service-info: '[
40           {
41               "serviceName": "_aai-cloudInfrastructure",
42               "version": "v11",
43               "url": "/aai/v11/cloud-infrastructure",
44               "protocol": "REST",
45               "port": "8447",
46               "enable_ssl": true,
47               "lb_policy":"ip_hash",
48               "visualRange": "1",
49               "path": "/aai/v11/cloud-infrastructure"
50           },
51           {
52               "serviceName": "_aai-cloudInfrastructure",
53               "version": "v12",
54               "url": "/aai/v12/cloud-infrastructure",
55               "protocol": "REST",
56               "port": "8447",
57               "enable_ssl": true,
58               "lb_policy":"ip_hash",
59               "visualRange": "1",
60               "path": "/aai/v12/cloud-infrastructure"
61           },
62           {
63               "serviceName": "_aai-cloudInfrastructure",
64               "version": "v13",
65               "url": "/aai/v13/cloud-infrastructure",
66               "protocol": "REST",
67               "port": "8447",
68               "enable_ssl": true,
69               "lb_policy":"ip_hash",
70               "visualRange": "1",
71               "path": "/aai/v13/cloud-infrastructure"
72           },
73           {
74               "serviceName": "_aai-cloudInfrastructure",
75               "version": "v14",
76               "url": "/aai/v14/cloud-infrastructure",
77               "protocol": "REST",
78               "port": "8447",
79               "enable_ssl": true,
80               "lb_policy":"ip_hash",
81               "visualRange": "1",
82               "path": "/aai/v14/cloud-infrastructure"
83           },
84           {
85               "serviceName": "_aai-cloudInfrastructure",
86               "version": "v15",
87               "url": "/aai/v15/cloud-infrastructure",
88               "protocol": "REST",
89               "port": "8447",
90               "enable_ssl": true,
91               "lb_policy":"ip_hash",
92               "visualRange": "1",
93               "path": "/aai/v15/cloud-infrastructure"
94           },
95           {
96               "serviceName": "_aai-cloudInfrastructure",
97               "version": "v16",
98               "url": "/aai/v16/cloud-infrastructure",
99               "protocol": "REST",
100               "port": "8447",
101               "enable_ssl": true,
102               "lb_policy":"ip_hash",
103               "visualRange": "1",
104               "path": "/aai/v16/cloud-infrastructure"
105           },
106           {
107               "serviceName": "_aai-business",
108               "version": "v11",
109               "url": "/aai/v11/business",
110               "protocol": "REST",
111               "port": "8447",
112               "enable_ssl": true,
113               "lb_policy":"ip_hash",
114               "visualRange": "1",
115               "path": "/aai/v11/business"
116           },
117           {
118               "serviceName": "_aai-business",
119               "version": "v12",
120               "url": "/aai/v12/business",
121               "protocol": "REST",
122               "port": "8447",
123               "enable_ssl": true,
124               "lb_policy":"ip_hash",
125               "visualRange": "1",
126               "path": "/aai/v12/business"
127           },
128           {
129               "serviceName": "_aai-business",
130               "version": "v13",
131               "url": "/aai/v13/business",
132               "protocol": "REST",
133               "port": "8447",
134               "enable_ssl": true,
135               "lb_policy":"ip_hash",
136               "visualRange": "1",
137               "path": "/aai/v13/business"
138           },
139           {
140               "serviceName": "_aai-business",
141               "version": "v14",
142               "url": "/aai/v14/business",
143               "protocol": "REST",
144               "port": "8447",
145               "enable_ssl": true,
146               "lb_policy":"ip_hash",
147               "visualRange": "1",
148               "path": "/aai/v14/business"
149           },
150           {
151               "serviceName": "_aai-business",
152               "version": "v15",
153               "url": "/aai/v15/business",
154               "protocol": "REST",
155               "port": "8447",
156               "enable_ssl": true,
157               "lb_policy":"ip_hash",
158               "visualRange": "1",
159               "path": "/aai/v15/business"
160           },
161           {
162               "serviceName": "_aai-business",
163               "version": "v16",
164               "url": "/aai/v16/business",
165               "protocol": "REST",
166               "port": "8447",
167               "enable_ssl": true,
168               "lb_policy":"ip_hash",
169               "visualRange": "1",
170               "path": "/aai/v16/business"
171           },
172           {
173               "serviceName": "_aai-actions",
174               "version": "v11",
175               "url": "/aai/v11/actions",
176               "protocol": "REST",
177               "port": "8447",
178               "enable_ssl": true,
179               "lb_policy":"ip_hash",
180               "visualRange": "1",
181               "path": "/aai/v11/actions"
182           },
183           {
184               "serviceName": "_aai-actions",
185               "version": "v12",
186               "url": "/aai/v12/actions",
187               "protocol": "REST",
188               "port": "8447",
189               "enable_ssl": true,
190               "lb_policy":"ip_hash",
191               "visualRange": "1",
192               "path": "/aai/v12/actions"
193           },
194           {
195               "serviceName": "_aai-actions",
196               "version": "v13",
197               "url": "/aai/v13/actions",
198               "protocol": "REST",
199               "port": "8447",
200               "enable_ssl": true,
201               "lb_policy":"ip_hash",
202               "visualRange": "1",
203               "path": "/aai/v13/actions"
204           },
205           {
206               "serviceName": "_aai-actions",
207               "version": "v14",
208               "url": "/aai/v14/actions",
209               "protocol": "REST",
210               "port": "8447",
211               "enable_ssl": true,
212               "lb_policy":"ip_hash",
213               "visualRange": "1",
214               "path": "/aai/v14/actions"
215           },
216           {
217               "serviceName": "_aai-actions",
218               "version": "v15",
219               "url": "/aai/v15/actions",
220               "protocol": "REST",
221               "port": "8447",
222               "enable_ssl": true,
223               "lb_policy":"ip_hash",
224               "visualRange": "1",
225               "path": "/aai/v15/actions"
226           },
227           {
228               "serviceName": "_aai-actions",
229               "version": "v16",
230               "url": "/aai/v16/actions",
231               "protocol": "REST",
232               "port": "8447",
233               "enable_ssl": true,
234               "lb_policy":"ip_hash",
235               "visualRange": "1",
236               "path": "/aai/v16/actions"
237           },
238           {
239               "serviceName": "_aai-service-design-and-creation",
240               "version": "v11",
241               "url": "/aai/v11/service-design-and-creation",
242               "protocol": "REST",
243               "port": "8447",
244               "enable_ssl": true,
245               "lb_policy":"ip_hash",
246               "visualRange": "1",
247               "path": "/aai/v11/service-design-and-creation"
248           },
249           {
250               "serviceName": "_aai-service-design-and-creation",
251               "version": "v12",
252               "url": "/aai/v12/service-design-and-creation",
253               "protocol": "REST",
254               "port": "8447",
255               "enable_ssl": true,
256               "lb_policy":"ip_hash",
257               "visualRange": "1",
258               "path": "/aai/v12/service-design-and-creation"
259           },
260           {
261               "serviceName": "_aai-service-design-and-creation",
262               "version": "v13",
263               "url": "/aai/v13/service-design-and-creation",
264               "protocol": "REST",
265               "port": "8447",
266               "enable_ssl": true,
267               "lb_policy":"ip_hash",
268               "visualRange": "1",
269               "path": "/aai/v13/service-design-and-creation"
270           },
271           {
272               "serviceName": "_aai-service-design-and-creation",
273               "version": "v14",
274               "url": "/aai/v14/service-design-and-creation",
275               "protocol": "REST",
276               "port": "8447",
277               "enable_ssl": true,
278               "lb_policy":"ip_hash",
279               "visualRange": "1",
280               "path": "/aai/v14/service-design-and-creation"
281           },
282            {
283               "serviceName": "_aai-service-design-and-creation",
284               "version": "v15",
285               "url": "/aai/v15/service-design-and-creation",
286               "protocol": "REST",
287               "port": "8447",
288               "enable_ssl": true,
289               "lb_policy":"ip_hash",
290               "visualRange": "1",
291               "path": "/aai/v15/service-design-and-creation"
292           },
293           {
294               "serviceName": "_aai-service-design-and-creation",
295               "version": "v16",
296               "url": "/aai/v16/service-design-and-creation",
297               "protocol": "REST",
298               "port": "8447",
299               "enable_ssl": true,
300               "lb_policy":"ip_hash",
301               "visualRange": "1",
302               "path": "/aai/v16/service-design-and-creation"
303           },
304           {
305               "serviceName": "_aai-network",
306               "version": "v11",
307               "url": "/aai/v11/network",
308               "protocol": "REST",
309               "port": "8447",
310               "enable_ssl": true,
311               "lb_policy":"ip_hash",
312               "visualRange": "1",
313               "path": "/aai/v11/network"
314           },
315           {
316               "serviceName": "_aai-network",
317               "version": "v12",
318               "url": "/aai/v12/network",
319               "protocol": "REST",
320               "port": "8447",
321               "enable_ssl": true,
322               "lb_policy":"ip_hash",
323               "visualRange": "1",
324               "path": "/aai/v12/network"
325           },
326           {
327               "serviceName": "_aai-network",
328               "version": "v13",
329               "url": "/aai/v13/network",
330               "protocol": "REST",
331               "port": "8447",
332               "enable_ssl": true,
333               "lb_policy":"ip_hash",
334               "visualRange": "1",
335               "path": "/aai/v13/network"
336           },
337           {
338               "serviceName": "_aai-network",
339               "version": "v14",
340               "url": "/aai/v14/network",
341               "protocol": "REST",
342               "port": "8447",
343               "enable_ssl": true,
344               "lb_policy":"ip_hash",
345               "visualRange": "1",
346               "path": "/aai/v14/network"
347           },
348           {
349               "serviceName": "_aai-network",
350               "version": "v15",
351               "url": "/aai/v15/network",
352               "protocol": "REST",
353               "port": "8447",
354               "enable_ssl": true,
355               "lb_policy":"ip_hash",
356               "visualRange": "1",
357               "path": "/aai/v15/network"
358           },
359           {
360               "serviceName": "_aai-network",
361               "version": "v16",
362               "url": "/aai/v16/network",
363               "protocol": "REST",
364               "port": "8447",
365               "enable_ssl": true,
366               "lb_policy":"ip_hash",
367               "visualRange": "1",
368               "path": "/aai/v16/network"
369           },
370           {
371               "serviceName": "_aai-externalSystem",
372               "version": "v11",
373               "url": "/aai/v11/external-system",
374               "protocol": "REST",
375               "port": "8447",
376               "enable_ssl": true,
377               "lb_policy":"ip_hash",
378               "visualRange": "1",
379               "path": "/aai/v11/external-system"
380           },
381           {
382               "serviceName": "_aai-externalSystem",
383               "version": "v12",
384               "url": "/aai/v12/external-system",
385               "protocol": "REST",
386               "port": "8447",
387               "enable_ssl": true,
388               "lb_policy":"ip_hash",
389               "visualRange": "1",
390               "path": "/aai/v12/external-system"
391           },
392           {
393               "serviceName": "_aai-externalSystem",
394               "version": "v13",
395               "url": "/aai/v13/external-system",
396               "protocol": "REST",
397               "port": "8447",
398               "enable_ssl": true,
399               "lb_policy":"ip_hash",
400               "visualRange": "1",
401               "path": "/aai/v13/external-system"
402           },
403           {
404               "serviceName": "_aai-externalSystem",
405               "version": "v14",
406               "url": "/aai/v14/external-system",
407               "protocol": "REST",
408               "port": "8447",
409               "enable_ssl": true,
410               "lb_policy":"ip_hash",
411               "visualRange": "1",
412               "path": "/aai/v14/external-system"
413           },
414           {
415               "serviceName": "_aai-externalSystem",
416               "version": "v15",
417               "url": "/aai/v15/external-system",
418               "protocol": "REST",
419               "port": "8447",
420               "enable_ssl": true,
421               "lb_policy":"ip_hash",
422               "visualRange": "1",
423               "path": "/aai/v15/external-system"
424           },
425           {
426               "serviceName": "_aai-externalSystem",
427               "version": "v16",
428               "url": "/aai/v16/external-system",
429               "protocol": "REST",
430               "port": "8447",
431               "enable_ssl": true,
432               "lb_policy":"ip_hash",
433               "visualRange": "1",
434               "path": "/aai/v16/external-system"
435           },
436           {
437               "serviceName": "aai-cloudInfrastructure",
438               "version": "v11",
439               "url": "/aai/v11/cloud-infrastructure",
440               "protocol": "REST",
441               "port": "8447",
442               "enable_ssl": true,
443               "lb_policy":"ip_hash",
444               "visualRange": "1"
445           },
446           {
447               "serviceName": "aai-cloudInfrastructure",
448               "version": "v12",
449               "url": "/aai/v12/cloud-infrastructure",
450               "protocol": "REST",
451               "port": "8447",
452               "enable_ssl": true,
453               "lb_policy":"ip_hash",
454               "visualRange": "1"
455           },
456           {
457               "serviceName": "aai-cloudInfrastructure",
458               "version": "v13",
459               "url": "/aai/v13/cloud-infrastructure",
460               "protocol": "REST",
461               "port": "8447",
462               "enable_ssl": true,
463               "lb_policy":"ip_hash",
464               "visualRange": "1"
465           },
466           {
467               "serviceName": "aai-cloudInfrastructure",
468               "version": "v14",
469               "url": "/aai/v14/cloud-infrastructure",
470               "protocol": "REST",
471               "port": "8447",
472               "enable_ssl": true,
473               "lb_policy":"ip_hash",
474               "visualRange": "1"
475           },
476           {
477               "serviceName": "aai-cloudInfrastructure",
478               "version": "v15",
479               "url": "/aai/v15/cloud-infrastructure",
480               "protocol": "REST",
481               "port": "8447",
482               "enable_ssl": true,
483               "lb_policy":"ip_hash",
484               "visualRange": "1"
485           },
486           {
487               "serviceName": "aai-cloudInfrastructure",
488               "version": "v16",
489               "url": "/aai/v16/cloud-infrastructure",
490               "protocol": "REST",
491               "port": "8447",
492               "enable_ssl": true,
493               "lb_policy":"ip_hash",
494               "visualRange": "1"
495           },
496           {
497               "serviceName": "aai-business",
498               "version": "v11",
499               "url": "/aai/v11/business",
500               "protocol": "REST",
501               "port": "8447",
502               "enable_ssl": true,
503               "lb_policy":"ip_hash",
504               "visualRange": "1"
505           },
506           {
507               "serviceName": "aai-business",
508               "version": "v12",
509               "url": "/aai/v12/business",
510               "protocol": "REST",
511               "port": "8447",
512               "enable_ssl": true,
513               "lb_policy":"ip_hash",
514               "visualRange": "1"
515           },
516           {
517               "serviceName": "aai-business",
518               "version": "v13",
519               "url": "/aai/v13/business",
520               "protocol": "REST",
521               "port": "8447",
522               "enable_ssl": true,
523               "lb_policy":"ip_hash",
524               "visualRange": "1"
525           },
526           {
527               "serviceName": "aai-business",
528               "version": "v14",
529               "url": "/aai/v14/business",
530               "protocol": "REST",
531               "port": "8447",
532               "enable_ssl": true,
533               "lb_policy":"ip_hash",
534               "visualRange": "1"
535           },
536           {
537               "serviceName": "aai-business",
538               "version": "v15",
539               "url": "/aai/v15/business",
540               "protocol": "REST",
541               "port": "8447",
542               "enable_ssl": true,
543               "lb_policy":"ip_hash",
544               "visualRange": "1"
545           },
546           {
547               "serviceName": "aai-business",
548               "version": "v16",
549               "url": "/aai/v16/business",
550               "protocol": "REST",
551               "port": "8447",
552               "enable_ssl": true,
553               "lb_policy":"ip_hash",
554               "visualRange": "1"
555           },
556           {
557               "serviceName": "aai-actions",
558               "version": "v11",
559               "url": "/aai/v11/actions",
560               "protocol": "REST",
561               "port": "8447",
562               "enable_ssl": true,
563               "lb_policy":"ip_hash",
564               "visualRange": "1"
565           },
566           {
567               "serviceName": "aai-actions",
568               "version": "v12",
569               "url": "/aai/v12/actions",
570               "protocol": "REST",
571               "port": "8447",
572               "enable_ssl": true,
573               "lb_policy":"ip_hash",
574               "visualRange": "1"
575           },
576           {
577               "serviceName": "aai-actions",
578               "version": "v13",
579               "url": "/aai/v13/actions",
580               "protocol": "REST",
581               "port": "8447",
582               "enable_ssl": true,
583               "lb_policy":"ip_hash",
584               "visualRange": "1"
585           },
586           {
587               "serviceName": "aai-actions",
588               "version": "v14",
589               "url": "/aai/v14/actions",
590               "protocol": "REST",
591               "port": "8447",
592               "enable_ssl": true,
593               "lb_policy":"ip_hash",
594               "visualRange": "1"
595           },
596           {
597               "serviceName": "aai-actions",
598               "version": "v15",
599               "url": "/aai/v15/actions",
600               "protocol": "REST",
601               "port": "8447",
602               "enable_ssl": true,
603               "lb_policy":"ip_hash",
604               "visualRange": "1"
605           },
606           {
607               "serviceName": "aai-actions",
608               "version": "v16",
609               "url": "/aai/v16/actions",
610               "protocol": "REST",
611               "port": "8447",
612               "enable_ssl": true,
613               "lb_policy":"ip_hash",
614               "visualRange": "1"
615           },
616           {
617               "serviceName": "aai-service-design-and-creation",
618               "version": "v11",
619               "url": "/aai/v11/service-design-and-creation",
620               "protocol": "REST",
621               "port": "8447",
622               "enable_ssl": true,
623               "lb_policy":"ip_hash",
624               "visualRange": "1"
625           },
626           {
627               "serviceName": "aai-service-design-and-creation",
628               "version": "v12",
629               "url": "/aai/v12/service-design-and-creation",
630               "protocol": "REST",
631               "port": "8447",
632               "enable_ssl": true,
633               "lb_policy":"ip_hash",
634               "visualRange": "1"
635           },
636           {
637               "serviceName": "aai-service-design-and-creation",
638               "version": "v13",
639               "url": "/aai/v13/service-design-and-creation",
640               "protocol": "REST",
641               "port": "8447",
642               "enable_ssl": true,
643               "lb_policy":"ip_hash",
644               "visualRange": "1"
645           },
646           {
647               "serviceName": "aai-service-design-and-creation",
648               "version": "v14",
649               "url": "/aai/v14/service-design-and-creation",
650               "protocol": "REST",
651               "port": "8447",
652               "enable_ssl": true,
653               "lb_policy":"ip_hash",
654               "visualRange": "1"
655           },
656           {
657               "serviceName": "aai-service-design-and-creation",
658               "version": "v15",
659               "url": "/aai/v15/service-design-and-creation",
660               "protocol": "REST",
661               "port": "8447",
662               "enable_ssl": true,
663               "lb_policy":"ip_hash",
664               "visualRange": "1"
665           },
666           {
667               "serviceName": "aai-service-design-and-creation",
668               "version": "v16",
669               "url": "/aai/v16/service-design-and-creation",
670               "protocol": "REST",
671               "port": "8447",
672               "enable_ssl": true,
673               "lb_policy":"ip_hash",
674               "visualRange": "1"
675           },
676           {
677               "serviceName": "aai-network",
678               "version": "v11",
679               "url": "/aai/v11/network",
680               "protocol": "REST",
681               "port": "8447",
682               "enable_ssl": true,
683               "lb_policy":"ip_hash",
684               "visualRange": "1"
685           },
686           {
687               "serviceName": "aai-network",
688               "version": "v12",
689               "url": "/aai/v12/network",
690               "protocol": "REST",
691               "port": "8447",
692               "enable_ssl": true,
693               "lb_policy":"ip_hash",
694               "visualRange": "1"
695           },
696           {
697               "serviceName": "aai-network",
698               "version": "v13",
699               "url": "/aai/v13/network",
700               "protocol": "REST",
701               "port": "8447",
702               "enable_ssl": true,
703               "lb_policy":"ip_hash",
704               "visualRange": "1"
705           },
706           {
707               "serviceName": "aai-network",
708               "version": "v14",
709               "url": "/aai/v14/network",
710               "protocol": "REST",
711               "port": "8447",
712               "enable_ssl": true,
713               "lb_policy":"ip_hash",
714               "visualRange": "1"
715           },
716           {
717               "serviceName": "aai-network",
718               "version": "v15",
719               "url": "/aai/v15/network",
720               "protocol": "REST",
721               "port": "8447",
722               "enable_ssl": true,
723               "lb_policy":"ip_hash",
724               "visualRange": "1"
725           },
726           {
727               "serviceName": "aai-network",
728               "version": "v16",
729               "url": "/aai/v16/network",
730               "protocol": "REST",
731               "port": "8447",
732               "enable_ssl": true,
733               "lb_policy":"ip_hash",
734               "visualRange": "1"
735           },
736           {
737               "serviceName": "aai-externalSystem",
738               "version": "v11",
739               "url": "/aai/v11/external-system",
740               "protocol": "REST",
741               "port": "8447",
742               "enable_ssl": true,
743               "lb_policy":"ip_hash",
744               "visualRange": "1"
745           },
746           {
747               "serviceName": "aai-externalSystem",
748               "version": "v12",
749               "url": "/aai/v12/external-system",
750               "protocol": "REST",
751               "port": "8447",
752               "enable_ssl": true,
753               "lb_policy":"ip_hash",
754               "visualRange": "1"
755           },
756           {
757               "serviceName": "aai-externalSystem",
758               "version": "v13",
759               "url": "/aai/v13/external-system",
760               "protocol": "REST",
761               "port": "8447",
762               "enable_ssl": true,
763               "lb_policy":"ip_hash",
764               "visualRange": "1"
765           },
766           {
767               "serviceName": "aai-externalSystem",
768               "version": "v14",
769               "url": "/aai/v14/external-system",
770               "protocol": "REST",
771               "port": "8447",
772               "enable_ssl": true,
773               "lb_policy":"ip_hash",
774               "visualRange": "1"
775           },
776           {
777               "serviceName": "aai-externalSystem",
778               "version": "v15",
779               "url": "/aai/v15/external-system",
780               "protocol": "REST",
781               "port": "8447",
782               "enable_ssl": true,
783               "lb_policy":"ip_hash",
784               "visualRange": "1"
785           },
786           {
787               "serviceName": "aai-externalSystem",
788               "version": "v16",
789               "url": "/aai/v16/external-system",
790               "protocol": "REST",
791               "port": "8447",
792               "enable_ssl": true,
793               "lb_policy":"ip_hash",
794               "visualRange": "1"
795           }
796           ]'
797     spec:
798       hostname: aai-resources
799     {{ if .Values.global.initContainers.enabled }}
800       {{ if .Values.global.installSidecarSecurity }}
801       hostAliases:
802       - ip: {{ .Values.global.aaf.serverIp }}
803         hostnames:
804         - {{ .Values.global.aaf.serverHostname }}
805       {{ end }}
806       initContainers:
807       - command:
808       {{ if .Values.global.jobs.migration.enabled }}
809         - /root/job_complete.py
810         args:
811         - --job-name
812         - {{ .Release.Name }}-aai-graphadmin-migration
813       {{  else if .Values.global.jobs.createSchema.enabled  }}
814         - /root/job_complete.py
815         args:
816         - --job-name
817         - {{ .Release.Name }}-aai-graphadmin-create-db-schema
818       {{  else }}
819         - /root/ready.py
820         args:
821         - --container-name
822         {{- if .Values.global.cassandra.localCluster }}
823         - aai-cassandra
824         {{- else }}
825         - cassandra
826         {{- end }}
827         - --container-name
828         - aai-schema-service
829       {{  end  }}
830         env:
831         - name: NAMESPACE
832           valueFrom:
833             fieldRef:
834               apiVersion: v1
835               fieldPath: metadata.namespace
836         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
837         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
838         name: {{ include "common.name" . }}-readiness
839       {{ if .Values.global.installSidecarSecurity }}
840       - name: {{ .Values.global.tproxyConfig.name }}
841         image: "{{ include "common.repository" . }}/{{ .Values.global.tproxyConfig.image }}"
842         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
843         securityContext:
844           privileged: true
845       {{ end }}
846     {{ end }}
847       containers:
848       - name: {{ include "common.name" . }}
849         image: "{{ include "common.repository" . }}/{{ .Values.image }}"
850         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
851         env:
852         - name: LOCAL_USER_ID
853           value: {{ .Values.global.config.userId | quote }}
854         - name: LOCAL_GROUP_ID
855           value: {{ .Values.global.config.groupId | quote }}
856         volumeMounts:
857         - mountPath: /etc/localtime
858           name: localtime
859           readOnly: true
860         - mountPath: /opt/app/aai-resources/resources/etc/appprops/janusgraph-realtime.properties
861           name: {{ include "common.fullname" . }}-config
862           subPath: janusgraph-realtime.properties
863         - mountPath: /opt/app/aai-resources/resources/etc/appprops/janusgraph-cached.properties
864           name: {{ include "common.fullname" . }}-config
865           subPath: janusgraph-cached.properties
866         - mountPath: /opt/app/aai-resources/resources/etc/appprops/aaiconfig.properties
867           name: {{ include "common.fullname" . }}-config
868           subPath: aaiconfig.properties
869         - mountPath: /opt/aai/logroot/AAI-RES
870           name: {{ include "common.fullname" . }}-logs
871         - mountPath: /opt/app/aai-resources/resources/logback.xml
872           name: {{ include "common.fullname" . }}-config
873           subPath: logback.xml
874         - mountPath: /opt/app/aai-resources/resources/localhost-access-logback.xml
875           name: {{ include "common.fullname" . }}-config
876           subPath: localhost-access-logback.xml
877         - mountPath: /opt/app/aai-resources/resources/etc/auth/realm.properties
878           name: {{ include "common.fullname" . }}-config
879           subPath: realm.properties
880         {{ if .Values.global.installSidecarSecurity }}
881         - mountPath: /opt/app/aai-resources/resources/etc/auth/aai_policy.json
882           name: {{ include "common.fullname" . }}-aai-policy
883           subPath: aai_policy.json
884         {{ end }}
885         - mountPath: /opt/app/aai-resources/resources/aaf/org.onap.aai.keyfile
886           name: {{ include "common.fullname" . }}-aaf-certs
887           subPath: org.onap.aai.keyfile
888         - mountPath: /opt/app/aai-resources/resources/aaf/bath_config.csv
889           name: {{ include "common.fullname" . }}-aaf-certs
890           subPath: bath_config.csv
891         - mountPath: /opt/app/aai-resources/resources/aaf/org.onap.aai.props
892           name: {{ include "common.fullname" . }}-aaf-properties
893           subPath: org.onap.aai.props
894         - mountPath: /opt/app/aai-resources/resources/aaf/org.osaaf.location.props
895           name: {{ include "common.fullname" . }}-aaf-properties
896           subPath: org.osaaf.location.props
897         - mountPath: /opt/app/aai-resources/resources/aaf/permissions.properties
898           name: {{ include "common.fullname" . }}-aaf-properties
899           subPath: permissions.properties
900         - mountPath: /opt/app/aai-resources/resources/cadi.properties
901           name: {{ include "common.fullname" . }}-aaf-properties
902           subPath: cadi.properties
903         - mountPath: /opt/app/aai-resources/resources/aaf/org.onap.aai.p12
904           name: {{ include "common.fullname" . }}-aaf-certs
905           subPath: org.onap.aai.p12
906         - mountPath: /opt/app/aai-resources/resources/aaf/truststoreONAPall.jks
907           name: aai-common-aai-auth-mount
908           subPath: truststoreONAPall.jks
909         - mountPath: /opt/app/aai-resources/resources/application.properties
910           name: {{ include "common.fullname" . }}-config
911           subPath: application.properties
912           {{ $global := . }}
913           {{ range $job := .Values.global.config.auth.files }}
914         - mountPath: /opt/app/aai-resources/resources/etc/auth/{{ . }}
915           name: {{ include "common.fullname" $global }}-auth-truststore-sec
916           subPath: {{ . }}
917           {{ end }}
918         ports:
919         - containerPort: {{ .Values.service.internalPort }}
920         - containerPort: {{ .Values.service.internalPort2 }}
921         # disable liveness probe when breakpoints set in debugger
922         # so K8s doesn't restart unresponsive container
923         {{ if .Values.liveness.enabled }}
924         livenessProbe:
925           tcpSocket:
926             port: {{ .Values.service.internalPort }}
927           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
928           periodSeconds: {{ .Values.liveness.periodSeconds }}
929         {{ end }}
930         readinessProbe:
931           tcpSocket:
932             port: {{ .Values.service.internalPort }}
933           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
934           periodSeconds: {{ .Values.readiness.periodSeconds }}
935         resources:
936 {{ include "common.resources" . }}
937       {{- if .Values.nodeSelector }}
938       nodeSelector:
939 {{ toYaml .Values.nodeSelector | indent 8 }}
940       {{- end -}}
941       {{- if .Values.affinity }}
942       affinity:
943 {{ toYaml .Values.affinity | indent 8 }}
944       {{- end }}
945
946       # side car containers
947       - name: filebeat-onap
948         image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
949         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
950         volumeMounts:
951         - mountPath: /usr/share/filebeat/filebeat.yml
952           subPath: filebeat.yml
953           name: filebeat-conf
954         - mountPath: /var/log/onap
955           name: {{ include "common.fullname" . }}-logs
956         - mountPath: /usr/share/filebeat/data
957           name: {{ include "common.fullname" . }}-filebeat
958         resources:
959 {{ include "common.resources" . }}
960     {{ if .Values.global.installSidecarSecurity }}
961       - name: {{ .Values.global.rproxy.name }}
962         image: "{{ include "common.repository" . }}/{{ .Values.global.rproxy.image }}"
963         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
964         env:
965         - name: CONFIG_HOME
966           value: "/opt/app/rproxy/config"
967         - name: KEY_STORE_PASSWORD
968           value: {{ .Values.sidecar.keyStorePassword }}
969         - name: spring_profiles_active
970           value: {{ .Values.global.rproxy.activeSpringProfiles }}
971         volumeMounts:
972         - name: {{ include "common.fullname" . }}-rproxy-config
973           mountPath: /opt/app/rproxy/config/forward-proxy.properties
974           subPath: forward-proxy.properties
975         - name: {{ include "common.fullname" . }}-rproxy-config
976           mountPath: /opt/app/rproxy/config/primary-service.properties
977           subPath: primary-service.properties
978         - name: {{ include "common.fullname" . }}-rproxy-config
979           mountPath: /opt/app/rproxy/config/reverse-proxy.properties
980           subPath: reverse-proxy.properties
981         - name: {{ include "common.fullname" . }}-rproxy-config
982           mountPath: /opt/app/rproxy/config/cadi.properties
983           subPath: cadi.properties
984         - name: {{ include "common.fullname" . }}-rproxy-log-config
985           mountPath: /opt/app/rproxy/config/logback-spring.xml
986           subPath: logback-spring.xml
987         - name: {{ include "common.fullname" . }}-rproxy-uri-auth-config
988           mountPath: /opt/app/rproxy/config/auth/uri-authorization.json
989           subPath: uri-authorization.json
990         - name: {{ include "common.fullname" . }}-rproxy-auth-config
991           mountPath: /opt/app/rproxy/config/auth/tomcat_keystore
992           subPath: tomcat_keystore
993         - name: {{ include "common.fullname" . }}-rproxy-auth-config
994           mountPath: /opt/app/rproxy/config/auth/client-cert.p12
995           subPath: client-cert.p12
996         - name: {{ include "common.fullname" . }}-rproxy-auth-config
997           mountPath: /opt/app/rproxy/config/auth/aaf_truststore.jks
998           subPath: aaf_truststore.jks
999         - name: {{ include "common.fullname" . }}-rproxy-security-config
1000           mountPath: /opt/app/rproxy/config/security/keyfile
1001           subPath: keyfile
1002         - name: {{ include "common.fullname" . }}-rproxy-auth-config
1003           mountPath: /opt/app/rproxy/config/auth/org.onap.aai.p12
1004           subPath: org.onap.aai.p12
1005         ports:
1006         - containerPort: {{ .Values.global.rproxy.port }}
1007
1008       - name: {{ .Values.global.fproxy.name }}
1009         image: "{{ include "common.repository" . }}/{{ .Values.global.fproxy.image }}"
1010         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
1011         env:
1012         - name: CONFIG_HOME
1013           value: "/opt/app/fproxy/config"
1014         - name: KEY_STORE_PASSWORD
1015           value: {{ .Values.sidecar.keyStorePassword }}
1016         - name: TRUST_STORE_PASSWORD
1017           value: {{ .Values.sidecar.trustStorePassword }}
1018         - name: spring_profiles_active
1019           value: {{ .Values.global.fproxy.activeSpringProfiles }}
1020         volumeMounts:
1021         - name: {{ include "common.fullname" . }}-fproxy-config
1022           mountPath: /opt/app/fproxy/config/fproxy.properties
1023           subPath: fproxy.properties
1024         - name: {{ include "common.fullname" . }}-fproxy-log-config
1025           mountPath: /opt/app/fproxy/config/logback-spring.xml
1026           subPath: logback-spring.xml
1027         - name: {{ include "common.fullname" . }}-fproxy-auth-config
1028           mountPath: /opt/app/fproxy/config/auth/fproxy_truststore
1029           subPath: fproxy_truststore
1030         - name: {{ include "common.fullname" . }}-fproxy-auth-config
1031           mountPath: /opt/app/fproxy/config/auth/tomcat_keystore
1032           subPath: tomcat_keystore
1033         - name: {{ include "common.fullname" . }}-fproxy-auth-config
1034           mountPath: /opt/app/fproxy/config/auth/client-cert.p12
1035           subPath: client-cert.p12
1036         ports:
1037         - containerPort: {{ .Values.global.fproxy.port }}
1038     {{ end }}
1039
1040       volumes:
1041       - name: aai-common-aai-auth-mount
1042         secret:
1043           secretName: aai-common-aai-auth
1044       - name: localtime
1045         hostPath:
1046           path: /etc/localtime
1047       - name: filebeat-conf
1048         configMap:
1049           name: aai-filebeat
1050       - name: {{ include "common.fullname" . }}-logs
1051         emptyDir: {}
1052       - name: {{ include "common.fullname" . }}-filebeat
1053         emptyDir: {}
1054       - name: {{ include "common.fullname" . }}-config
1055         configMap:
1056          name: {{ include "common.fullname" . }}-configmap
1057       - name: {{ include "common.fullname" . }}-aaf-properties
1058         configMap:
1059          name: {{ include "common.fullname" . }}-aaf-props
1060       - name: {{ include "common.fullname" . }}-aaf-certs
1061         secret:
1062          secretName: {{ include "common.fullname" . }}-aaf-keys
1063       - name: {{ include "common.fullname" . }}-auth-truststore-sec
1064         secret:
1065          secretName: aai-common-truststore
1066          items:
1067           {{ range $job := .Values.global.config.auth.files }}
1068            - key: {{ . }}
1069              path: {{ . }}
1070           {{ end }}
1071     {{ if .Values.global.installSidecarSecurity }}
1072       - name: {{ include "common.fullname" . }}-aai-policy
1073         configMap:
1074          name: {{ include "common.fullname" . }}-aai-policy-configmap
1075       - name: {{ include "common.fullname" . }}-rproxy-config
1076         configMap:
1077          name: {{ include "common.fullname" . }}-rproxy-config
1078       - name: {{ include "common.fullname" . }}-rproxy-log-config
1079         configMap:
1080          name: {{ include "common.fullname" . }}-rproxy-log-config
1081       - name: {{ include "common.fullname" . }}-rproxy-uri-auth-config
1082         configMap:
1083          name: {{ include "common.fullname" . }}-rproxy-uri-auth-config
1084       - name: {{ include "common.fullname" . }}-rproxy-auth-config
1085         secret:
1086          secretName: {{ include "common.fullname" . }}-rproxy-auth-config
1087       - name: {{ include "common.fullname" . }}-rproxy-security-config
1088         secret:
1089          secretName: {{ include "common.fullname" . }}-rproxy-security-config
1090       - name: {{ include "common.fullname" . }}-fproxy-config
1091         configMap:
1092          name: {{ include "common.fullname" . }}-fproxy-config
1093       - name: {{ include "common.fullname" . }}-fproxy-log-config
1094         configMap:
1095          name: {{ include "common.fullname" . }}-fproxy-log-config
1096       - name: {{ include "common.fullname" . }}-fproxy-auth-config
1097         secret:
1098          secretName: {{ include "common.fullname" . }}-fproxy-auth-config
1099     {{ end }}
1100       restartPolicy: {{ .Values.restartPolicy }}
1101       imagePullSecrets:
1102       - name: "{{ include "common.namespace" . }}-docker-registry-key"