vagrant | 1a3a355 | 2018-03-10 23:56:32 +0000 | [diff] [blame] | 1 | # Copyright © 2017-2018 AT&T |
toshrajbhardwaj | f4fc1c6 | 2018-08-06 07:35:14 +0000 | [diff] [blame] | 2 | # Modifications Copyright © 2018 Amdocs, Bell Canada |
vagrant | 1a3a355 | 2018-03-10 23:56:32 +0000 | [diff] [blame] | 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 | |
Kajur, Harish (vk250x) | 00107b5 | 2018-09-06 14:44:40 -0400 | [diff] [blame] | 16 | {{ if .Values.global.jobs.updateQueryData.enabled }} |
| 17 | |
vagrant | 1a3a355 | 2018-03-10 23:56:32 +0000 | [diff] [blame] | 18 | apiVersion: batch/v1 |
| 19 | kind: Job |
| 20 | metadata: |
| 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 }} |
| 28 | spec: |
| 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 |
Kajur, Harish (vk250x) | 829a7b3 | 2018-11-07 12:51:35 -0500 | [diff] [blame] | 42 | {{ if eq .Values.global.aafEnabled true }} |
| 43 | - --container-name |
| 44 | - aaf-locate |
| 45 | {{ end }} |
vagrant | 1a3a355 | 2018-03-10 23:56:32 +0000 | [diff] [blame] | 46 | env: |
| 47 | - name: NAMESPACE |
| 48 | valueFrom: |
| 49 | fieldRef: |
| 50 | apiVersion: v1 |
| 51 | fieldPath: metadata.namespace |
| 52 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 53 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 54 | name: {{ include "common.name" . }}-readiness |
| 55 | containers: |
| 56 | - name: {{ include "common.name" . }}-job |
BorislavG | df11cd5 | 2018-05-06 12:55:20 +0000 | [diff] [blame] | 57 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
vagrant | 1a3a355 | 2018-03-10 23:56:32 +0000 | [diff] [blame] | 58 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 59 | command: |
| 60 | - bash |
| 61 | - "-c" |
| 62 | - | |
| 63 | set -x |
| 64 | mkdir -p /opt/aai/logroot/AAI-GQ/misc |
Kajur, Harish (vk250x) | 9a07450 | 2018-10-08 20:45:03 -0400 | [diff] [blame] | 65 | until nc -w10 -z -v aai.{{.Release.Namespace}} 8443; do echo "Retrying to reach aai on port 8443"; done; |
vagrant | 1a3a355 | 2018-03-10 23:56:32 +0000 | [diff] [blame] | 66 | bash -x /opt/app/aai-traversal/docker-entrypoint.sh install/updateQueryData.sh |
| 67 | env: |
| 68 | - name: LOCAL_USER_ID |
Kajur, Harish (vk250x) | 00107b5 | 2018-09-06 14:44:40 -0400 | [diff] [blame] | 69 | value: {{ .Values.global.config.userId | quote }} |
vagrant | 1a3a355 | 2018-03-10 23:56:32 +0000 | [diff] [blame] | 70 | - name: LOCAL_GROUP_ID |
Kajur, Harish (vk250x) | 00107b5 | 2018-09-06 14:44:40 -0400 | [diff] [blame] | 71 | value: {{ .Values.global.config.groupId | quote }} |
vagrant | 1a3a355 | 2018-03-10 23:56:32 +0000 | [diff] [blame] | 72 | volumeMounts: |
| 73 | - mountPath: /etc/localtime |
| 74 | name: localtime |
| 75 | readOnly: true |
| 76 | - mountPath: /opt/app/aai-traversal/resources/etc/appprops/janusgraph-realtime.properties |
| 77 | name: {{ include "common.fullname" . }}-db-real-conf |
| 78 | subPath: janusgraph-realtime.properties |
| 79 | - mountPath: /opt/app/aai-traversal/resources/etc/appprops/janusgraph-cached.properties |
| 80 | name: {{ include "common.fullname" . }}-db-cached-conf |
| 81 | subPath: janusgraph-cached.properties |
| 82 | - mountPath: /opt/app/aai-traversal/resources/etc/appprops/aaiconfig.properties |
| 83 | name: {{ include "common.fullname" . }}-aaiconfig-conf |
| 84 | subPath: aaiconfig.properties |
Kajur, Harish (vk250x) | 791688e | 2018-10-17 18:25:28 -0400 | [diff] [blame] | 85 | - mountPath: /opt/aai/logroot/AAI-GQ/ |
vagrant | 1a3a355 | 2018-03-10 23:56:32 +0000 | [diff] [blame] | 86 | name: {{ include "common.fullname" . }}-logs |
| 87 | - mountPath: /opt/app/aai-traversal/resources/logback.xml |
| 88 | name: {{ include "common.fullname" . }}-log-conf |
| 89 | subPath: logback.xml |
| 90 | - mountPath: /opt/app/aai-traversal/resources/localhost-access-logback.xml |
| 91 | name: {{ include "common.fullname" . }}-localhost-access-log-conf |
| 92 | subPath: localhost-access-logback.xml |
| 93 | - mountPath: /opt/app/aai-traversal/resources/application.properties |
| 94 | name: {{ include "common.fullname" . }}-springapp-conf |
| 95 | subPath: application.properties |
Kajur, Harish (vk250x) | 00107b5 | 2018-09-06 14:44:40 -0400 | [diff] [blame] | 96 | {{ $global := . }} |
| 97 | {{ range $job := .Values.global.config.auth.files }} |
| 98 | - mountPath: /opt/app/aai-traversal/resources/etc/auth/{{ . }} |
| 99 | name: {{ include "common.fullname" $global }}-auth-truststore-sec |
| 100 | subPath: {{ . }} |
| 101 | {{ end }} |
vagrant | 1a3a355 | 2018-03-10 23:56:32 +0000 | [diff] [blame] | 102 | # disable liveness probe when breakpoints set in debugger |
| 103 | # so K8s doesn't restart unresponsive container |
vagrant | 1a3a355 | 2018-03-10 23:56:32 +0000 | [diff] [blame] | 104 | volumes: |
| 105 | - name: localtime |
| 106 | hostPath: |
| 107 | path: /etc/localtime |
| 108 | - name: filebeat-conf |
| 109 | configMap: |
| 110 | name: aai-filebeat |
| 111 | - name: {{ include "common.fullname" . }}-logs |
| 112 | hostPath: |
BorislavG | 56857c4 | 2018-05-03 14:29:51 +0000 | [diff] [blame] | 113 | path: {{ .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}-update-query |
vagrant | 1a3a355 | 2018-03-10 23:56:32 +0000 | [diff] [blame] | 114 | - name: {{ include "common.fullname" . }}-filebeat |
| 115 | emptyDir: {} |
| 116 | - name: {{ include "common.fullname" . }}-log-conf |
| 117 | configMap: |
| 118 | name: {{ include "common.fullname" . }}-log |
| 119 | - name: {{ include "common.fullname" . }}-localhost-access-log-conf |
| 120 | configMap: |
| 121 | name: {{ include "common.fullname" . }}-localhost-access-log-configmap |
| 122 | - name: {{ include "common.fullname" . }}-db-real-conf |
| 123 | configMap: |
| 124 | name: {{ include "common.fullname" . }}-db-real-configmap |
| 125 | - name: {{ include "common.fullname" . }}-db-cached-conf |
| 126 | configMap: |
| 127 | name: {{ include "common.fullname" . }}-db-cached-configmap |
| 128 | - name: {{ include "common.fullname" . }}-aaiconfig-conf |
| 129 | configMap: |
| 130 | name: {{ include "common.fullname" . }}-aaiconfig-configmap |
| 131 | - name: {{ include "common.fullname" . }}-springapp-conf |
| 132 | configMap: |
| 133 | name: {{ include "common.fullname" . }}-springapp-configmap |
| 134 | - name: {{ include "common.fullname" . }}-realm-conf |
| 135 | configMap: |
| 136 | name: {{ include "common.fullname" . }}-realm-configmap |
Kajur, Harish (vk250x) | 00107b5 | 2018-09-06 14:44:40 -0400 | [diff] [blame] | 137 | - name: {{ include "common.fullname" . }}-auth-truststore-sec |
vagrant | 1a3a355 | 2018-03-10 23:56:32 +0000 | [diff] [blame] | 138 | secret: |
Kajur, Harish (vk250x) | 00107b5 | 2018-09-06 14:44:40 -0400 | [diff] [blame] | 139 | secretName: aai-auth-truststore-secret |
| 140 | items: |
| 141 | {{ range $job := .Values.global.config.auth.files }} |
| 142 | - key: {{ . }} |
| 143 | path: {{ . }} |
| 144 | {{ end }} |
vagrant | 1a3a355 | 2018-03-10 23:56:32 +0000 | [diff] [blame] | 145 | restartPolicy: OnFailure |
| 146 | imagePullSecrets: |
| 147 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
Kajur, Harish (vk250x) | 00107b5 | 2018-09-06 14:44:40 -0400 | [diff] [blame] | 148 | {{ end }} |