Jeremy Ronquillo | 223db00 | 2020-06-05 10:28:22 -0700 | [diff] [blame] | 1 | {{/* |
| 2 | Copyright 2019-present Open Networking Foundation |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | */}} |
| 16 | |
| 17 | --- |
| 18 | apiVersion: batch/v1 |
| 19 | kind: Job |
| 20 | metadata: |
| 21 | name: job-hss-db-sync |
| 22 | labels: |
| 23 | {{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }} |
| 24 | spec: |
| 25 | template: |
| 26 | metadata: |
| 27 | {{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 8 }} |
| 28 | spec: |
| 29 | {{- if .Values.nodeSelectors.enabled }} |
| 30 | nodeSelector: |
| 31 | {{ .Values.nodeSelectors.hss.label }}: {{ .Values.nodeSelectors.hss.value }} |
| 32 | {{- end }} |
| 33 | restartPolicy: OnFailure |
| 34 | serviceAccountName: hss |
| 35 | initContainers: |
| 36 | {{- if .Values.cassandra.deploy }} |
| 37 | - name: job-db-sync-dep-check |
| 38 | image: {{ .Values.images.tags.depCheck | quote }} |
| 39 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 40 | securityContext: |
| 41 | allowPrivilegeEscalation: false |
| 42 | readOnlyRootFilesystem: false |
| 43 | runAsUser: 0 |
| 44 | env: |
| 45 | - name: NAMESPACE |
| 46 | valueFrom: |
| 47 | fieldRef: |
| 48 | apiVersion: v1 |
| 49 | fieldPath: metadata.namespace |
| 50 | - name: PATH |
| 51 | value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/ |
| 52 | - name: COMMAND |
| 53 | value: "echo done" |
| 54 | - name: DEPENDENCY_SERVICE |
| 55 | value: {{ .Values.config.hss.hssdb }} |
| 56 | command: |
| 57 | - kubernetes-entrypoint |
| 58 | volumeMounts: |
| 59 | [] |
| 60 | {{- end }} |
| 61 | containers: |
| 62 | - name: hss-db-sync |
| 63 | image: {{ .Values.images.tags.hssdb }} |
| 64 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 65 | command: ["bash", "-xc"] |
| 66 | args: |
| 67 | - until cqlsh --file /opt/c3po/hssdb/oai_db.cql {{ .Values.config.hss.hssdb }}; do echo "Provisioning HSSDB"; sleep 2;done |