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