Jeremy Ronquillo | ec2d3e4 | 2020-06-05 11:33:39 -0700 | [diff] [blame] | 1 | |
| 2 | |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 3 | {{/* |
Jeremy Ronquillo | ec2d3e4 | 2020-06-05 11:33:39 -0700 | [diff] [blame] | 4 | # Copyright 2019-present Open Networking Foundation |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 5 | |
Jeremy Ronquillo | 6046ce3 | 2020-06-18 11:06:29 -0700 | [diff] [blame] | 6 | # SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 7 | */}} |
| 8 | |
| 9 | --- |
| 10 | apiVersion: batch/v1 |
| 11 | kind: Job |
| 12 | metadata: |
| 13 | name: job-hss-db-sync |
| 14 | labels: |
| 15 | {{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }} |
| 16 | spec: |
| 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 |