Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [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 | {{- $releaseName := .Release.Name }} |
| 18 | {{- $namespace := .Release.Namespace }} |
Hyunsun Moon | 43eadcc | 2019-08-20 16:16:08 -0600 | [diff] [blame] | 19 | {{- $name := .Values.config.ue.name }} |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 20 | --- |
| 21 | apiVersion: batch/v1 |
| 22 | kind: Job |
| 23 | metadata: |
| 24 | name: {{ $name }}-setup-if |
| 25 | labels: |
| 26 | app: {{ $name }} |
| 27 | annotations: |
| 28 | "helm.sh/hook": pre-install |
| 29 | "helm.sh/hook-delete-policy": hook-succeeded |
| 30 | spec: |
| 31 | template: |
| 32 | metadata: |
| 33 | labels: |
| 34 | app: {{ $name }} |
| 35 | spec: |
Hyunsun Moon | 43eadcc | 2019-08-20 16:16:08 -0600 | [diff] [blame] | 36 | {{- if .Values.nodeSelectors.enabled }} |
| 37 | nodeSelector: |
| 38 | {{ .Values.nodeSelectors.ue.label }}: {{ .Values.nodeSelectors.ue.value }} |
| 39 | {{- end }} |
Hyunsun Moon | ed19c09 | 2019-07-10 15:24:45 -0600 | [diff] [blame] | 40 | restartPolicy: Never |
| 41 | containers: |
| 42 | - name: ue-setup-if-job |
| 43 | image: {{ .Values.images.tags.ue | quote }} |
| 44 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 45 | securityContext: |
| 46 | privileged: true |
| 47 | runAsUser: 0 |
| 48 | command: ["bash", "-xc"] |
| 49 | args: |
| 50 | - if chroot /mnt/host-rootfs lsmod | grep -q ue_ip; then chroot /mnt/host-rootfs rmmod ue_ip; fi; |
| 51 | cp /openairinterface5g/targets/bin/ue_ip.ko /mnt/host-rootfs/tmp/ue_ip.ko; |
| 52 | chroot /mnt/host-rootfs insmod /tmp/ue_ip.ko; |
| 53 | volumeMounts: |
| 54 | - name: host-rootfs |
| 55 | mountPath: /mnt/host-rootfs |
| 56 | volumes: |
| 57 | - name: host-rootfs |
| 58 | hostPath: |
| 59 | path: / |