blob: 91175780422acc6d1fbe846adbd2ee68a476bb33 [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 }}
Hyunsun Moon43eadcc2019-08-20 16:16:08 -060019{{- $name := .Values.config.ue.name }}
Hyunsun Mooned19c092019-07-10 15:24:45 -060020---
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:
Hyunsun Moon43eadcc2019-08-20 16:16:08 -060036 {{- if .Values.nodeSelectors.enabled }}
37 nodeSelector:
38 {{ .Values.nodeSelectors.ue.label }}: {{ .Values.nodeSelectors.ue.value }}
39 {{- end }}
Hyunsun Mooned19c092019-07-10 15:24:45 -060040 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: /