Sylvain Desbureaux | 47eb4d2 | 2020-12-10 12:15:27 +0100 | [diff] [blame] | 1 | {{/* |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 2 | # Copyright (c) 2017-2018 AT&T |
| 3 | # Modifications Copyright (c) 2018 Amdocs, Bell Canada |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 4 | # Modifications Copyright (c) 2020 Nokia, Orange |
efiacor | d12c167 | 2023-03-23 12:10:50 +0000 | [diff] [blame^] | 5 | # Modifications Copyright © 2023 Nordix Foundation |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 6 | # |
| 7 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | # you may not use this file except in compliance with the License. |
| 9 | # You may obtain a copy of the License at |
| 10 | # |
| 11 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | # |
| 13 | # Unless required by applicable law or agreed to in writing, software |
| 14 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | # See the License for the specific language governing permissions and |
| 17 | # limitations under the License. |
Sylvain Desbureaux | 47eb4d2 | 2020-12-10 12:15:27 +0100 | [diff] [blame] | 18 | */}} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 19 | |
| 20 | {{ if .Values.global.jobs.updateQueryData.enabled }} |
| 21 | |
| 22 | apiVersion: batch/v1 |
| 23 | kind: Job |
| 24 | metadata: |
| 25 | name: {{ include "common.fullname" . }}-update-query-data |
| 26 | namespace: {{ include "common.namespace" . }} |
| 27 | labels: |
| 28 | app: {{ include "common.name" . }} |
| 29 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
| 30 | release: {{ include "common.release" . }} |
| 31 | heritage: {{ .Release.Service }} |
| 32 | {{ if .Values.global.jobs.migration.enabled }} |
| 33 | annotations: |
| 34 | "helm.sh/hook": post-upgrade,post-rollback,post-install |
| 35 | "helm.sh/hook-weight": "2" |
| 36 | "helm.sh/hook-delete-policy": before-hook-creation |
| 37 | {{ end }} |
| 38 | spec: |
| 39 | template: |
| 40 | metadata: |
| 41 | labels: |
| 42 | app: {{ include "common.name" . }}-job |
| 43 | release: {{ include "common.release" . }} |
| 44 | name: {{ include "common.name" . }} |
| 45 | spec: |
| 46 | initContainers: |
| 47 | - command: |
| 48 | - /app/ready.py |
| 49 | args: |
| 50 | - --container-name |
| 51 | - aai |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 52 | env: |
| 53 | - name: NAMESPACE |
| 54 | valueFrom: |
| 55 | fieldRef: |
| 56 | apiVersion: v1 |
| 57 | fieldPath: metadata.namespace |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 58 | image: {{ include "repositoryGenerator.image.readiness" . }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 59 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 60 | name: {{ include "common.name" . }}-readiness |
| 61 | containers: |
| 62 | - name: {{ include "common.name" . }}-job |
Sylvain Desbureaux | 5b65132 | 2020-12-07 15:34:15 +0100 | [diff] [blame] | 63 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 64 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 65 | command: |
| 66 | - bash |
| 67 | - "-c" |
| 68 | - | |
osk11461 | 27fd7d8 | 2021-06-18 00:51:17 +0200 | [diff] [blame] | 69 | set -x |
| 70 | if [ ! -d /opt/aai/logroot/AAI-GQ/misc ]; then mkdir -p /opt/aai/logroot/AAI-GQ/misc; fi |
osk11461 | 27fd7d8 | 2021-06-18 00:51:17 +0200 | [diff] [blame] | 71 | until nc -w10 -z -v aai.{{.Release.Namespace}} 80; do echo "Retrying to reach aai on port 80"; done; |
| 72 | bash -x /opt/app/aai-traversal/docker-entrypoint.sh install/updateQueryData.sh ; |
othman touijer | 5117667 | 2021-12-01 16:21:18 +0100 | [diff] [blame] | 73 | {{ include "common.serviceMesh.killSidecar" . | indent 11 | trim }} |
efiacor | d12c167 | 2023-03-23 12:10:50 +0000 | [diff] [blame^] | 74 | |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 75 | env: |
| 76 | - name: LOCAL_USER_ID |
| 77 | value: {{ .Values.global.config.userId | quote }} |
| 78 | - name: LOCAL_GROUP_ID |
| 79 | value: {{ .Values.global.config.groupId | quote }} |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 80 | resources: {{ include "common.resources" . | nindent 10 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 81 | volumeMounts: |
| 82 | - mountPath: /etc/localtime |
| 83 | name: localtime |
| 84 | readOnly: true |
| 85 | - mountPath: /opt/app/aai-traversal/resources/etc/appprops/janusgraph-realtime.properties |
| 86 | name: {{ include "common.fullname" . }}-config |
| 87 | subPath: janusgraph-realtime.properties |
| 88 | - mountPath: /opt/app/aai-traversal/resources/etc/appprops/janusgraph-cached.properties |
| 89 | name: {{ include "common.fullname" . }}-config |
| 90 | subPath: janusgraph-cached.properties |
| 91 | - mountPath: /opt/app/aai-traversal/resources/etc/appprops/aaiconfig.properties |
| 92 | name: {{ include "common.fullname" . }}-config |
| 93 | subPath: aaiconfig.properties |
| 94 | - mountPath: /opt/aai/logroot/AAI-GQ/ |
| 95 | name: {{ include "common.fullname" . }}-logs |
| 96 | - mountPath: /opt/aai/logroot/AAI-GQ/misc |
| 97 | name: {{ include "common.fullname" . }}-logs-misc |
| 98 | - mountPath: /opt/app/aai-traversal/resources/logback.xml |
| 99 | name: {{ include "common.fullname" . }}-config |
| 100 | subPath: logback.xml |
| 101 | - mountPath: /opt/app/aai-traversal/resources/localhost-access-logback.xml |
| 102 | name: {{ include "common.fullname" . }}-config |
| 103 | subPath: localhost-access-logback.xml |
| 104 | - mountPath: /opt/app/aai-traversal/resources/application.properties |
| 105 | name: {{ include "common.fullname" . }}-config |
| 106 | subPath: application.properties |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 107 | # disable liveness probe when breakpoints set in debugger |
| 108 | # so K8s doesn't restart unresponsive container |
| 109 | volumes: |
| 110 | - name: localtime |
| 111 | hostPath: |
| 112 | path: /etc/localtime |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 113 | - name: {{ include "common.fullname" . }}-logs |
| 114 | emptyDir: {} |
| 115 | - name: {{ include "common.fullname" . }}-logs-misc |
| 116 | emptyDir: {} |
Maciej Wereski | d523d12 | 2021-09-21 11:22:13 +0200 | [diff] [blame] | 117 | {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 118 | - name: {{ include "common.fullname" . }}-config |
| 119 | configMap: |
Sylvain Desbureaux | a41dfc0 | 2021-02-15 10:14:22 +0100 | [diff] [blame] | 120 | name: {{ include "common.fullname" . }} |
Sylvain Desbureaux | 7007041 | 2020-11-09 21:58:48 +0100 | [diff] [blame] | 121 | restartPolicy: OnFailure |
| 122 | imagePullSecrets: |
| 123 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
| 124 | {{ end }} |