blob: a018ede1a39d8d3ac8155f3d7feef5ae8e3b2ab3 [file] [log] [blame]
vagrant1a3a3552018-03-10 23:56:32 +00001# Copyright © 2017-2018 AT&T
toshrajbhardwajf4fc1c62018-08-06 07:35:14 +00002# Modifications Copyright © 2018 Amdocs, Bell Canada
vagrant1a3a3552018-03-10 23:56:32 +00003#
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
Kajur, Harish (vk250x)00107b52018-09-06 14:44:40 -040016{{ if .Values.global.jobs.updateQueryData.enabled }}
17
vagrant1a3a3552018-03-10 23:56:32 +000018apiVersion: batch/v1
19kind: Job
20metadata:
21 name: {{ include "common.fullname" . }}-update-query-data
22 namespace: {{ include "common.namespace" . }}
23 labels:
24 app: {{ include "common.name" . }}
25 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
26 release: {{ .Release.Name }}
27 heritage: {{ .Release.Service }}
28spec:
29 template:
30 metadata:
31 labels:
32 app: {{ include "common.name" . }}-job
33 release: {{ .Release.Name }}
34 name: {{ include "common.name" . }}
35 spec:
36 initContainers:
37 - command:
38 - /root/ready.py
39 args:
40 - --container-name
41 - aai
42 env:
43 - name: NAMESPACE
44 valueFrom:
45 fieldRef:
46 apiVersion: v1
47 fieldPath: metadata.namespace
48 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
49 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
50 name: {{ include "common.name" . }}-readiness
51 containers:
52 - name: {{ include "common.name" . }}-job
BorislavGdf11cd52018-05-06 12:55:20 +000053 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
vagrant1a3a3552018-03-10 23:56:32 +000054 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
55 command:
56 - bash
57 - "-c"
58 - |
59 set -x
60 mkdir -p /opt/aai/logroot/AAI-GQ/misc
61 bash -x /opt/app/aai-traversal/docker-entrypoint.sh install/updateQueryData.sh
62 env:
63 - name: LOCAL_USER_ID
Kajur, Harish (vk250x)00107b52018-09-06 14:44:40 -040064 value: {{ .Values.global.config.userId | quote }}
vagrant1a3a3552018-03-10 23:56:32 +000065 - name: LOCAL_GROUP_ID
Kajur, Harish (vk250x)00107b52018-09-06 14:44:40 -040066 value: {{ .Values.global.config.groupId | quote }}
vagrant1a3a3552018-03-10 23:56:32 +000067 volumeMounts:
68 - mountPath: /etc/localtime
69 name: localtime
70 readOnly: true
71 - mountPath: /opt/app/aai-traversal/resources/etc/appprops/janusgraph-realtime.properties
72 name: {{ include "common.fullname" . }}-db-real-conf
73 subPath: janusgraph-realtime.properties
74 - mountPath: /opt/app/aai-traversal/resources/etc/appprops/janusgraph-cached.properties
75 name: {{ include "common.fullname" . }}-db-cached-conf
76 subPath: janusgraph-cached.properties
77 - mountPath: /opt/app/aai-traversal/resources/etc/appprops/aaiconfig.properties
78 name: {{ include "common.fullname" . }}-aaiconfig-conf
79 subPath: aaiconfig.properties
80 - mountPath: /var/log/onap
81 name: {{ include "common.fullname" . }}-logs
82 - mountPath: /opt/app/aai-traversal/resources/logback.xml
83 name: {{ include "common.fullname" . }}-log-conf
84 subPath: logback.xml
85 - mountPath: /opt/app/aai-traversal/resources/localhost-access-logback.xml
86 name: {{ include "common.fullname" . }}-localhost-access-log-conf
87 subPath: localhost-access-logback.xml
88 - mountPath: /opt/app/aai-traversal/resources/application.properties
89 name: {{ include "common.fullname" . }}-springapp-conf
90 subPath: application.properties
Kajur, Harish (vk250x)00107b52018-09-06 14:44:40 -040091 {{ $global := . }}
92 {{ range $job := .Values.global.config.auth.files }}
93 - mountPath: /opt/app/aai-traversal/resources/etc/auth/{{ . }}
94 name: {{ include "common.fullname" $global }}-auth-truststore-sec
95 subPath: {{ . }}
96 {{ end }}
vagrant1a3a3552018-03-10 23:56:32 +000097 # disable liveness probe when breakpoints set in debugger
98 # so K8s doesn't restart unresponsive container
vagrant1a3a3552018-03-10 23:56:32 +000099 volumes:
100 - name: localtime
101 hostPath:
102 path: /etc/localtime
103 - name: filebeat-conf
104 configMap:
105 name: aai-filebeat
106 - name: {{ include "common.fullname" . }}-logs
107 hostPath:
BorislavG56857c42018-05-03 14:29:51 +0000108 path: {{ .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}-update-query
vagrant1a3a3552018-03-10 23:56:32 +0000109 - name: {{ include "common.fullname" . }}-filebeat
110 emptyDir: {}
111 - name: {{ include "common.fullname" . }}-log-conf
112 configMap:
113 name: {{ include "common.fullname" . }}-log
114 - name: {{ include "common.fullname" . }}-localhost-access-log-conf
115 configMap:
116 name: {{ include "common.fullname" . }}-localhost-access-log-configmap
117 - name: {{ include "common.fullname" . }}-db-real-conf
118 configMap:
119 name: {{ include "common.fullname" . }}-db-real-configmap
120 - name: {{ include "common.fullname" . }}-db-cached-conf
121 configMap:
122 name: {{ include "common.fullname" . }}-db-cached-configmap
123 - name: {{ include "common.fullname" . }}-aaiconfig-conf
124 configMap:
125 name: {{ include "common.fullname" . }}-aaiconfig-configmap
126 - name: {{ include "common.fullname" . }}-springapp-conf
127 configMap:
128 name: {{ include "common.fullname" . }}-springapp-configmap
129 - name: {{ include "common.fullname" . }}-realm-conf
130 configMap:
131 name: {{ include "common.fullname" . }}-realm-configmap
Kajur, Harish (vk250x)00107b52018-09-06 14:44:40 -0400132 - name: {{ include "common.fullname" . }}-auth-truststore-sec
vagrant1a3a3552018-03-10 23:56:32 +0000133 secret:
Kajur, Harish (vk250x)00107b52018-09-06 14:44:40 -0400134 secretName: aai-auth-truststore-secret
135 items:
136 {{ range $job := .Values.global.config.auth.files }}
137 - key: {{ . }}
138 path: {{ . }}
139 {{ end }}
vagrant1a3a3552018-03-10 23:56:32 +0000140 restartPolicy: OnFailure
141 imagePullSecrets:
142 - name: "{{ include "common.namespace" . }}-docker-registry-key"
Kajur, Harish (vk250x)00107b52018-09-06 14:44:40 -0400143{{ end }}