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 }} |
| 19 | {{- $name := .Values.conf.ue.name }} |
| 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: |
| 36 | restartPolicy: Never |
| 37 | containers: |
| 38 | - name: ue-setup-if-job |
| 39 | image: {{ .Values.images.tags.ue | quote }} |
| 40 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 41 | securityContext: |
| 42 | privileged: true |
| 43 | runAsUser: 0 |
| 44 | command: ["bash", "-xc"] |
| 45 | args: |
| 46 | - if chroot /mnt/host-rootfs lsmod | grep -q ue_ip; then chroot /mnt/host-rootfs rmmod ue_ip; fi; |
| 47 | cp /openairinterface5g/targets/bin/ue_ip.ko /mnt/host-rootfs/tmp/ue_ip.ko; |
| 48 | chroot /mnt/host-rootfs insmod /tmp/ue_ip.ko; |
| 49 | volumeMounts: |
| 50 | - name: host-rootfs |
| 51 | mountPath: /mnt/host-rootfs |
| 52 | volumes: |
| 53 | - name: host-rootfs |
| 54 | hostPath: |
| 55 | path: / |