blob: 8d32517959f580b303ec3050f653ac34f92479b5 [file] [log] [blame]
Badhrinath Pa3a3088a2020-07-28 18:37:16 -07001{{/*
2# Copyright 2019-present Open Networking Foundation
3# Copyright 2019 Intel Corporation
4
5# SPDX-License-Identifier: Apache-2.0
6# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
7*/}}
8
9---
10apiVersion: v1
11kind: ConfigMap
12metadata:
13 name: pfcp-agent
14 labels:
15{{ tuple "pfcp-agent" . | include "omec-pfcp-agent.metadata_labels" | indent 4 }}
16data:
17 dp_config.cfg: |
18 if [ ! -d "/dev/hugepages" ]; then
19 MEMORY="--no-huge -m 1000"
20 fi
21 CORES="-c $(taskset -p $$ | awk '{print $NF}')"
22 EAL_ARGS="${CORES} ${MEMORY} {{ .Values.config.pfcpAgent.pci }}"
23
24 {{- if .Values.config.sriov.enabled }}
25 S1U_DEVNAME={{ .Values.config.pfcpAgent.s1u.device }}
26 {{- else }}
27 S1U_DEVNAME={{ .Values.config.pfcpAgent.s1u.device }}-veth
28 {{- end }}
29 {{- if .Values.config.sriov.enabled }}
30 SGI_DEVNAME={{ .Values.config.pfcpAgent.sgi.device }}
31 {{- else }}
32 SGI_DEVNAME={{ .Values.config.pfcpAgent.sgi.device }}-veth
33 {{- end }}
34
35 S1U_IP=$(ip -4 addr show dev ${S1U_DEVNAME} | grep -oP '(?<=inet\s)\d+(\.\d+){3}')
36 SGI_IP=$(ip -4 addr show dev ${SGI_DEVNAME} | grep -oP '(?<=inet\s)\d+(\.\d+){3}')
37 S1U_MAC=$(ip addr show dev ${S1U_DEVNAME} | awk '$1=="link/ether"{print $2}')
38 SGI_MAC=$(ip addr show dev ${SGI_DEVNAME} | awk '$1=="link/ether"{print $2}')
39
40 S1U="--s1u_ip ${S1U_IP} --s1u_mac ${S1U_MAC} --ul_iface ${S1U_DEVNAME}"
41 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 }}"
42 IP_POOL="--ip_pool {{ .Values.config.pfcpAgent.ueIpPool.ip }} --ip_pool_mask {{ .Values.config.pfcpAgent.ueIpPool.mask }}"
43 S1U_MASK="--s1u_mask {{ .Values.config.pfcpAgent.ueIpPool.s1u_mask }}"
44 P4RTC_SERVICE_NAME="--p4rtc_service_name {{.Values.config.pfcpAgent.p4rtc_service.name }}"
45 P4RTC_PORT="--p4rtc_port {{.Values.config.pfcpAgent.p4rtc_service.port }}"
46 MISC="--log 1"
47 SPGW_CFG="--spgw_cfg 03"
48
49 APP_ARGS="${S1U} ${SGI} ${IP_POOL} ${S1U_MASK} ${P4RTC_SERVICE_NAME} ${P4RTC_PORT} ${MISC} ${SPGW_CFG}"
50 cdr.cfg: |
51 CDR_PATH=./cdr
52 MASTER_CDR=./cdr/master.csv
53 interface.cfg: |
54 [0]
55 zmq_protocol = udp
56 dp_comm_ip = DP_ADDR
57 dp_comm_port = 8805
58{{- if .Values.config.pfcpAgent.multiUpfs }}
59 cp_nb_ip = {{ .Values.config.pfcpAgent.cpComm.addr }}
60 cp_nb_port = {{ .Values.config.pfcpAgent.cpComm.port }}
61 cp_comm_ip = {{ .Values.config.pfcpAgent.cpComm.addr }}
62 cp_comm_port = {{ .Values.config.pfcpAgent.cpComm.port }}
63 zmq_dp_ip=127.0.0.1
64 zmq_cp_ip=127.0.0.1
65{{- else }}
66 cp_comm_ip = {{ .Values.config.pfcpAgent.cpComm.addr }}
67 cp_comm_port = {{ .Values.config.pfcpAgent.cpComm.port }}
68{{- end }}
69{{- if not .Values.config.sriov.enabled }}
70 setup-af-iface.sh: |
71{{ tuple "bin/_pfcp-agent-setup-af-iface.sh.tpl" . | include "omec-pfcp-agent.template" | indent 4 }}
72{{- end }}
73 run.sh: |
74{{ tuple "bin/_pfcp-agent-run.sh.tpl" . | include "omec-pfcp-agent.template" | indent 4 }}