blob: bf3cbcd4e652944d93f6aa76508fe597b8057c41 [file] [log] [blame]
Jeremy Ronquilloec2d3e42020-06-05 11:33:39 -07001
2
Jeremy Ronquillo223db002020-06-05 10:28:22 -07003{{/*
Jeremy Ronquilloec2d3e42020-06-05 11:33:39 -07004# Copyright 2019-present Open Networking Foundation
Jeremy Ronquillo223db002020-06-05 10:28:22 -07005
Jeremy Ronquilloec2d3e42020-06-05 11:33:39 -07006# SPDX-License-Identifier: Apache-2.0
7# SPDX-License-Identifier: LicenseRef-ONF-Member-Only
Jeremy Ronquillo223db002020-06-05 10:28:22 -07008*/}}
9
10---
11apiVersion: batch/v1
12kind: Job
13metadata:
14 name: job-hss-db-sync
15 labels:
16{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
17spec:
18 template:
19 metadata:
20{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 8 }}
21 spec:
22 {{- if .Values.nodeSelectors.enabled }}
23 nodeSelector:
24 {{ .Values.nodeSelectors.hss.label }}: {{ .Values.nodeSelectors.hss.value }}
25 {{- end }}
26 restartPolicy: OnFailure
27 serviceAccountName: hss
28 initContainers:
29 {{- if .Values.cassandra.deploy }}
30 - name: job-db-sync-dep-check
31 image: {{ .Values.images.tags.depCheck | quote }}
32 imagePullPolicy: {{ .Values.images.pullPolicy }}
33 securityContext:
34 allowPrivilegeEscalation: false
35 readOnlyRootFilesystem: false
36 runAsUser: 0
37 env:
38 - name: NAMESPACE
39 valueFrom:
40 fieldRef:
41 apiVersion: v1
42 fieldPath: metadata.namespace
43 - name: PATH
44 value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
45 - name: COMMAND
46 value: "echo done"
47 - name: DEPENDENCY_SERVICE
48 value: {{ .Values.config.hss.hssdb }}
49 command:
50 - kubernetes-entrypoint
51 volumeMounts:
52 []
53 {{- end }}
54 containers:
55 - name: hss-db-sync
56 image: {{ .Values.images.tags.hssdb }}
57 imagePullPolicy: {{ .Values.images.pullPolicy }}
58 command: ["bash", "-xc"]
59 args:
60 - until cqlsh --file /opt/c3po/hssdb/oai_db.cql {{ .Values.config.hss.hssdb }}; do echo "Provisioning HSSDB"; sleep 2;done