blob: 103b908491c7a3073318e5f5d8a87b1e148d2f87 [file] [log] [blame]
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +00001# 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
15apiVersion: batch/v1
16kind: Job
17metadata:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000018 name: {{ .Release.Name }}-create-config
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000019 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 }}
25spec:
26 template:
27 metadata:
28 labels:
29 app: aaf-init-job
30 release: {{ .Release.Name }}
31 spec:
32 containers:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000033 - name: {{ include "common.name" . }}-config-container
34 image: "{{ include "common.repository" . }}/{{ .Values.aaf_config.image }}"
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000035 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000036 volumeMounts:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000037 - 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 Khinda5e3f36a2018-09-24 15:25:42 +000054 resources:
55{{ include "common.resources" . | indent 12 }}
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000056 {{- 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 Khinda6dcc80d2018-10-09 14:47:35 +000065 - name: {{ include "common.name" . }}-config-vol
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000066 {{- if .Values.global.persistence.enabled }}
67 persistentVolumeClaim:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000068 claimName: {{ .Release.Name }}-config
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000069 {{- else }}
70 emptyDir: {}
71 {{- end }}
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000072 restartPolicy: OnFailure
73 imagePullSecrets:
74 - name: "{{ include "common.namespace" . }}-docker-registry-key"