blob: 3a589d06e1ba22dee4620b56ed84740721e55966 [file] [log] [blame]
Hyunsun Moon06f98552019-08-15 13:44:47 -06001{{/*
2Copyright 2019-present Open Networking Foundation
3Copyright 2019 Intel Corporation
4
5Licensed under the Apache License, Version 2.0 (the "License");
6you may not use this file except in compliance with the License.
7You may obtain a copy of the License at
8
9http://www.apache.org/licenses/LICENSE-2.0
10
11Unless required by applicable law or agreed to in writing, software
12distributed under the License is distributed on an "AS IS" BASIS,
13WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14See the License for the specific language governing permissions and
15limitations under the License.
16*/}}
Hyunsun Moonc4a7d542019-08-22 18:53:40 -050017
Hyunsun Moona24d3f92019-06-19 03:04:58 -050018---
19apiVersion: v1
20kind: ConfigMap
21metadata:
Hyunsun Moon06f98552019-08-15 13:44:47 -060022 name: spgwu
23 labels:
Hyunsun Moon7a007bb2019-08-19 16:41:36 -060024{{ tuple "spgwu" . | include "omec-data-plane.metadata_labels" | indent 4 }}
Hyunsun Moona24d3f92019-06-19 03:04:58 -050025data:
26 dp_config.cfg: |
27 if [ ! -d "/dev/hugepages" ]; then
28 MEMORY="--no-huge -m $((MEM_LIMIT-1024))"
29 fi
Hyunsun Moona24d3f92019-06-19 03:04:58 -050030 CORES="-c $(taskset -p $$ | awk '{print $NF}')"
Hyunsun Moon7a921d12019-08-21 20:52:09 -050031 EAL_ARGS="${CORES} ${MEMORY} {{ .Values.config.spgwu.devices }}"
Hyunsun Moona24d3f92019-06-19 03:04:58 -050032
Hyunsun Moon7a921d12019-08-21 20:52:09 -050033 {{- if .Values.config.sriov.enabled }}
34 S1U_DEVNAME={{ .Values.config.spgwu.s1u.device }}
35 {{- else }}
36 S1U_DEVNAME={{ .Values.config.spgwu.s1u.device }}-veth
37 {{- end }}
38 {{- if .Values.config.sriov.enabled }}
39 SGI_DEVNAME={{ .Values.config.spgwu.sgi.device }}
40 {{- else }}
41 SGI_DEVNAME={{ .Values.config.spgwu.sgi.device }}-veth
42 {{- end }}
43
Hyunsun Moona24d3f92019-06-19 03:04:58 -050044 S1U_IP=$(ip -4 addr show dev ${S1U_DEVNAME} | grep -oP '(?<=inet\s)\d+(\.\d+){3}')
45 SGI_IP=$(ip -4 addr show dev ${SGI_DEVNAME} | grep -oP '(?<=inet\s)\d+(\.\d+){3}')
46 S1U_MAC=$(ip addr show dev ${S1U_DEVNAME} | awk '$1=="link/ether"{print $2}')
47 SGI_MAC=$(ip addr show dev ${SGI_DEVNAME} | awk '$1=="link/ether"{print $2}')
Hyunsun Moon7a921d12019-08-21 20:52:09 -050048
Hyunsun Moona24d3f92019-06-19 03:04:58 -050049 S1U="--s1u_ip ${S1U_IP} --s1u_mac ${S1U_MAC} --ul_iface ${S1U_DEVNAME}"
Hyunsun Moon7a921d12019-08-21 20:52:09 -050050 SGI="--sgi_ip ${SGI_IP} --sgi_mac ${SGI_MAC} --dl_iface ${SGI_DEVNAME} --sgi_gw_ip {{ .Values.networks.sgi.gateway }} --sgi_mask {{ .Values.networks.sgi.mask }}"
Hyunsun Moona24d3f92019-06-19 03:04:58 -050051 MISC="--log 1"
Hyunsun Moon7a921d12019-08-21 20:52:09 -050052 SPGW_CFG="--spgw_cfg 03"
53
Hyunsun Moona24d3f92019-06-19 03:04:58 -050054 APP_ARGS="${S1U} ${SGI} ${MISC} ${SPGW_CFG}"
55 cdr.cfg: |
56 CDR_PATH=./cdr
57 MASTER_CDR=./cdr/master.csv
58 interface.cfg: |
59 [0]
60 dp_comm_ip = DP_ADDR
61 dp_comm_port = 20
Hyunsun Moonc4a7d542019-08-22 18:53:40 -050062 cp_comm_ip = {{ .Values.config.spgwu.cpComm.addr }}
63 cp_comm_port = {{ .Values.config.spgwu.cpComm.port }}
Hyunsun Moon7a007bb2019-08-19 16:41:36 -060064{{- if not .Values.config.sriov.enabled }}
Hyunsun Moona24d3f92019-06-19 03:04:58 -050065 setup-af-iface.sh: |
Hyunsun Moon7a007bb2019-08-19 16:41:36 -060066{{ tuple "bin/_spgwu-setup-af-iface.sh.tpl" . | include "omec-data-plane.template" | indent 4 }}
Hyunsun Moona24d3f92019-06-19 03:04:58 -050067{{- end }}
Hyunsun Moon06f98552019-08-15 13:44:47 -060068 run.sh: |
Hyunsun Moon7a007bb2019-08-19 16:41:36 -060069{{ tuple "bin/_spgwu-run.sh.tpl" . | include "omec-data-plane.template" | indent 4 }}