COMAC-171,COMAC-172,COMAC-173 Restructure mcord-release charts
Done
- Rename mcord-services to omec
- Split mcord-services to omec-data-plane and omec-control-plane
- Merge mcord-setup to omec-data-plane chart
- Move cdn-services outside of omec
- Work fine in single cluster
To do
- Make it work in multi-cluster
Change-Id: Ic91d7732b844347b9f0a78a97b5d6d888d00887b
diff --git a/omec/assets/omec-architecture.png b/omec/assets/omec-architecture.png
new file mode 100644
index 0000000..e36d0e8
--- /dev/null
+++ b/omec/assets/omec-architecture.png
Binary files differ
diff --git a/omec/omec-control-plane/.gitignore b/omec/omec-control-plane/.gitignore
new file mode 100644
index 0000000..ee3892e
--- /dev/null
+++ b/omec/omec-control-plane/.gitignore
@@ -0,0 +1 @@
+charts/
diff --git a/omec/omec-control-plane/.helmignore b/omec/omec-control-plane/.helmignore
new file mode 100644
index 0000000..f0c1319
--- /dev/null
+++ b/omec/omec-control-plane/.helmignore
@@ -0,0 +1,21 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
diff --git a/omec/omec-control-plane/Chart.yaml b/omec/omec-control-plane/Chart.yaml
new file mode 100644
index 0000000..fc625fb
--- /dev/null
+++ b/omec/omec-control-plane/Chart.yaml
@@ -0,0 +1,21 @@
+---
+# Copyright 2018-present Open Networking Foundation
+# Copyright 2018 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: v1
+appVersion: "1.0"
+description: OMEC control plane services
+name: omec-control-plane
+version: 0.1.0
diff --git a/omec/omec-control-plane/requirements.yaml b/omec/omec-control-plane/requirements.yaml
new file mode 100644
index 0000000..ec39473
--- /dev/null
+++ b/omec/omec-control-plane/requirements.yaml
@@ -0,0 +1,19 @@
+# Copyright 2019-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+dependencies:
+ - name: cassandra
+ version: 0.13.1
+ repository: https://kubernetes-charts-incubator.storage.googleapis.com/
+ condition: cassandra.deploy
diff --git a/omec/omec-control-plane/templates/NOTES.txt b/omec/omec-control-plane/templates/NOTES.txt
new file mode 100644
index 0000000..a5a7136
--- /dev/null
+++ b/omec/omec-control-plane/templates/NOTES.txt
@@ -0,0 +1,28 @@
+{{- /*
+# Copyright 2018-present Open Networking Foundation
+# Copyright 2018 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+*/ -}}
+
+This is the instruction to configure your eNodeB to work with ONF M-CORD. You can find architecture illustration in assets/mcord-architecture.png.
+
+1. Configure eNodeB with the correct MME information.
+ export MMEIP=[node IP]
+ export MMEPORT="36412"
+
+ You can change MMEPORT by overriding "Values.config.mme.s1ap.sctp_port_external".
+
+2. Make sure UE's SIM card information is configured in hss.yaml.
+
+3. Attach UE to OMEC.
diff --git a/omec/omec-control-plane/templates/_helpers.tpl b/omec/omec-control-plane/templates/_helpers.tpl
new file mode 100644
index 0000000..91aa5b6
--- /dev/null
+++ b/omec/omec-control-plane/templates/_helpers.tpl
@@ -0,0 +1,53 @@
+{{- /*
+# Copyright 2018-present Open Networking Foundation
+# Copyright 2018 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+*/ -}}
+
+{{/*
+Renders a set of standardised labels
+*/}}
+{{- define "omec-control-plane.metadata_labels" -}}
+{{- $application := index . 0 -}}
+{{- $context := index . 1 -}}
+release: {{ $context.Release.Name }}
+app: {{ $application }}
+{{- end -}}
+
+{{/*
+Render the given template.
+*/}}
+{{- define "omec-control-plane.template" -}}
+{{- $name := index . 0 -}}
+{{- $context := index . 1 -}}
+{{- $last := base $context.Template.Name }}
+{{- $wtf := $context.Template.Name | replace $last $name -}}
+{{ include $wtf $context }}
+{{- end -}}
+
+{{/*
+Return identity, realm, and hostname of the first pod of the given statefulset.
+*/}}
+{{- define "omec-control-plane.endpoint_lookup" -}}
+{{- $service := index . 0 -}}
+{{- $type := index . 1 -}}
+{{- $context := index . 2 -}}
+{{- if eq $type "identity" -}}
+{{- printf "%s-0.%s.%s.svc.%s" $service $service $context.Release.Namespace "cluster.local" -}}
+{{- else if eq $type "realm" -}}
+{{- printf "%s.%s.svc.%s" $service $context.Release.Namespace "cluster.local" -}}
+{{- else if eq $type "host" -}}
+{{- printf "%s-0" $service -}}
+{{- end -}}
+{{- end -}}
diff --git a/omec/omec-control-plane/templates/bin/_mme-init.sh.tpl b/omec/omec-control-plane/templates/bin/_mme-init.sh.tpl
new file mode 100644
index 0000000..0b2e163
--- /dev/null
+++ b/omec/omec-control-plane/templates/bin/_mme-init.sh.tpl
@@ -0,0 +1,53 @@
+#!/bin/sh
+#
+# Copyright 2019-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -ex
+
+cp /opt/mme/config/config.json /opt/mme/config/shared/config.json
+cd /opt/mme/config/shared
+
+# Set local IP address for s1ap and s11 networks to the config
+jq --arg MME_LOCAL_IP "$MME_LOCAL_IP" '.mme.ip_addr=$MME_LOCAL_IP' config.json > config.tmp && mv config.tmp config.json
+jq --arg MME_LOCAL_IP "$MME_LOCAL_IP" '.s1ap.s1ap_local_addr=$MME_LOCAL_IP' config.json > config.tmp && mv config.tmp config.json
+jq --arg MME_LOCAL_IP "$MME_LOCAL_IP" '.s11.egtp_local_addr=$MME_LOCAL_IP' config.json > config.tmp && mv config.tmp config.json
+
+# Set SPGW-C address to the config
+SPGWC_POD={{ tuple "spgwc" "identity" . | include "omec-control-plane.endpoint_lookup" | quote }}
+SPGWC_ADDR=$(dig +short $SPGWC_POD)
+jq --arg SPGWC_ADDR "$SPGWC_ADDR" '.s11.sgw_addr //= $SPGWC_ADDR' config.json > config.tmp && mv config.tmp config.json
+jq --arg SPGWC_ADDR "$SPGWC_ADDR" '.s11.pgw_addr //= $SPGWC_ADDR' config.json > config.tmp && mv config.tmp config.json
+
+# Add additional redundant keys - should be fixed in openmme
+HSS_TYPE=$(jq -r '.s6a.host_type' config.json)
+HSS_HOST=$(jq -r '.s6a.host' config.json)
+jq --arg HSS_TYPE "$HSS_TYPE" '.s6a.hss_type=$HSS_TYPE' config.json > config.tmp && mv config.tmp config.json
+jq --arg HSS_HOST "$HSS_HOST" '.s6a.host_name=$HSS_HOST' config.json > config.tmp && mv config.tmp config.json
+
+# Copy the final configs for each applications
+cp /opt/mme/config/shared/config.json /opt/mme/config/shared/mme.json
+cp /opt/mme/config/shared/config.json /opt/mme/config/shared/s11.json
+cp /opt/mme/config/shared/config.json /opt/mme/config/shared/s1ap.json
+cp /opt/mme/config/shared/config.json /opt/mme/config/shared/s6a.json
+cp /opt/mme/config/s6a_fd.conf /opt/mme/config/shared/s6a_fd.conf
+
+# Generate certs
+MME_IDENTITY={{ tuple "mme" "identity" . | include "omec-control-plane.endpoint_lookup" | quote }};
+DIAMETER_HOST=$(echo $MME_IDENTITY | cut -d'.' -f1)
+DIAMETER_REALM={{ tuple "mme" "realm" . | include "omec-control-plane.endpoint_lookup" | quote }};
+
+cp /openmme/target/conf/make_certs.sh /opt/mme/config/shared/make_certs.sh
+cd /opt/mme/config/shared
+./make_certs.sh $DIAMETER_HOST $DIAMETER_REALM
diff --git a/omec/omec-control-plane/templates/bin/_mme-run.sh.tpl b/omec/omec-control-plane/templates/bin/_mme-run.sh.tpl
new file mode 100644
index 0000000..6b7718b
--- /dev/null
+++ b/omec/omec-control-plane/templates/bin/_mme-run.sh.tpl
@@ -0,0 +1,55 @@
+#!/bin/bash
+#
+# Copyright 2019-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+APPLICATION=$1
+
+# copy config files to openmme target directly
+cp /opt/mme/config/shared/* /openmme/target/conf/
+
+cd /openmme/target
+export LD_LIBRARY_PATH=/usr/local/lib:./lib
+
+case $APPLICATION in
+ "mme-app")
+ echo "Starting mme-app"
+ echo "conf/mme.json"
+ cat conf/mme.json
+ ./bin/mme-app
+ ;;
+ "s1ap-app")
+ echo "Starting s1ap-app"
+ echo "conf/s1ap.json"
+ cat conf/s1ap.json
+ ./bin/s1ap-app
+ ;;
+ "s6a-app")
+ echo "Starting s6a-app"
+ echo "conf/s6a.json"
+ cat conf/s6a.json
+ echo "conf/s6a_fd.conf"
+ cat conf/s6a_fd.conf
+ ./bin/s6a-app
+ ;;
+ "s11-app")
+ echo "Starting s11-app"
+ echo "conf/s11.json"
+ cat conf/s11.json
+ ./bin/s11-app
+ ;;
+ *)
+ echo "invalid app $APPLICATION"
+ ;;
+esac
diff --git a/omec/omec-control-plane/templates/configmap-mme.yaml b/omec/omec-control-plane/templates/configmap-mme.yaml
new file mode 100644
index 0000000..6b33a51
--- /dev/null
+++ b/omec/omec-control-plane/templates/configmap-mme.yaml
@@ -0,0 +1,114 @@
+{{/*
+Copyright 2019-present Open Networking Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/}}
+
+{{- if not (hasKey .Values.config.mme.s6a "host") -}}
+{{- $_ := tuple "hss" "identity" . | include "omec-control-plane.endpoint_lookup" | set .Values.config.mme.s6a "host" -}}
+{{- end }}
+{{- if not (hasKey .Values.config.mme.s6a "realm") -}}
+{{- $_ := tuple "hss" "realm" . | include "omec-control-plane.endpoint_lookup" | set .Values.config.mme.s6a "realm" -}}
+{{- end }}
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: mme
+ labels:
+{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+data:
+ config.json: {{ toJson .Values.config.mme | quote }}
+ s6a_fd.conf: |
+ # -------- Test configuration ---------
+ AppServThreads = 40;
+ SCTP_streams = 3;
+ NoRelay;
+ No_IPv6;
+
+ # Identity = "<diameter_host>.<diameter_realm>";
+ Identity = {{ tuple "mme" "identity" . | include "omec-control-plane.endpoint_lookup" | quote }};
+ Realm = {{ tuple "mme" "realm" . | include "omec-control-plane.endpoint_lookup" | quote }};
+ # Port = 3868;
+ # SecPort = 3869;
+
+ ConnectPeer = {{ tuple "hss" "identity" . | include "omec-control-plane.endpoint_lookup" | quote }} { No_TLS; port = 3868; };
+
+ # TLS_Cred = "<diameter_host>.cert.pem", "<diameter_host>.key.pem";
+ TLS_Cred = "conf/{{ tuple "mme" "host" . | include "omec-control-plane.endpoint_lookup" }}.cert.pem",
+ "conf/{{ tuple "mme" "host" . | include "omec-control-plane.endpoint_lookup" }}.key.pem";
+ TLS_CA = "conf/cacert.pem";
+
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_3gpp2_avps.fdx";
+ #LoadExtension = "/usr/local/lib/freeDiameter/dict_CreditControl.fdx";
+ #LoadExtension = "/usr/local/lib/freeDiameter/dict_base_rfc6733.fdx";
+ ###
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_draftload_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_etsi283034_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4004_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4006bis_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4072_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4590_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5447_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5580_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5777_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5778_avps.fdx";
+ ###
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc6734_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc6942_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7155_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7683_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7944_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29061_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29128_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29154_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29173_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29212_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29214_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29215_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29217_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29229_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29272_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29273_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29329_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29336_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29337_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29338_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29343_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29344_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29345_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29368_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29468_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts32299_avps.fdx";
+ #LoadExtension = "/usr/local/lib/freeDiameter/dict_CxDx.fdx";
+ #LoadExtension = "/usr/local/lib/freeDiameter/dict_Gx.fdx";
+ #LoadExtension = "/usr/local/lib/freeDiameter/dict_NAS.fdx";
+ #LoadExtension = "/usr/local/lib/freeDiameter/dict_Rf.fdx";
+ #LoadExtension = "/usr/local/lib/freeDiameter/dict_Ro.fdx";
+ #LoadExtension = "/usr/local/lib/freeDiameter/dict_Rx.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_S6as6d.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_S6c.fdx";
+ #LoadExtension = "/usr/local/lib/freeDiameter/dict_S6mS6n.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_S6t.fdx";
+ #LoadExtension = "/usr/local/lib/freeDiameter/dict_S9.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_SGd.fdx";
+ #LoadExtension = "/usr/local/lib/freeDiameter/dict_SLh.fdx";
+ #LoadExtension = "/usr/local/lib/freeDiameter/dict_Sd.fdx";
+ #LoadExtension = "/usr/local/lib/freeDiameter/dict_Sh.fdx";
+ #LoadExtension = "/usr/local/lib/freeDiameter/dict_T4.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_T6aT6bT7.fdx";
+ #LoadExtension = "/usr/local/lib/freeDiameter/dict_Tsp.fdx";
+ mme-init.sh: |
+{{ tuple "bin/_mme-init.sh.tpl" . | include "omec-control-plane.template" | indent 4 }}
+ mme-run.sh : |
+{{ tuple "bin/_mme-run.sh.tpl" . | include "omec-control-plane.template" | indent 4 }}
diff --git a/omec/omec-control-plane/templates/hss.yaml b/omec/omec-control-plane/templates/hss.yaml
new file mode 100644
index 0000000..f773eb1
--- /dev/null
+++ b/omec/omec-control-plane/templates/hss.yaml
@@ -0,0 +1,297 @@
+{{/*
+Copyright 2018-present Open Networking Foundation
+Copyright 2018 Intel Corporation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+Default values for mcord-vepc-helm.
+This is a YAML-formatted file.
+Declare variables to be passed into your templates.
+*/}}
+
+{{- if not (hasKey .Values.config.hss "hssdb") -}}
+{{- $_ := .Values.cassandra.fullnameOverride | set .Values.config.hss "hssdb" -}}
+{{- end }}
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: hss
+ labels:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+data:
+ acl.conf: |
+ ALLOW_OLD_TLS *.cluster.local
+ hss.conf: |
+ Identity = "HSS_IDENTITY";
+ Realm = "HSS_REALM";
+ TLS_Cred = "CONF_DIR/HSS_HOST.cert.pem", "CONF_DIR/HSS_HOST.key.pem";
+ TLS_CA = "CONF_DIR/cacert.pem";
+ No_SCTP;
+ Prefer_TCP;
+ No_IPv6;
+ SCTP_streams = 3;
+ NoRelay;
+ AppServThreads = 4;
+ Port = 3868;
+ SecPort = 5868;
+ LoadExtension = "/usr/local/lib/freeDiameter/acl_wl.fdx" : "CONF_DIR/acl.conf";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_3gpp2_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_draftload_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_etsi283034_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4004_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4006bis_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4072_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4590_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5447_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5580_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5777_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5778_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc6734_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc6942_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7155_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7683_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7944_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29061_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29128_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29154_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29173_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29212_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29214_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29215_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29217_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29229_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29272_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29273_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29329_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29336_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29337_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29338_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29343_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29344_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29345_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29368_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29468_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_ts32299_avps.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_S6as6d.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_S6t.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_S6c.fdx";
+ hss.json: |
+ {"common": {
+ "fdcfg": "CONF_DIR/hss.conf",
+ "originhost": "HSS_IDENTITY",
+ "originrealm": "HSS_REALM"
+ },
+ "hss": {
+ "gtwhost": "*",
+ "gtwport" : 9080,
+ "restport" : 9081,
+ "ossport" : 9082,
+ "casssrv": "HSSDB_ADDR",
+ "cassusr": "root",
+ "casspwd": "root",
+ "cassdb" : "vhss",
+ "casscoreconnections" : 2,
+ "cassmaxconnections" : 8,
+ "cassioqueuesize" : 32768,
+ "cassiothreads" : 2,
+ "randv" : true,
+ "optkey" : "63bfa50ee6523365ff14c1f45f88737d",
+ "reloadkey" : true,
+ "logsize": 20,
+ "lognumber": 5,
+ "logname": "LOGS_DIR/hss.log",
+ "logqsize": 8192,
+ "statlogsize": 20,
+ "statlognumber": 5,
+ "statlogname": "LOGS_DIR/hss_stat.log",
+ "auditlogsize": 20,
+ "auditlognumber": 5,
+ "auditlogname": "LOGS_DIR/hss_audit.log",
+ "statfreq": 2000,
+ "numworkers": 4,
+ "concurrent": 10,
+ "ossfile": "CONF_DIR/oss.json"
+ }
+ }
+ oss.json: |
+ {
+ "option": {
+ "id": "url",
+ "type": "string"
+ },
+ "services": [
+ {
+ "id": "logger",
+ "commands": [
+ {
+ "id": "describe_loggers"
+ },
+ {
+ "id": "set_logger_level",
+ "options": [
+ {
+ "id": "name",
+ "type": "string"
+ },
+ {
+ "id": "level",
+ "type": "integer"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "id": "stats",
+ "commands": [
+ {
+ "id": "describe_stats_frequency"
+ },
+ {
+ "id": "describe_stats_live"
+ },
+ {
+ "id": "set_stats_frequency",
+ "options": [
+ {
+ "id": "frequency",
+ "type": "integer"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ launch.sh: |
+ #!/bin/bash -x
+
+ CONF_DIR="/opt/c3po/hss/conf"
+ LOGS_DIR="/opt/c3po/hss/logs"
+ mkdir -p $CONF_DIR $LOGS_DIR
+
+ cp /etc/hss/conf/{acl.conf,hss.json,hss.conf,oss.json} $CONF_DIR
+
+ HSS_HOST=$(hostname)
+ HSS_DOMAIN=$(dnsdomainname)
+
+ # from hss.json
+ sed -i "s!HSS_IDENTITY!$HSS_HOST.$HSS_DOMAIN!g" $CONF_DIR/hss.json
+ sed -i "s!HSS_REALM!$HSS_DOMAIN!g" $CONF_DIR/hss.json
+ sed -i "s!HSSDB_ADDR!$HSSDB_ADDR!g" $CONF_DIR/hss.json
+ sed -i "s!CONF_DIR!$CONF_DIR!g" $CONF_DIR/hss.json
+ sed -i "s!LOGS_DIR!$LOGS_DIR!g" $CONF_DIR/hss.json
+
+ # from hss.conf
+ sed -i "s!HSS_IDENTITY!$HSS_HOST.$HSS_DOMAIN!g" $CONF_DIR/hss.conf
+ sed -i "s!HSS_REALM!$HSS_DOMAIN!g" $CONF_DIR/hss.conf
+ sed -i "s!HSS_HOST!$HSS_HOST!g" $CONF_DIR/hss.conf
+ sed -i "s!CONF_DIR!$CONF_DIR!g" $CONF_DIR/hss.conf
+ cat $CONF_DIR/{hss.json,hss.conf}
+
+ # If necessary, calculate the OPc value for each UE (User Equipment).
+ #./bin/hss -j conf/hss.json --onlyloadkey
+ cd $CONF_DIR
+ make_certs.sh $(hostname) $(dnsdomainname)
+ cd ..
+ # finally, launch
+ hss -j $CONF_DIR/hss.json
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: hss
+ labels:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+ selector:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+ clusterIP: None
+ ports:
+ - name: s6a
+ port: 3868
+ protocol: TCP
+---
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+ name: hss
+ labels:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 6 }}
+ serviceName: hss
+ template:
+ metadata:
+ labels:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 8 }}
+ spec:
+ {{- if .Values.nodeSelectors.enabled }}
+ nodeSelector:
+ {{ .Values.nodeSelectors.hss.label }}: {{ .Values.nodeSelectors.hss.value }}
+ {{- end }}
+ initContainers:
+ - name: init-hss
+ image: {{ .Values.images.tags.hssdb }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ command: [ "bash", "-xc"]
+ # TODO: Move the SIM card configuration into values.yaml
+ args:
+ - until nslookup $HSSDB_ADDR; do echo "waiting for hssdb"; sleep 2; done;
+ until cqlsh --file /opt/c3po/hssdb/oai_db.cql $HSSDB_ADDR; do echo "provisioning hssdb"; sleep 2; done;
+ until data_provisioning_users.sh 208014567891200 1122334455 apn1 465B5CE8B199B49FAA5F0A2EE238A6BC 10 $HSSDB_ADDR $MME_HOST.$MME_REALM $MME_REALM;
+ do echo "setting up users"; sleep 2; done;
+ until data_provisioning_mme.sh 1 19136246000 $MME_HOST.$MME_REALM $MME_REALM 1 $HSSDB_ADDR; do echo "setting up mme"; sleep 2; done;
+ until data_provisioning_mme.sh 1 19136246000 smsrouter.test3gpp.net test3gpp.net 0 $HSSDB_ADDR; do echo "setting up smsrouter"; sleep 2; done;
+ env:
+ - name: HSSDB_ADDR
+ value: {{ .Values.config.hss.hssdb }}
+ - name: MME_HOST
+ value: {{ tuple "mme" "host" . | include "omec-control-plane.endpoint_lookup" | quote }}
+ - name: MME_REALM
+ value: {{ tuple "mme" "realm" . | include "omec-control-plane.endpoint_lookup" | quote }}
+ containers:
+ - name: hss
+ image: {{ .Values.images.tags.hss }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ stdin: true
+ tty: true
+ env:
+ - name: HSSDB_ADDR
+ value: {{ .Values.config.hss.hssdb }}
+ - name: MME_IDENTITY
+ value: {{ tuple "mme" "identity" . | include "omec-control-plane.endpoint_lookup" | quote }}
+ command: ["bash", "-c", "/opt/c3po/hss/launch.sh; sleep 3600"]
+ {{- if .Values.resources.enabled }}
+ resources:
+{{ toYaml .Values.resources.hss | indent 10 }}
+ {{- end }}
+ volumeMounts:
+ - name: hss-script
+ mountPath: /opt/c3po/hss/launch.sh
+ subPath: launch.sh
+ - name: hss-config
+ mountPath: /etc/hss/conf
+ volumes:
+ - name: hss-script
+ configMap:
+ name: hss
+ defaultMode: 493
+ - name: hss-config
+ configMap:
+ name: hss
+ defaultMode: 420
diff --git a/omec/omec-control-plane/templates/service-mme.yaml b/omec/omec-control-plane/templates/service-mme.yaml
new file mode 100644
index 0000000..265e9e8
--- /dev/null
+++ b/omec/omec-control-plane/templates/service-mme.yaml
@@ -0,0 +1,50 @@
+{{/*
+Copyright 2019-present Open Networking Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/}}
+
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: mme
+ labels:
+{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+ selector:
+{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+ clusterIP: None
+ ports:
+ - name: s11
+ port: {{ .Values.config.mme.s11.egtp_default_port }}
+ protocol: UDP
+ - name: s6a
+ port: 3868
+ protocol: TCP
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: mme-sctp
+ labels:
+{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+ selector:
+{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+ type: NodePort
+ ports:
+ - name: s1ap
+ port: {{ .Values.config.mme.s1ap.sctp_port }}
+ nodePort: {{ .Values.config.mme.s1ap.sctp_port_external }}
+ protocol: SCTP
diff --git a/omec/omec-control-plane/templates/spgwc.yaml b/omec/omec-control-plane/templates/spgwc.yaml
new file mode 100644
index 0000000..0b17a0f
--- /dev/null
+++ b/omec/omec-control-plane/templates/spgwc.yaml
@@ -0,0 +1,544 @@
+{{/*
+Copyright 2018-present Open Networking Foundation
+Copyright 2018 Intel Corporation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/}}
+---
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+ name: spgwc
+ labels:
+{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+---
+kind: Role
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+ name: spgwc
+ labels:
+{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+rules:
+- apiGroups: [""]
+ resources: ["pods"]
+ verbs: ["get"]
+---
+kind: RoleBinding
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+ name: spgwc
+ labels:
+{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: Role
+ name: spgwc
+subjects:
+- kind: ServiceAccount
+ name: spgwc
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: spgwc
+ labels:
+{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+data:
+ launch.sh: |
+ #!/bin/bash -xe
+
+ RUN_DIR=${RUN_DIR:-"/opt/cp"}
+ mkdir -p $RUN_DIR/config
+ cd $RUN_DIR/config
+ cp /etc/cp/config/{adc_rules.cfg,cp_config.cfg,interface.cfg,meter_profile.cfg,pcc_rules.cfg,sdf_rules.cfg} .
+ sed -i "s/CP_ADDR/$CP_ADDR/g" interface.cfg
+ sed -i "s/DP_ADDR/$DP_ADDR/g" interface.cfg
+ sed -i "s/DP_PORT/$DP_PORT/g" interface.cfg
+ . cp_config.cfg
+ ngic_controlplane $EAL_ARGS -- $APP_ARGS
+ cp_config.cfg: |
+ if [ ! -d "/dev/hugepages" ]; then
+ MEMORY="--no-huge -m $((MEM_LIMIT-1024))"
+ fi
+ SHARED_DIR="/opt/cp/config/shared"
+ if [ -d ${SHARED_DIR} ]; then
+ while [ ! -f ${SHARED_DIR}/SGW_S1U_IP ]; do echo "Waiting for SGW_S1U_IP"; sleep 2; done
+ SGW_S1U_IP=$(cat ${SHARED_DIR}/SGW_S1U_IP)
+ fi
+ until dig +short ${MME_S11_IP} | grep -v -e '^$' > /dev/null; do
+ echo "Waiting for MME";
+ sleep 5;
+ done
+
+ MGMT_INFO="-s ${CP_ADDR} -m ${MME_S11_IP} -w ${SGW_S1U_IP}"
+ APN_INFO="-i ${IP_POOL_IP} -p ${IP_POOL_MASK} -a ${APN}"
+ SPGW_CFG="-d 03 -l 2 -r 7.7.7.7 -g 6.6.6.6 -v 4.4.4.4 -u 5.5.5.5"
+ APP_ARGS="${MGMT_INFO} ${APN_INFO} ${SPGW_CFG} ${TEID_INFO}"
+
+ CORES="-c $(taskset -p $$ | awk '{print $NF}')"
+ DEVICES="--no-pci"
+ EAL_ARGS="${CORES} ${MEMORY} ${DEVICES}"
+ interface.cfg: |
+ [0]
+ dp_comm_ip = DP_ADDR
+ dp_comm_port = DP_PORT
+ cp_comm_ip = CP_ADDR
+ cp_comm_port = 21
+ adc_rules.cfg: |
+ [GLOBAL]
+ NUM_ADC_RULES = 5
+
+ ;FORMAT ::
+ ;ADC_TYPE : [ DOMAIN = 0 | IP = 1 | IP PREFIX =2 ]
+ ;
+ ;if ADC_TYPE = 0
+ ; DOMAIN
+ ;elseif ADC_TYPE = 1
+ ; IP
+ ;elseif ADC_TYPE = 2
+ ; IP
+ ; PREFIX
+ ;else
+ ; NONE
+ ;
+ ;NOTE :
+ ;Rules defined first have a higher priority, unless DROP is specified
+ ;(i.e. multiple rules for the same IP).
+ ;When specifying DROP with an IP address, use a prefix of 32 to prevent DNS
+ ;results from overwriting rule.
+
+
+ [ADC_RULE_1]
+ ADC_TYPE = 1
+ IP = 13.1.1.111
+
+ [ADC_RULE_2]
+ ADC_TYPE = 2
+ IP = 13.1.1.0
+ PREFIX = 24
+
+ [ADC_RULE_3]
+ ADC_TYPE = 1
+ IP = 13.1.1.112
+ PREFIX = 24
+
+ [ADC_RULE_4]
+ ADC_TYPE = 0
+ DOMAIN = www.example.gov
+
+ [ADC_RULE_5]
+ ADC_TYPE = 0
+ DOMAIN = www.drop_example.com
+ meter_profile.cfg: |
+ [GLOBAL]
+ NUM_OF_IDX = 7
+
+ [ENTRY_1]
+ ;Committed Information Rate (CIR). Measured in bytes per second.
+ ;MBR is mapped into CIR, convert MBR from bits to Bytes and set CIR.
+ CIR = 2342400
+ ;Committed Burst Size unit = Bytes
+ CBS = 5856
+ ;Excess Burst Size unit = Bytes
+ EBS = 11712
+ ;Meter profile index. Refer this index in static_pcc.cfg to set AMBR/MBR
+ MTR_PROFILE_IDX = 3
+
+ [ENTRY_2]
+ ;1200 = 1756800
+ ;1400 = 2049600
+ ;1600 = 2342400
+ CIR = 2342400
+ CBS = 5856
+ EBS = 11712
+ MTR_PROFILE_IDX = 4
+
+ [ENTRY_3]
+ ; QCI5,QCI7 15.571kbps = 1947 B
+ CIR = 2342400
+ CBS = 5856
+ EBS = 11712
+ MTR_PROFILE_IDX = 5
+
+ [ENTRY_4]
+ ; QCI1, 44kbps = 5500 B
+ CIR = 2342400
+ CBS = 5856
+ EBS = 11712
+ MTR_PROFILE_IDX = 6
+
+ [ENTRY_5]
+ ; QCI9, 31.143kbps = 3893 B
+ CIR = 2342400
+ CBS = 5856
+ EBS = 11712
+ MTR_PROFILE_IDX = 7
+
+ [ENTRY_6]
+ ; 128B, 7pps
+ CIR = 2342400
+ CBS = 512
+ EBS = 1024
+ MTR_PROFILE_IDX = 8
+
+ [ENTRY_7]
+ ; 128B, 2pps
+ CIR = 2342400
+ CBS = 512
+ EBS = 1024
+ MTR_PROFILE_IDX = 9
+
+ pcc_rules.cfg: |
+ [GLOBAL]
+ NUM_PCC_FILTERS = 9
+ ;To config AMBR/MBR values refer meter_profile.cfg. specify only the
+ ;meter profile index to be set here.
+ UL_AMBR_MTR_PROFILE_IDX = 3
+ DL_AMBR_MTR_PROFILE_IDX = 4
+
+ ;default filter - must be first for now (until DP doesn't install any filters)
+ ;associated with default adc rule
+ [PCC_FILTER_1]
+ RULE_NAME = DefaultRule
+ RATING_GROUP = 9
+ SERVICE_ID = 0
+ RULE_STATUS = 0
+ GATE_STATUS = 1
+ SESSION_CONT = 0
+ REPORT_LEVEL = 1
+ CHARGING_MODE = 0
+ METERING_METHOD = 0
+ MUTE_NOTIFY = 0
+ MONITORING_KEY = 0
+ SPONSOR_ID = 0
+ REDIRECT_INFO = 0
+ PRECEDENCE = 254
+ DROP_PKT_COUNT = 0
+ ;Specify the meter profile index from meter_profile.cfg
+ UL_MBR_MTR_PROFILE_IDX = 7
+ DL_MBR_MTR_PROFILE_IDX = 7
+ ;List of ADC filter indices
+ SDF_FILTER_IDX = 99998
+
+ [PCC_FILTER_2]
+ RULE_NAME = sdf_rule_1
+ RATING_GROUP = 5
+ SERVICE_ID = 0
+ RULE_STATUS = 0
+ GATE_STATUS = 1
+ SESSION_CONT = 0
+ REPORT_LEVEL = 2
+ CHARGING_MODE = 0
+ METERING_METHOD = 0
+ MUTE_NOTIFY = 0
+ MONITORING_KEY = 0
+ SPONSOR_ID = 0
+ REDIRECT_INFO = 0
+ PRECEDENCE = 1
+ DROP_PKT_COUNT = 0
+ UL_MBR_MTR_PROFILE_IDX = 5
+ DL_MBR_MTR_PROFILE_IDX = 5
+ ;List of SDF filter indices
+ SDF_FILTER_IDX = 1
+
+ [PCC_FILTER_3]
+ RULE_NAME = sdf_rule_2
+ RATING_GROUP = 1
+ SERVICE_ID = 0
+ RULE_STATUS = 0
+ GATE_STATUS = 1
+ SESSION_CONT = 0
+ REPORT_LEVEL = 3
+ CHARGING_MODE = 0
+ METERING_METHOD = 0
+ MUTE_NOTIFY = 0
+ MONITORING_KEY = 0
+ SPONSOR_ID = 0
+ REDIRECT_INFO = 0
+ PRECEDENCE = 18
+ DROP_PKT_COUNT = 0
+ UL_MBR_MTR_PROFILE_IDX = 6
+ DL_MBR_MTR_PROFILE_IDX = 6
+ ;List of SDF filter indices
+ SDF_FILTER_IDX = 2
+
+ [PCC_FILTER_4]
+ RULE_NAME = adc_rule_1
+ RATING_GROUP = Zero-Rate
+ SERVICE_ID = Internet
+ RULE_STATUS = 0
+ GATE_STATUS = 1
+ SESSION_CONT = 0
+ REPORT_LEVEL = 8
+ CHARGING_MODE = 0
+ METERING_METHOD = 0
+ MUTE_NOTIFY = 0
+ MONITORING_KEY = 0
+ REDIRECT_INFO = 0
+ SPONSOR_ID = Example
+ PRECEDENCE = 15
+ DROP_PKT_COUNT = 0
+ UL_MBR_MTR_PROFILE_IDX = 7
+ DL_MBR_MTR_PROFILE_IDX = 7
+ ;List of SDF filter indices
+ ADC_FILTER_IDX = 1
+
+ [PCC_FILTER_5]
+ RULE_NAME = adc_rule_2
+ RATING_GROUP = 0
+ SERVICE_ID = CIPA
+ RULE_STATUS = 0
+ GATE_STATUS = 1
+ SESSION_CONT = 0
+ REPORT_LEVEL = 9
+ CHARGING_MODE = 0
+ METERING_METHOD = 0
+ MUTE_NOTIFY = 0
+ MONITORING_KEY = 0
+ SPONSOR_ID = Example
+ REDIRECT_INFO = 0
+ SPONSOR_ID = Example
+ REDIRECT_INFO = 0
+ PRECEDENCE = 4
+ DROP_PKT_COUNT = 0
+ UL_MBR_MTR_PROFILE_IDX = 0
+ DL_MBR_MTR_PROFILE_IDX = 0
+ ;List of SDF filter indices
+ ADC_FILTER_IDX = 2
+
+ [PCC_FILTER_6]
+ RULE_NAME = sdf_rule_3
+ RATING_GROUP = 7
+ SERVICE_ID = 0
+ RULE_STATUS = 0
+ GATE_STATUS = 1
+ SESSION_CONT = 0
+ REPORT_LEVEL = 4
+ CHARGING_MODE = 0
+ METERING_METHOD = 0
+ MUTE_NOTIFY = 0
+ MONITORING_KEY = 0
+ SPONSOR_ID = 0
+ REDIRECT_INFO = 0
+ PRECEDENCE = 17
+ DROP_PKT_COUNT = 0
+ UL_MBR_MTR_PROFILE_IDX = 5
+ DL_MBR_MTR_PROFILE_IDX = 5
+ ;List of SDF filter indices
+ SDF_FILTER_IDX = 3
+
+ [PCC_FILTER_7]
+ RULE_NAME = adc_rule_3
+ RATING_GROUP = Zero-Rate
+ SERVICE_ID = Internet
+ RULE_STATUS = 0
+ GATE_STATUS = 1
+ SESSION_CONT = 0
+ REPORT_LEVEL = 5
+ CHARGING_MODE = 0
+ METERING_METHOD = 0
+ MUTE_NOTIFY = 0
+ MONITORING_KEY = 0
+ SPONSOR_ID = Example
+ REDIRECT_INFO = 0
+ PRECEDENCE = 210
+ DROP_PKT_COUNT = 0
+ UL_MBR_MTR_PROFILE_IDX = 7
+ DL_MBR_MTR_PROFILE_IDX = 7
+ ;List of SDF filter indices
+ ADC_FILTER_IDX = 4
+
+ [PCC_FILTER_8]
+ RULE_NAME = adc_rule_4
+ RATING_GROUP = Zero-Rate
+ SERVICE_ID = Management
+ RULE_STATUS = 0
+ GATE_STATUS = 1
+ SESSION_CONT = 0
+ REPORT_LEVEL = 6
+ CHARGING_MODE = 0
+ METERING_METHOD = 0
+ MUTE_NOTIFY = 0
+ MONITORING_KEY = 0
+ SPONSOR_ID = Example
+ REDIRECT_INFO = 0
+ PRECEDENCE = 200
+ DROP_PKT_COUNT = 0
+ UL_MBR_MTR_PROFILE_IDX = 7
+ DL_MBR_MTR_PROFILE_IDX = 7
+ ;List of SDF filter indices
+ ADC_FILTER_IDX = 12
+
+ [PCC_FILTER_9]
+ RULE_NAME = adc_rule_5
+ RATING_GROUP = Zero-Rate
+ SERVICE_ID = Provisioning
+ RULE_STATUS = 0
+ GATE_STATUS = 1
+ SESSION_CONT = 0
+ REPORT_LEVEL = 7
+ CHARGING_MODE = 0
+ METERING_METHOD = 0
+ MUTE_NOTIFY = 0
+ MONITORING_KEY = 0
+ SPONSOR_ID = Example
+ REDIRECT_INFO = 0
+ PRECEDENCE = 220
+ DROP_PKT_COUNT = 0
+ UL_MBR_MTR_PROFILE_IDX = 7
+ DL_MBR_MTR_PROFILE_IDX = 7
+ ;List of SDF filter indices
+ ADC_FILTER_IDX = 3
+ sdf_rules.cfg: |
+ [GLOBAL]
+ NUM_SDF_FILTERS = 4
+
+ [SDF_FILTER_1]
+ DIRECTION = downlink_only
+ IPV4_REMOTE = 13.2.1.113
+ IPV4_REMOTE_MASK = 255.255.255.0
+ PROTOCOL = 17
+ LOCAL_LOW_LIMIT_PORT = 0
+ LOCAL_HIGH_LIMIT_PORT = 65535
+ REMOTE_LOW_LIMIT_PORT = 0
+ REMOTE_HIGH_LIMIT_PORT = 65535
+
+ [SDF_FILTER_2]
+ DIRECTION = uplink_only
+ IPV4_LOCAL = 16.255.255.0
+ IPV4_LOCAL_MASK = 255.255.255.0
+ PROTOCOL = 17
+ LOCAL_LOW_LIMIT_PORT = 0
+ LOCAL_HIGH_LIMIT_PORT = 65535
+ REMOTE_LOW_LIMIT_PORT = 0
+ REMOTE_HIGH_LIMIT_PORT = 65535
+
+ [SDF_FILTER_3]
+ DIRECTION = downlink_only
+ IPV4_REMOTE = 130.10.0.0
+ IPV4_REMOTE_MASK = 255.255.0.0
+ PROTOCOL = 17
+ REMOTE_LOW_LIMIT_PORT = 5060
+ REMOTE_HIGH_LIMIT_PORT = 5060
+
+ [SDF_FILTER_4]
+ DIRECTION = uplink_only
+ IPV4_REMOTE = 103.1.0.0
+ IPV4_REMOTE_MASK = 255.255.0.0
+ PROTOCOL = 17
+ LOCAL_LOW_LIMIT_PORT = 17000
+ LOCAL_HIGH_LIMIT_PORT = 17010
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: spgwc
+ labels:
+{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+ selector:
+{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+ clusterIP: None
+ ports:
+ - name: s11
+ port: 2123
+ protocol: UDP
+ - name: cpdp
+ port: 21
+ protocol: UDP
+---
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+ name: spgwc
+ labels:
+{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 6 }}
+ serviceName: spgwc
+ template:
+ metadata:
+ labels:
+{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 8 }}
+ spec:
+ {{- if .Values.nodeSelectors.enabled }}
+ nodeSelector:
+ {{ .Values.nodeSelectors.spgwc.label }}: {{ .Values.nodeSelectors.spgwc.value }}
+ {{- end }}
+ serviceAccountName: spgwc
+ initContainers:
+ - name: init-spgwc
+ image: {{ .Values.images.tags.init }}
+ command: ["/bin/sh", "-co", "pipefail"]
+ args:
+ - until $(kubectl get pod -ojson spgwu-0 2>/dev/null | jq -r '.metadata.annotations["k8s.v1.cni.cncf.io/networks-status"]' | jq -r '.[] | select(.name=="s1u-net") | .ips[0]' > /opt/cp/config/shared/SGW_S1U_IP | [ -s /opt/cp/config/shared/SGW_S1U_IP ]);
+ do echo "waiting for SPGWU"; sleep 2; done
+ volumeMounts:
+ - name: shared-data
+ mountPath: /opt/cp/config/shared
+ containers:
+ - name: spgwc
+ image: {{ .Values.images.tags.spgwc }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ stdin: true
+ tty: true
+ command: ["/opt/cp/scripts/launch.sh"]
+ env:
+ - name: MEM_LIMIT
+ valueFrom:
+ resourceFieldRef:
+ containerName: spgwc
+ resource: limits.memory
+ divisor: 1Mi
+ - name: CP_ADDR
+ valueFrom:
+ fieldRef:
+ fieldPath: status.podIP
+ - name: DP_ADDR
+ value: {{ .Values.config.spgwc.spgwu.addr | quote }}
+ - name: DP_PORT
+ value: {{ .Values.config.spgwc.spgwu.port | quote }}
+ - name: MME_S11_IP
+ value: {{ tuple "mme" "identity" . | include "omec-control-plane.endpoint_lookup" | quote }}
+ - name: APN
+ value: apn1
+ - name: IP_POOL_IP
+ value: "16.0.0.0"
+ - name: IP_POOL_MASK
+ value: "255.0.0.0"
+ {{- if .Values.resources.enabled }}
+ resources:
+{{ toYaml .Values.resources.spgwc | indent 10 }}
+ {{- end }}
+ volumeMounts:
+ - name: cp-script
+ mountPath: /opt/cp/scripts/launch.sh
+ subPath: launch.sh
+ - name: cp-config
+ mountPath: /etc/cp/config
+ - name: shared-data
+ mountPath: /opt/cp/config/shared
+ volumes:
+ - name: cp-script
+ configMap:
+ name: spgwc
+ defaultMode: 493
+ - name: cp-config
+ configMap:
+ name: spgwc
+ defaultMode: 420
+ - name: shared-data
+ emptyDir: {}
diff --git a/omec/omec-control-plane/templates/statefulset-mme.yaml b/omec/omec-control-plane/templates/statefulset-mme.yaml
new file mode 100644
index 0000000..af37c34
--- /dev/null
+++ b/omec/omec-control-plane/templates/statefulset-mme.yaml
@@ -0,0 +1,215 @@
+{{/*
+Copyright 2019-present Open Networking Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/}}
+
+---
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+ name: mme
+ labels:
+{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+---
+kind: Role
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+ name: mme
+ labels:
+{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+rules:
+ - apiGroups:
+ - ""
+ - extensions
+ - batch
+ - apps
+ verbs:
+ - get
+ - list
+ resources:
+ - daemonsets
+ - jobs
+ - pods
+ - services
+ - endpoints
+---
+kind: RoleBinding
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+ name: mme
+ labels:
+{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: Role
+ name: mme
+subjects:
+- kind: ServiceAccount
+ name: mme
+---
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+ name: mme
+ labels:
+{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 6 }}
+ serviceName: mme
+ template:
+ metadata:
+ labels:
+{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 8 }}
+ spec:
+ {{- if .Values.nodeSelectors.enabled }}
+ nodeSelector:
+ {{ .Values.nodeSelectors.mme.label }}: {{ .Values.nodeSelectors.mme.value }}
+ {{- end }}
+ serviceAccountName: mme
+ initContainers:
+ - name: mme-dep-check
+ image: {{ .Values.images.tags.depCheck | quote }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ securityContext:
+ allowPrivilegeEscalation: false
+ readOnlyRootFilesystem: false
+ runAsUser: 0
+ env:
+ - name: POD_NAME
+ valueFrom:
+ fieldRef:
+ apiVersion: v1
+ fieldPath: metadata.name
+ - name: NAMESPACE
+ valueFrom:
+ fieldRef:
+ apiVersion: v1
+ fieldPath: metadata.namespace
+ - name: PATH
+ value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
+ - name: COMMAND
+ value: "echo done"
+ - name: DEPENDENCY_POD_JSON
+ value: '[{"labels": {"app": "spgwc"}, "requireSameNode": false}, {"labels": {"app": "hss"}, "requireSameNode": false}]'
+ # add dependency job for make_certs.sh
+ command:
+ - kubernetes-entrypoint
+ volumeMounts:
+ []
+ - name: mme-init
+ image: {{ .Values.images.tags.mme | quote }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ command: ["/opt/mme/scripts/mme-init.sh"]
+ env:
+ - name: MME_LOCAL_IP
+ valueFrom:
+ fieldRef:
+ fieldPath: status.podIP
+ volumeMounts:
+ - name: scripts
+ mountPath: /opt/mme/scripts/mme-init.sh
+ subPath: mme-init.sh
+ - name: configs
+ mountPath: /opt/mme/config
+ - name: shared-data
+ mountPath: /opt/mme/config/shared
+ containers:
+ - name: mme-app
+ image: {{ .Values.images.tags.mme | quote }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ command: ["bash", "-xc"]
+ args:
+ - /opt/mme/scripts/mme-run.sh mme-app
+ {{- if .Values.resources.enabled }}
+ resources:
+{{ toYaml .Values.resources.mme | indent 10 }}
+ {{- end }}
+ volumeMounts:
+ - name: scripts
+ mountPath: /opt/mme/scripts/mme-run.sh
+ subPath: mme-run.sh
+ - name: shared-data
+ mountPath: /opt/mme/config/shared
+ - name: shared-app
+ mountPath: /tmp
+ - name: s1ap-app
+ image: {{ .Values.images.tags.mme | quote }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ command: ["bash", "-xc"]
+ args:
+ - /opt/mme/scripts/mme-run.sh s1ap-app
+ {{- if .Values.resources.enabled }}
+ resources:
+{{ toYaml .Values.resources.mme | indent 10 }}
+ {{- end }}
+ volumeMounts:
+ - name: scripts
+ mountPath: /opt/mme/scripts/mme-run.sh
+ subPath: mme-run.sh
+ - name: shared-data
+ mountPath: /opt/mme/config/shared
+ - name: shared-app
+ mountPath: /tmp
+ - name: s6a-app
+ image: {{ .Values.images.tags.mme | quote }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ command: ["bash", "-xc"]
+ args:
+ - /opt/mme/scripts/mme-run.sh s6a-app
+ {{- if .Values.resources.enabled }}
+ resources:
+{{ toYaml .Values.resources.mme | indent 10 }}
+ {{- end }}
+ volumeMounts:
+ - name: scripts
+ mountPath: /opt/mme/scripts/mme-run.sh
+ subPath: mme-run.sh
+ - name: shared-data
+ mountPath: /opt/mme/config/shared
+ - name: shared-app
+ mountPath: /tmp
+ - name: s11-app
+ image: {{ .Values.images.tags.mme | quote }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ command: ["bash", "-xc"]
+ args:
+ - /opt/mme/scripts/mme-run.sh s11-app
+ {{- if .Values.resources.enabled }}
+ resources:
+{{ toYaml .Values.resources.mme | indent 10 }}
+ {{- end }}
+ volumeMounts:
+ - name: scripts
+ mountPath: /opt/mme/scripts/mme-run.sh
+ subPath: mme-run.sh
+ - name: shared-data
+ mountPath: /opt/mme/config/shared
+ - name: shared-app
+ mountPath: /tmp
+ volumes:
+ - name: scripts
+ configMap:
+ name: mme
+ defaultMode: 493
+ - name: configs
+ configMap:
+ name: mme
+ defaultMode: 420
+ - name: shared-data
+ emptyDir: {}
+ - name: shared-app
+ emptyDir: {}
diff --git a/omec/omec-control-plane/values.yaml b/omec/omec-control-plane/values.yaml
new file mode 100644
index 0000000..2c83ee6
--- /dev/null
+++ b/omec/omec-control-plane/values.yaml
@@ -0,0 +1,119 @@
+# Copyright 2018-present Open Networking Foundation
+# Copyright 2018 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+images:
+ tags:
+ init: docker.io/omecproject/pod-init:0.1.0-dev
+ hssdb: docker.io/omecproject/c3po-hssdb:0.1.0-dev
+ hss: docker.io/omecproject/c3po-hss:0.1.0-dev
+ mme: docker.io/omecproject/openmme:0.1.0-dev
+ spgwc: docker.io/omecproject/ngic-cp:0.1.0-dev
+ depCheck: quay.io/stackanetes/kubernetes-entrypoint:v0.3.1
+ pullPolicy: IfNotPresent
+
+nodeSelectors:
+ enabled: false
+ hss:
+ label: omec-cp
+ value: enabled
+ mme:
+ label: omec-cp
+ value: enabled
+ spgwc:
+ label: omec-cp
+ value: enabled
+
+resources:
+ enabled: true
+ hss:
+ requests:
+ cpu: 2
+ memory: 1Gi
+ limits:
+ cpu: 2
+ memory: 1Gi
+ mme:
+ # Note that MME pod is composed of 4 containers
+ # Provide resources for a container, not a pod
+ requests:
+ cpu: 0.5
+ memory: 1Gi
+ limits:
+ cpu: 0.5
+ memory: 1Gi
+ spgwc:
+ requests:
+ cpu: 2
+ memory: 5Gi
+ limits:
+ cpu: 2
+ memory: 5Gi
+
+cassandra:
+ deploy: true
+ fullnameOverride: cassandra
+ image:
+ tag: 2.1.20
+ #selector:
+ # nodeSelector:
+ # cassandra: enabled
+ persistence:
+ enabled: false
+ config:
+ #cluster_size: 1
+ endpoint_snitch: GossipingPropertyFileSnitch
+ resources: {}
+ #requests:
+ # memory: 4Gi
+ # cpu: 2
+ #limits:
+ # memory: 4Gi
+ # cpu: 2
+
+config:
+ hss: {}
+ # hssdb will be set to cassandra if unset
+ #hssdb:
+ mme:
+ mme:
+ name: vmmestandalone
+ group_id: 1
+ code: 1
+ mcc:
+ dig1: 2
+ dig2: 0
+ dig3: 8
+ mnc:
+ dig1: 0
+ dig2: 1
+ dig3: -1
+ s1ap:
+ sctp_port: 36412
+ sctp_port_external: 36412
+ s11:
+ egtp_default_port: 2123
+ # sgw_addr and pgw_addr will be set dynamically if unset
+ #sgw_addr:
+ #pgw_addr:
+ s6a:
+ host_type: freediameter
+ # host and realm will be set dynamically if unset
+ #host:
+ #realm:
+ spgwc:
+ # make it global
+ spgwu:
+ addr: spgwu
+ port: 20
diff --git a/omec/omec-data-plane/.gitignore b/omec/omec-data-plane/.gitignore
new file mode 100644
index 0000000..ee3892e
--- /dev/null
+++ b/omec/omec-data-plane/.gitignore
@@ -0,0 +1 @@
+charts/
diff --git a/omec/omec-data-plane/.helmignore b/omec/omec-data-plane/.helmignore
new file mode 100644
index 0000000..f0c1319
--- /dev/null
+++ b/omec/omec-data-plane/.helmignore
@@ -0,0 +1,21 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
diff --git a/omec/omec-data-plane/Chart.yaml b/omec/omec-data-plane/Chart.yaml
new file mode 100644
index 0000000..2f8d0e1
--- /dev/null
+++ b/omec/omec-data-plane/Chart.yaml
@@ -0,0 +1,21 @@
+---
+# Copyright 2018-present Open Networking Foundation
+# Copyright 2018 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+apiVersion: v1
+appVersion: "1.0"
+description: OMEC data plane services
+name: omec-data-plane
+version: 0.1.0
diff --git a/omec/omec-data-plane/templates/_helpers.tpl b/omec/omec-data-plane/templates/_helpers.tpl
new file mode 100644
index 0000000..af69c64
--- /dev/null
+++ b/omec/omec-data-plane/templates/_helpers.tpl
@@ -0,0 +1,36 @@
+{{- /*
+# Copyright 2019-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+*/ -}}
+
+{{/*
+Renders a set of standardised labels.
+*/}}
+{{- define "omec-data-plane.metadata_labels" -}}
+{{- $application := index . 0 -}}
+{{- $context := index . 1 -}}
+release: {{ $context.Release.Name }}
+app: {{ $application }}
+{{- end -}}
+
+{{/*
+Render the given template.
+*/}}
+{{- define "omec-data-plane.template" -}}
+{{- $name := index . 0 -}}
+{{- $context := index . 1 -}}
+{{- $last := base $context.Template.Name }}
+{{- $wtf := $context.Template.Name | replace $last $name -}}
+{{ include $wtf $context }}
+{{- end -}}
diff --git a/omec/omec-data-plane/templates/bin/_spgwu-run.sh.tpl b/omec/omec-data-plane/templates/bin/_spgwu-run.sh.tpl
new file mode 100644
index 0000000..9582e14
--- /dev/null
+++ b/omec/omec-data-plane/templates/bin/_spgwu-run.sh.tpl
@@ -0,0 +1,30 @@
+#!/bin/bash
+#
+# Copyright 2019-present Open Networking Foundation
+# Copyright 2019 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -ex
+
+RUN_DIR=${RUN_DIR:-"/opt/dp"}
+mkdir -p $RUN_DIR/config
+cd $RUN_DIR/config
+cp /etc/dp/config/{cdr.cfg,dp_config.cfg,interface.cfg} .
+
+sed -i "s/CP_ADDR/$CP_ADDR/g" interface.cfg
+sed -i "s/CP_PORT/$CP_PORT/g" interface.cfg
+sed -i "s/DP_ADDR/$DP_ADDR/g" interface.cfg
+
+source dp_config.cfg
+ngic_dataplane $EAL_ARGS -- $APP_ARGS
diff --git a/omec/omec-data-plane/templates/bin/_spgwu-setup-af-iface.sh.tpl b/omec/omec-data-plane/templates/bin/_spgwu-setup-af-iface.sh.tpl
new file mode 100644
index 0000000..ad8eded
--- /dev/null
+++ b/omec/omec-data-plane/templates/bin/_spgwu-setup-af-iface.sh.tpl
@@ -0,0 +1,47 @@
+#!/bin/sh
+#
+# Copyright 2019-present Open Networking Foundation
+# Copyright 2019 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set -ex
+
+UL_IFACE="{{- .Values.config.spgwu.s1uAfDev -}}"
+DL_IFACE="{{- .Values.config.spgwu.sgiAfDev -}}"
+
+if ! ip link show $UL_IFACE; then
+ s1u_mac=$(ip addr show dev s1u-net | awk '$1=="link/ether"{print $2}')
+ ip link add $UL_IFACE type veth peer name l_$UL_IFACE
+ ip link set $UL_IFACE up
+ ip link set l_$UL_IFACE up
+ ip link set dev $UL_IFACE address $s1u_mac
+fi
+if ! ip link show $DL_IFACE; then
+ sgi_mac=$(ip addr show dev sgi-net | awk '$1=="link/ether"{print $2}')
+ ip link add $DL_IFACE type veth peer name l_$DL_IFACE
+ ip link set $DL_IFACE up
+ ip link set l_$DL_IFACE up
+ ip link set dev $DL_IFACE address $sgi_mac
+fi
+
+if ! ip addr show $UL_IFACE | grep inet; then
+ s1u_ip=$(ip addr show s1u-net | grep inet | grep -v inet6 | awk '{print $2}')
+ ip addr add $s1u_ip dev $UL_IFACE
+fi
+if ! ip addr show $DL_IFACE | grep inet; then
+ sgi_ip=$(ip addr show sgi-net | grep inet | grep -v inet6 | awk '{print $2}')
+ ip addr add $sgi_ip dev $DL_IFACE
+fi
+
+ip a
diff --git a/omec/omec-data-plane/templates/configmap-spgwu.yaml b/omec/omec-data-plane/templates/configmap-spgwu.yaml
new file mode 100644
index 0000000..2db74f3
--- /dev/null
+++ b/omec/omec-data-plane/templates/configmap-spgwu.yaml
@@ -0,0 +1,56 @@
+{{/*
+Copyright 2019-present Open Networking Foundation
+Copyright 2019 Intel Corporation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/}}
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: spgwu
+ labels:
+{{ tuple "spgwu" . | include "omec-data-plane.metadata_labels" | indent 4 }}
+data:
+ dp_config.cfg: |
+ if [ ! -d "/dev/hugepages" ]; then
+ MEMORY="--no-huge -m $((MEM_LIMIT-1024))"
+ fi
+
+ CORES="-c $(taskset -p $$ | awk '{print $NF}')"
+ EAL_ARGS="${CORES} ${MEMORY} ${DEVICES}"
+
+ SPGW_CFG="--spgw_cfg 03"
+ S1U_IP=$(ip -4 addr show dev ${S1U_DEVNAME} | grep -oP '(?<=inet\s)\d+(\.\d+){3}')
+ SGI_IP=$(ip -4 addr show dev ${SGI_DEVNAME} | grep -oP '(?<=inet\s)\d+(\.\d+){3}')
+ S1U_MAC=$(ip addr show dev ${S1U_DEVNAME} | awk '$1=="link/ether"{print $2}')
+ SGI_MAC=$(ip addr show dev ${SGI_DEVNAME} | awk '$1=="link/ether"{print $2}')
+ S1U="--s1u_ip ${S1U_IP} --s1u_mac ${S1U_MAC} --ul_iface ${S1U_DEVNAME}"
+ SGI="--sgi_ip ${SGI_IP} --sgi_mac ${SGI_MAC} --dl_iface ${SGI_DEVNAME} --sgi_gw_ip ${RTR_SGI_IP} --sgi_mask ${SGI_MASK}"
+ MISC="--log 1"
+ APP_ARGS="${S1U} ${SGI} ${MISC} ${SPGW_CFG}"
+ cdr.cfg: |
+ CDR_PATH=./cdr
+ MASTER_CDR=./cdr/master.csv
+ interface.cfg: |
+ [0]
+ dp_comm_ip = DP_ADDR
+ dp_comm_port = 20
+ cp_comm_ip = CP_ADDR
+ cp_comm_port = CP_PORT
+{{- if not .Values.config.sriov.enabled }}
+ setup-af-iface.sh: |
+{{ tuple "bin/_spgwu-setup-af-iface.sh.tpl" . | include "omec-data-plane.template" | indent 4 }}
+{{- end }}
+ run.sh: |
+{{ tuple "bin/_spgwu-run.sh.tpl" . | include "omec-data-plane.template" | indent 4 }}
diff --git a/omec/omec-data-plane/templates/configmap-sriov-conf.yaml b/omec/omec-data-plane/templates/configmap-sriov-conf.yaml
new file mode 100644
index 0000000..4b8fd9a
--- /dev/null
+++ b/omec/omec-data-plane/templates/configmap-sriov-conf.yaml
@@ -0,0 +1,29 @@
+{{/*
+Copyright 2018-present Open Networking Foundation
+Copyright 2018 Intel Corporation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/}}
+
+{{- if .Values.config.sriov.enabled }}
+---
+kind: ConfigMap
+apiVersion: v1
+metadata:
+ name: sriov-config
+data:
+ config.json: |
+ {
+ "resourceList": {{ toJson .Values.config.sriov.resourceList }}
+ }
+{{- end }}
diff --git a/omec/omec-data-plane/templates/daemonset-sriov-dp.yaml b/omec/omec-data-plane/templates/daemonset-sriov-dp.yaml
new file mode 100644
index 0000000..9c3ceea
--- /dev/null
+++ b/omec/omec-data-plane/templates/daemonset-sriov-dp.yaml
@@ -0,0 +1,75 @@
+{{/*
+Copyright 2018-present Open Networking Foundation
+Copyright 2018 Intel Corporation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/}}
+
+{{- if .Values.config.sriov.enabled }}
+---
+apiVersion: apps/v1
+kind: DaemonSet
+metadata:
+ name: sriov-device-plugin
+spec:
+ selector:
+ matchLabels:
+ name: sriov-device-plugin
+ template:
+ metadata:
+ labels:
+ name: sriov-device-plugin
+ spec:
+ hostNetwork: true
+ hostPID: true
+ initContainers:
+ - name: init-sriov-cni
+ image: {{ .Values.images.tags.omecCni }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ command: [ "bash", "-c" ]
+ args:
+ - cp /tmp/cni/bin/{sriov,vfioveth,centralip,jq} /host/opt/cni/bin/
+ volumeMounts:
+ - name: cni-bin
+ mountPath: /host/opt/cni/bin
+ containers:
+ - name: sriov-device-plugin
+ image: {{ .Values.images.tags.sriovDp }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ command: [ "/bin/sh", "-c", "--" ]
+ args: [ "sriovdp --logtostderr 10;" ]
+ securityContext:
+ privileged: true
+ volumeMounts:
+ - mountPath: /var/lib/kubelet/
+ name: devicesock
+ readOnly: false
+ - mountPath: /sys
+ name: net
+ readOnly: true
+ - name: sriov-config
+ mountPath: /etc/pcidp
+ volumes:
+ - name: devicesock
+ hostPath:
+ path: /var/lib/kubelet/
+ - name: net
+ hostPath:
+ path: /sys
+ - name: sriov-config
+ configMap:
+ name: sriov-config
+ - name: cni-bin
+ hostPath:
+ path: /opt/cni/bin
+{{- end }}
diff --git a/omec/omec-data-plane/templates/networks.yaml b/omec/omec-data-plane/templates/networks.yaml
new file mode 100644
index 0000000..a82e3ae
--- /dev/null
+++ b/omec/omec-data-plane/templates/networks.yaml
@@ -0,0 +1,65 @@
+{{/*
+Copyright 2018-present Open Networking Foundation
+Copyright 2018 Intel Corporation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/}}
+
+---
+apiVersion: "k8s.cni.cncf.io/v1"
+kind: NetworkAttachmentDefinition
+metadata:
+ name: s1u-net
+{{- if $.Values.config.sriov.enabled }}
+ annotations:
+ k8s.v1.cni.cncf.io/resourceName: intel.com/sriov_vfio
+{{- end }}
+spec:
+ config: '{
+ "type": {{ .Values.networks.cniPlugin | quote }},
+ "ipam": {
+ "type": {{ .Values.networks.ipam | quote }},
+ {{- if eq .Values.networks.ipam "host-local" }}
+ "subnet": {{ .Values.networks.s1u.subnet | quote }},
+ "gateway": {{ .Values.networks.s1u.gateway | quote }}
+ {{- else if eq .Values.networks.ipam "centralip" }}
+ "ipType": "cluster",
+ "network": {{ .Values.networks.s1u.subnet | quote }},
+ "etcdURL": {{ .Values.networks.etcdurl | quote }}
+ {{- end }}
+ }
+ }'
+---
+apiVersion: "k8s.cni.cncf.io/v1"
+kind: NetworkAttachmentDefinition
+metadata:
+ name: sgi-net
+{{- if $.Values.config.sriov.enabled }}
+ annotations:
+ k8s.v1.cni.cncf.io/resourceName: intel.com/sriov_vfio
+{{- end }}
+spec:
+ config: '{
+ "type": {{ .Values.networks.cniPlugin | quote }},
+ "ipam": {
+ "type": {{ .Values.networks.ipam | quote }},
+ {{- if eq .Values.networks.ipam "host-local" }}
+ "subnet": {{ .Values.networks.sgi.subnet | quote }},
+ "gateway": {{ .Values.networks.sgi.gateway | quote }}
+ {{- else if eq .Values.networks.ipam "centralip" }}
+ "ipType": "cluster",
+ "network": {{ .Values.networks.sgi.subnet | quote }},
+ "etcdURL": {{ .Values.networks.etcdurl | quote }}
+ {{- end }}
+ }
+ }'
diff --git a/omec/omec-data-plane/templates/service-spgwu.yaml b/omec/omec-data-plane/templates/service-spgwu.yaml
new file mode 100644
index 0000000..dd4766e
--- /dev/null
+++ b/omec/omec-data-plane/templates/service-spgwu.yaml
@@ -0,0 +1,30 @@
+{{/*
+Copyright 2019-present Open Networking Foundation
+Copyright 2019 Intel Corporation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/}}
+
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: spgwu
+spec:
+ selector:
+{{ tuple "spgwu" . | include "omec-data-plane.metadata_labels" | indent 4 }}
+ clusterIP: None
+ ports:
+ - name: cpdp
+ port: 20
+ protocol: UDP
diff --git a/omec/omec-data-plane/templates/statefulset-spgwu.yaml b/omec/omec-data-plane/templates/statefulset-spgwu.yaml
new file mode 100644
index 0000000..b1a2c1a
--- /dev/null
+++ b/omec/omec-data-plane/templates/statefulset-spgwu.yaml
@@ -0,0 +1,146 @@
+{{/*
+Copyright 2018-present Open Networking Foundation
+Copyright 2018 Intel Corporation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/}}
+---
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+ name: spgwu
+ labels:
+{{ tuple "spgwu" . | include "omec-data-plane.metadata_labels" | indent 4 }}
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+{{ tuple "spgwu" . | include "omec-data-plane.metadata_labels" | indent 6 }}
+ serviceName: spgwu
+ template:
+ metadata:
+ labels:
+{{ tuple "spgwu" . | include "omec-data-plane.metadata_labels" | indent 8 }}
+ annotations:
+ k8s.v1.cni.cncf.io/networks: '[
+ { "name": "s1u-net", "interface": "s1u-net" },
+ { "name": "sgi-net", "interface": "sgi-net" }
+ ]'
+ spec:
+ {{- if .Values.nodeSelectors.enabled }}
+ nodeSelector:
+ {{ .Values.nodeSelectors.spgwu.label }}: {{ .Values.nodeSelectors.spgwu.value }}
+ {{- end }}
+ {{- if not .Values.config.sriov.enabled }}
+ initContainers:
+ - name: spgwu-iptables-init
+ image: {{ .Values.images.tags.init | quote }}
+ imagePullPolicy: {{ .Values.images.pullPolicy | quote }}
+ command: [ "sh", "-xec"]
+ securityContext:
+ capabilities:
+ add:
+ - NET_ADMIN
+ args:
+ - iptables -I OUTPUT -p icmp --icmp-type destination-unreachable -j DROP;
+ - name: spgwu-af-iface-init
+ image: {{ .Values.images.tags.init | quote }}
+ imagePullPolicy: {{ .Values.images.pullPolicy | quote }}
+ securityContext:
+ capabilities:
+ add:
+ - NET_ADMIN
+ command:
+ - /opt/dp/scripts/setup-af-iface.sh
+ volumeMounts:
+ - name: dp-script
+ mountPath: /opt/dp/scripts/setup-af-iface.sh
+ subPath: setup-af-iface.sh
+ {{- end }}
+ containers:
+ - name: spgwu
+ image: {{ .Values.images.tags.spgwu | quote }}
+ imagePullPolicy: {{ .Values.images.pullPolicy | quote }}
+ stdin: true
+ tty: true
+ env:
+ - name: MEM_LIMIT
+ valueFrom:
+ resourceFieldRef:
+ containerName: spgwu
+ resource: limits.memory
+ divisor: 1Mi
+ - name: S1U_DEVNAME
+ {{- if .Values.config.sriov.enabled }}
+ value: s1u-net
+ {{- else }}
+ value: {{ .Values.config.spgwu.s1uAfDev | quote }}
+ {{- end }}
+ - name: SGI_DEVNAME
+ {{- if .Values.config.sriov.enabled }}
+ value: sgi-net
+ {{- else }}
+ value: {{ .Values.config.spgwu.sgiAfDev | quote }}
+ {{- end }}
+ - name: DEVICES
+ value: {{ .Values.config.spgwu.devices | quote }}
+ - name: CP_ADDR
+ value: {{ .Values.config.spgwu.spgwc.addr | quote }}
+ - name: CP_PORT
+ value: {{ .Values.config.spgwu.spgwc.port | quote }}
+ - name: DP_ADDR
+ valueFrom:
+ fieldRef:
+ fieldPath: status.podIP
+ - name: RTR_SGI_IP
+ value: {{ .Values.config.spgwu.rtrSgiIp | quote }}
+ - name: SGI_MASK
+ value: {{ .Values.config.spgwu.sgiMask | quote }}
+ command: ["bash", "-xc"]
+ args:
+ - ip a;
+ /opt/dp/scripts/run.sh;
+ volumeMounts:
+ - name: dp-script
+ mountPath: /opt/dp/scripts/run.sh
+ subPath: run.sh
+ - name: dp-config
+ mountPath: /etc/dp/config
+ resources:
+ requests:
+ {{- if .Values.resources.enabled }}
+{{ toYaml .Values.resources.spgwu.requests | indent 12 }}
+ {{- end }}
+ {{- if .Values.config.sriov.enabled }}
+ intel.com/sriov_vfio: 2
+ {{- end }}
+ limits:
+ {{- if .Values.resources.enabled }}
+{{ toYaml .Values.resources.spgwu.limits | indent 12 }}
+ {{- end }}
+ {{- if .Values.config.sriov.enabled }}
+ intel.com/sriov_vfio: 2
+ {{- end }}
+ securityContext:
+ capabilities:
+ add:
+ - IPC_LOCK
+ volumes:
+ - name: dp-script
+ configMap:
+ name: spgwu
+ defaultMode: 493
+ - name: dp-config
+ configMap:
+ name: spgwu
+ defaultMode: 420
diff --git a/omec/omec-data-plane/values.yaml b/omec/omec-data-plane/values.yaml
new file mode 100644
index 0000000..d21f1cf
--- /dev/null
+++ b/omec/omec-data-plane/values.yaml
@@ -0,0 +1,82 @@
+# Copyright 2018-present Open Networking Foundation
+# Copyright 2018 Intel Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+images:
+ tags:
+ init: docker.io/omecproject/pod-init:0.1.0-dev
+ omecCni: docker.io/omecproject/omec-cni:0.0.1
+ sriovDp: docker.io/nfvpe/sriov-device-plugin:v3.0.0
+ spgwu: docker.io/omecproject/ngic-dp:0.1.0-dev
+ depCheck: quay.io/stackanetes/kubernetes-entrypoint:v0.3.1
+ pullPolicy: IfNotPresent
+
+nodeSelectors:
+ enabled: false
+ spgwu:
+ label: omec-dp
+ value: enabled
+
+resources:
+ enabled: true
+ spgwu:
+ requests:
+ cpu: 4
+ memory: 8Gi
+ limits:
+ cpu: 4
+ memory: 8Gi
+
+config:
+ sriov:
+ enabled: true
+ resourceList:
+ - resourceName: sriov_vfio
+ selectors:
+ pfNames:
+ - eno1
+ drivers:
+ - vfio-pci
+ - resourceName: sriov_netdevice
+ selectors:
+ pfNames:
+ - eno1
+ drivers:
+ - ixgbevf
+ spgwu:
+ spgwc:
+ addr: spgwc
+ port: 21
+ # s1u and sgi interfaces are fixed to "s1u-net" and "sgi-net"
+ # Note that s1uAfDev and sgiAfDev are valid only when sriov is disabled
+ # setup-af-iface.sh script creates additional veth pair with the names here
+ s1uAfDev: s1u-veth
+ sgiAfDev: sgi-veth
+ # set "--no-pci --vdev eth_af_packet0,iface=s1u-net --vdev eth_af_packet1,iface=sgi-net"
+ # when sriov is disabled
+ devices: ""
+ rtrSgiIp: 13.1.1.254
+ sgiMask: 255.255.255.0
+
+networks:
+ cniPlugin: vfioveth
+ ipam: centralip
+ # etcdurl is required only when centralip IPAM is used
+ etcdurl: http://localhost:32379
+ s1u:
+ subnet: 119.0.0.0/24
+ gateway: 119.0.0.254
+ sgi:
+ subnet: 13.1.1.0/24
+ gateway: 13.1.1.254