Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 1 | # Copyright © 2017 Amdocs, Bell Canada |
| 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: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 18 | name: {{ .Release.Name }}-create-config |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 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: aaf-init-job |
| 30 | release: {{ .Release.Name }} |
| 31 | spec: |
| 32 | containers: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 33 | - name: {{ include "common.name" . }}-config-container |
| 34 | image: "{{ include "common.repository" . }}/{{ .Values.aaf_config.image }}" |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 35 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 36 | volumeMounts: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 37 | - mountPath: "/opt/app/osaaf" |
| 38 | name: {{ include "common.name" . }}-config-vol |
| 39 | env: |
| 40 | - name: HOSTNAME |
| 41 | value: "{{ .Values.global.cadi.hostname }}" |
| 42 | - name: AAF_ENV |
| 43 | value: "{{ .Values.global.cadi.aaf_env }}" |
| 44 | - name: AAF_REGISTER_AS |
| 45 | value: "{{ .Values.global.cadi.aaf_register_as }}" |
| 46 | - name: LATITUDE |
| 47 | value: "{{ .Values.global.cadi.cadi_latitude }}" |
| 48 | - name: LONGITUDE |
| 49 | value: "{{ .Values.global.cadi.cadi_longitude }}" |
| 50 | - name: CASS_HOST |
| 51 | value: "{{ .Values.global.cassandraServiceName }}" |
| 52 | - name: AAF_LOCATOR_AS |
| 53 | value: "{{ .Values.global.locateServiceName }}" |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 54 | resources: |
| 55 | {{ include "common.resources" . | indent 12 }} |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 56 | {{- if .Values.nodeSelector }} |
| 57 | nodeSelector: |
| 58 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 59 | {{- end -}} |
| 60 | {{- if .Values.affinity }} |
| 61 | affinity: |
| 62 | {{ toYaml .Values.affinity | indent 10 }} |
| 63 | {{- end }} |
| 64 | volumes: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 65 | - name: {{ include "common.name" . }}-config-vol |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 66 | {{- if .Values.global.persistence.enabled }} |
| 67 | persistentVolumeClaim: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 68 | claimName: {{ .Release.Name }}-config |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 69 | {{- else }} |
| 70 | emptyDir: {} |
| 71 | {{- end }} |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 72 | restartPolicy: OnFailure |
| 73 | imagePullSecrets: |
| 74 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |