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