vvp -- VNF Validation Platform
[oom.git] / kubernetes / aaf / templates / job.yaml
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:
18   name: {{ .Release.Name }}-create-config
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:
33       - name: {{ include "common.name" . }}-config-container
34         image: "{{ include "common.repository" . }}/{{ .Values.aaf_config.image }}"
35         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
36         volumeMounts:
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 }}"
54         resources:
55 {{ include "common.resources" . | indent 12 }}
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:
65       - name: {{ include "common.name" . }}-config-vol
66       {{- if .Values.global.persistence.enabled }}
67         persistentVolumeClaim:
68           claimName: {{ .Release.Name }}-config
69       {{- else }}
70         emptyDir: {}
71       {{- end }}
72       restartPolicy: OnFailure
73       imagePullSecrets:
74       - name: "{{ include "common.namespace" . }}-docker-registry-key"