blob: 1578d9bb2f06236570561fc6fff4c42d4eccd2bb [file] [log] [blame]
Hyunsun Mooned19c092019-07-10 15:24:45 -06001{{/*
2Copyright 2019-present Open Networking Foundation
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/}}
16
17{{- $releaseName := .Release.Name }}
18{{- $namespace := .Release.Namespace }}
19{{- $name := .Values.conf.ue.name }}
20---
21apiVersion: batch/v1
22kind: Job
23metadata:
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
30spec:
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: /