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