blob: 17f3213206fc0d98ebcc8d3ca71423a290a9f780 [file] [log] [blame]
Hyunsun Mooned24cac2019-08-26 20:52:20 -05001{{/*
2Copyright 2019-present Open Networking Foundation
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/}}
16
17---
18apiVersion: batch/v1
19kind: Job
20metadata:
21 name: job-hss-db-sync
22 labels:
23{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
24spec:
25 template:
26 metadata:
27{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 8 }}
28 spec:
29 {{- if .Values.nodeSelectors.enabled }}
30 nodeSelector:
31 {{ .Values.nodeSelectors.hss.label }}: {{ .Values.nodeSelectors.hss.value }}
32 {{- end }}
33 restartPolicy: OnFailure
34 serviceAccountName: hss
35 initContainers:
36 {{- if .Values.cassandra.deploy }}
37 - name: job-db-sync-dep-check
38 image: {{ .Values.images.tags.depCheck | quote }}
39 imagePullPolicy: {{ .Values.images.pullPolicy }}
40 securityContext:
41 allowPrivilegeEscalation: false
42 readOnlyRootFilesystem: false
43 runAsUser: 0
44 env:
45 - name: NAMESPACE
46 valueFrom:
47 fieldRef:
48 apiVersion: v1
49 fieldPath: metadata.namespace
50 - name: PATH
51 value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
52 - name: COMMAND
53 value: "echo done"
54 - name: DEPENDENCY_SERVICE
55 value: {{ .Values.config.hss.hssdb }}
56 command:
57 - kubernetes-entrypoint
58 volumeMounts:
59 []
60 {{- end }}
61 containers:
62 - name: hss-db-sync
63 image: {{ .Values.images.tags.hssdb }}
64 imagePullPolicy: {{ .Values.images.pullPolicy }}
65 command: ["bash", "-xc"]
66 args:
67 - until cqlsh --file /opt/c3po/hssdb/oai_db.cql {{ .Values.config.hss.hssdb }}; do echo "Provisioning HSSDB"; sleep 2;done