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 | ec2d3e4 | 2020-06-05 11:33:39 -0700 | [diff] [blame^] | 6 | # SPDX-License-Identifier: Apache-2.0 |
| 7 | # SPDX-License-Identifier: LicenseRef-ONF-Member-Only |
Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 8 | */}} |
| 9 | |
| 10 | --- |
| 11 | apiVersion: batch/v1 |
| 12 | kind: Job |
| 13 | metadata: |
| 14 | name: job-hss-db-sync |
| 15 | labels: |
| 16 | {{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }} |
| 17 | spec: |
| 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 |