Merge "Update from using hbase to using cassandra"
[oom.git] / kubernetes / aai / charts / aai-traversal / templates / job.yaml
1 # Copyright © 2017-2018 AT&T
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 apiVersion: batch/v1
16 kind: Job
17 metadata:
18   name: {{ include "common.fullname" . }}-update-query-data
19   namespace: {{ include "common.namespace" . }}
20   labels:
21     app: {{ include "common.name" . }}
22     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
23     release: {{ .Release.Name }}
24     heritage: {{ .Release.Service }}
25 spec:
26   template:
27     metadata:
28       labels:
29         app: {{ include "common.name" . }}-job
30         release: {{ .Release.Name }}
31       name: {{ include "common.name" . }}
32     spec:
33       initContainers:
34       - command:
35         - /root/ready.py
36         args:
37         - --container-name
38         - aai
39         env:
40         - name: NAMESPACE
41           valueFrom:
42             fieldRef:
43               apiVersion: v1
44               fieldPath: metadata.namespace
45         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
46         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
47         name: {{ include "common.name" . }}-readiness
48       containers:
49       - name: {{ include "common.name" . }}-job
50         image: "{{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }}"
51         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52         command:
53         - bash
54         - "-c"
55         - |
56           set -x
57           mkdir -p /opt/aai/logroot/AAI-GQ/misc
58           bash -x /opt/app/aai-traversal/docker-entrypoint.sh install/updateQueryData.sh
59         env:
60         - name: LOCAL_USER_ID
61           value: "1000"
62         - name: LOCAL_GROUP_ID
63           value: "1000"
64         volumeMounts:
65         - mountPath: /etc/localtime
66           name: localtime
67           readOnly: true
68         - mountPath: /opt/app/aai-traversal/resources/etc/appprops/janusgraph-realtime.properties
69           name: {{ include "common.fullname" . }}-db-real-conf
70           subPath: janusgraph-realtime.properties
71         - mountPath: /opt/app/aai-traversal/resources/etc/appprops/janusgraph-cached.properties
72           name: {{ include "common.fullname" . }}-db-cached-conf
73           subPath: janusgraph-cached.properties
74         - mountPath: /opt/app/aai-traversal/resources/etc/appprops/aaiconfig.properties
75           name: {{ include "common.fullname" . }}-aaiconfig-conf
76           subPath: aaiconfig.properties
77         - mountPath: /var/log/onap
78           name: {{ include "common.fullname" . }}-logs
79         - mountPath: /opt/app/aai-traversal/resources/logback.xml
80           name: {{ include "common.fullname" . }}-log-conf
81           subPath: logback.xml
82         - mountPath: /opt/app/aai-traversal/resources/localhost-access-logback.xml
83           name: {{ include "common.fullname" . }}-localhost-access-log-conf
84           subPath: localhost-access-logback.xml
85         - mountPath: /opt/app/aai-traversal/resources/application.properties
86           name: {{ include "common.fullname" . }}-springapp-conf
87           subPath: application.properties
88         - mountPath: /opt/app/aai-traversal/resources/etc/auth/aai_keystore
89           name: {{ include "common.fullname" . }}-auth-sec
90           subPath: aai_keystore
91         # disable liveness probe when breakpoints set in debugger
92         # so K8s doesn't restart unresponsive container
93         volumeMounts:
94         - mountPath: /usr/share/filebeat/filebeat.yml
95           subPath: filebeat.yml
96           name: filebeat-conf
97         - mountPath: /opt/aai/logroot/AAI-GQ
98           name: {{ include "common.fullname" . }}-logs
99         - mountPath: /usr/share/filebeat/data
100           name: {{ include "common.fullname" . }}-filebeat
101       volumes:
102       - name: localtime
103         hostPath:
104           path: /etc/localtime
105       - name: filebeat-conf
106         configMap:
107           name: aai-filebeat
108       - name: {{ include "common.fullname" . }}-logs
109         hostPath:
110           path: {{ .Values.persistence.mountPath }}/{{ include "common.namespace" . }}/{{ .Values.persistence.mountSubPath }}-update-query
111       - name: {{ include "common.fullname" . }}-filebeat
112         emptyDir: {}
113       - name: {{ include "common.fullname" . }}-log-conf
114         configMap:
115          name: {{ include "common.fullname" . }}-log
116       - name: {{ include "common.fullname" . }}-localhost-access-log-conf
117         configMap:
118          name: {{ include "common.fullname" . }}-localhost-access-log-configmap
119       - name: {{ include "common.fullname" . }}-db-real-conf
120         configMap:
121          name: {{ include "common.fullname" . }}-db-real-configmap
122       - name: {{ include "common.fullname" . }}-db-cached-conf
123         configMap:
124          name: {{ include "common.fullname" . }}-db-cached-configmap
125       - name: {{ include "common.fullname" . }}-aaiconfig-conf
126         configMap:
127          name: {{ include "common.fullname" . }}-aaiconfig-configmap
128       - name: {{ include "common.fullname" . }}-springapp-conf
129         configMap:
130          name: {{ include "common.fullname" . }}-springapp-configmap
131       - name: {{ include "common.fullname" . }}-realm-conf
132         configMap:
133          name: {{ include "common.fullname" . }}-realm-configmap
134       - name: {{ include "common.fullname" . }}-auth-sec
135         secret:
136          secretName: {{ include "common.fullname" . }}-auth-secret
137       restartPolicy: OnFailure
138       imagePullSecrets:
139       - name: "{{ include "common.namespace" . }}-docker-registry-key"