blob: 81319c16a4001080d1f51dbbbb5f9cca6179268a [file] [log] [blame]
Jeremy Ronquillo223db002020-06-05 10:28:22 -07001{{/*
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*/}}
17
18---
19apiVersion: v1
20kind: ConfigMap
21metadata:
22 name: spgwu
23 labels:
24{{ tuple "spgwu" . | include "omec-data-plane.metadata_labels" | indent 4 }}
25data:
26 dp_config.cfg: |
27 if [ ! -d "/dev/hugepages" ]; then
28 MEMORY="--no-huge -m $((MEM_LIMIT-1024))"
29 fi
30 CORES="-c $(taskset -p $$ | awk '{print $NF}')"
31 EAL_ARGS="${CORES} ${MEMORY} {{ .Values.config.spgwu.devices }}"
32
33 {{- 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
44 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}')
48
49 S1U="--s1u_ip ${S1U_IP} --s1u_mac ${S1U_MAC} --ul_iface ${S1U_DEVNAME}"
50 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 }}"
51 MISC="--log 1"
52 SPGW_CFG="--spgw_cfg 03"
53
54 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 zmq_protocol = tcp
61 dp_comm_ip = DP_ADDR
62 dp_comm_port = 20
63{{- if .Values.config.spgwu.multiUpfs }}
64 cp_nb_ip = {{ .Values.config.spgwu.cpComm.addr }}
65 cp_nb_port = {{ .Values.config.spgwu.cpComm.port }}
66 cp_comm_ip = {{ .Values.config.spgwu.cpComm.addr }}
67 cp_comm_port = {{ .Values.config.spgwu.cpComm.port }}
68 zmq_dp_ip=127.0.0.1
69 zmq_cp_ip=127.0.0.1
70{{- else }}
71 cp_comm_ip = {{ .Values.config.spgwu.cpComm.addr }}
72 cp_comm_port = {{ .Values.config.spgwu.cpComm.port }}
73{{- end }}
74{{- if not .Values.config.sriov.enabled }}
75 setup-af-iface.sh: |
76{{ tuple "bin/_spgwu-setup-af-iface.sh.tpl" . | include "omec-data-plane.template" | indent 4 }}
77{{- end }}
78 run.sh: |
79{{ tuple "bin/_spgwu-run.sh.tpl" . | include "omec-data-plane.template" | indent 4 }}