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