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 | |
| 7 | {{- if .Values.config.hss.bootstrap }} |
| 8 | --- |
| 9 | apiVersion: batch/v1 |
| 10 | kind: Job |
| 11 | metadata: |
| 12 | name: job-hss-bootstrap |
| 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 | - name: job-bootstrap-dep-check |
| 28 | image: {{ .Values.images.tags.depCheck | quote }} |
| 29 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 30 | securityContext: |
| 31 | allowPrivilegeEscalation: false |
| 32 | readOnlyRootFilesystem: false |
| 33 | runAsUser: 0 |
| 34 | env: |
| 35 | - name: NAMESPACE |
| 36 | valueFrom: |
| 37 | fieldRef: |
| 38 | apiVersion: v1 |
| 39 | fieldPath: metadata.namespace |
| 40 | - name: PATH |
| 41 | value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/ |
| 42 | - name: COMMAND |
| 43 | value: "echo done" |
| 44 | - name: DEPENDENCY_JOBS |
| 45 | value: job-hss-db-sync |
| 46 | command: |
| 47 | - kubernetes-entrypoint |
| 48 | volumeMounts: |
| 49 | [] |
| 50 | containers: |
| 51 | - name: hss-bootstrap |
| 52 | image: {{ .Values.images.tags.hssdb }} |
| 53 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 54 | command: ["/opt/c3po/hss/hss-bootstrap.sh"] |
| 55 | volumeMounts: |
| 56 | - name: hss-script |
| 57 | mountPath: /opt/c3po/hss/hss-bootstrap.sh |
| 58 | subPath: hss-bootstrap.sh |
| 59 | volumes: |
| 60 | - name: hss-script |
| 61 | configMap: |
| 62 | name: hss |
| 63 | defaultMode: 493 |
| 64 | {{- end }} |