Add Aether files and directories from helm-charts
Change-Id: I2edb76ebbf8f1da147f760c0fa4618219c49b6cc
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..bb98547
--- /dev/null
+++ b/omec/omec-control-plane/templates/_helpers.tpl
@@ -0,0 +1,132 @@
+{{- /*
+# 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 domain name for Diameter identity, realm, and hostname for a given application.
+*/}}
+{{- define "omec-control-plane.diameter_endpoint" -}}
+{{- $service := index . 0 -}}
+{{- $type := index . 1 -}}
+{{- $context := index . 2 -}}
+{{- if eq $type "identity" -}}
+{{- printf "%s.%s.svc.%s" $service $context.Release.Namespace $context.Values.config.clusterDomain -}}
+{{- else if eq $type "realm" -}}
+{{- printf "%s.svc.%s" $context.Release.Namespace $context.Values.config.clusterDomain -}}
+{{- else if eq $type "host" -}}
+{{- printf "%s" $service -}}
+{{- end -}}
+{{- end -}}
+
+{{/*
+Render ServiceAccount, Role, and RoleBinding required for kubernetes-entrypoint.
+*/}}
+{{- define "omec-control-plane.service_account" -}}
+{{- $context := index . 1 -}}
+{{- $saName := index . 0 -}}
+{{- $saNamespace := $context.Release.Namespace }}
+---
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+ name: {{ $saName }}
+ namespace: {{ $saNamespace }}
+ labels:
+{{ tuple $saName $context | include "omec-control-plane.metadata_labels" | indent 4 }}
+---
+apiVersion: rbac.authorization.k8s.io/v1beta1
+kind: RoleBinding
+metadata:
+ name: {{ $saName }}
+ namespace: {{ $saNamespace }}
+ labels:
+{{ tuple $saName $context | include "omec-control-plane.metadata_labels" | indent 4 }}
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: Role
+ name: {{ $saName }}
+subjects:
+ - kind: ServiceAccount
+ name: {{ $saName }}
+ namespace: {{ $saNamespace }}
+---
+apiVersion: rbac.authorization.k8s.io/v1beta1
+kind: Role
+metadata:
+ name: {{ $saName }}
+ namespace: {{ $saNamespace }}
+ labels:
+{{ tuple $saName $context | include "omec-control-plane.metadata_labels" | indent 4 }}
+rules:
+ - apiGroups:
+ - ""
+ - extensions
+ - batch
+ - apps
+ verbs:
+ - get
+ - list
+ - patch
+ resources:
+ - statefulsets
+ - daemonsets
+ - jobs
+ - pods
+ - services
+ - endpoints
+ - configmaps
+{{- end -}}
+
+{{/*
+Render init container for coredump.
+*/}}
+{{- define "omec-control-plane.coredump_init" -}}
+{{- $pod := index . 0 -}}
+{{- $context := index . 1 -}}
+- name: {{ $pod }}-coredump-init
+ image: {{ $context.Values.images.tags.init | quote }}
+ imagePullPolicy: {{ $context.Values.images.pullPolicy }}
+ securityContext:
+ privileged: true
+ runAsUser: 0
+ command: ["bash", "-xc"]
+ args:
+ - echo '/tmp/coredump/core.%h.%e.%t' > /mnt/host-rootfs/proc/sys/kernel/core_pattern
+ volumeMounts:
+ - name: host-rootfs
+ mountPath: /mnt/host-rootfs
+{{- end -}}
diff --git a/omec/omec-control-plane/templates/bin/_hss-bootstrap.sh.tpl b/omec/omec-control-plane/templates/bin/_hss-bootstrap.sh.tpl
new file mode 100644
index 0000000..ebbddf2
--- /dev/null
+++ b/omec/omec-control-plane/templates/bin/_hss-bootstrap.sh.tpl
@@ -0,0 +1,136 @@
+#!/bin/bash
+#
+# Copyright 2019-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.
+
+set -ex
+
+function provision_users() {
+ count=${1}
+ imsi=${2}
+ msisdn=${3}
+ apn=${4}
+ key=${5}
+ opc=${6}
+ sqn=${7}
+ cassandra_ip=${8}
+ mmeidentity=${9}
+ mmerealm=${10}
+
+ for (( i=1; i<=$count; i++ ))
+ do
+ echo "IMSI=$imsi MSISDN=$msisdn"
+ cqlsh $cassandra_ip -e "INSERT INTO vhss.users_imsi (imsi, msisdn, access_restriction, key, opc, mmehost, mmeidentity_idmmeidentity, mmerealm, rand, sqn, subscription_data) VALUES ('$imsi', $msisdn, 41, '$key', '$opc','$mmeidentity', 3, '$mmerealm', '2683b376d1056746de3b254012908e0e', $sqn, '{\"Subscription-Data\":{\"Access-Restriction-Data\":41,\"Subscriber-Status\":0,\"Network-Access-Mode\":2,\"Regional-Subscription-Zone-Code\":[\"0x0123\",\"0x4567\",\"0x89AB\",\"0xCDEF\",\"0x1234\",\"0x5678\",\"0x9ABC\",\"0xDEF0\",\"0x2345\",\"0x6789\"],\"MSISDN\":\"0x$msisdn\",\"AMBR\":{\"Max-Requested-Bandwidth-UL\":50000000,\"Max-Requested-Bandwidth-DL\":100000000},\"APN-Configuration-Profile\":{\"Context-Identifier\":0,\"All-APN-Configurations-Included-Indicator\":0,\"APN-Configuration\":{\"Context-Identifier\":0,\"PDN-Type\":0,\"Served-Party-IP-Address\":[\"0.0.0.0\"],\"Service-Selection\":\"$apn\",\"EPS-Subscribed-QoS-Profile\":{\"QoS-Class-Identifier\":9,\"Allocation-Retention-Priority\":{\"Priority-Level\":15,\"Pre-emption-Capability\":0,\"Pre-emption-Vulnerability\":0}},\"AMBR\":{\"Max-Requested-Bandwidth-UL\":50000000,\"Max-Requested-Bandwidth-DL\":100000000},\"PDN-GW-Allocation-Type\":0,\"MIP6-Agent-Info\":{\"MIP-Home-Agent-Address\":[\"172.26.17.183\"]}}},\"Subscribed-Periodic-RAU-TAU-Timer\":0}}');"
+
+ if [ $? -ne 0 ];then
+ echo -e "oops! Something went wrong adding $imsi to vhss.users_imsi!\n"
+ exit 1
+ fi
+
+ cqlsh $cassandra_ip -e "INSERT INTO vhss.msisdn_imsi (msisdn, imsi) VALUES ($msisdn, '$imsi');"
+ if [ $? -ne 0 ];then
+ echo -e "oops! Something went wrong adding $imsi to vhss.msisdn_imsi!\n"
+ exit 1
+ fi
+
+ echo -e "Added $imsi\n"
+
+ imsi=`expr $imsi + 1`;
+ msisdn=`expr $msisdn + 1`
+ done
+}
+
+function provision_staticusers() {
+ imsi=${1}
+ msisdn=${2}
+ apn=${3}
+ key=${4}
+ opc=${5}
+ sqn=${6}
+ cassandra_ip=${7}
+ mmeidentity=${8}
+ mmerealm=${9}
+ staticAddr=${10}
+
+ echo "IMSI=$imsi MSISDN=$msisdn"
+ cqlsh $cassandra_ip -e "INSERT INTO vhss.users_imsi (imsi, msisdn, access_restriction, key, opc, mmehost, mmeidentity_idmmeidentity, mmerealm, rand, sqn, subscription_data) VALUES ('$imsi', $msisdn, 41, '$key', '$opc','$mmeidentity', 3, '$mmerealm', '2683b376d1056746de3b254012908e0e', $sqn, '{\"Subscription-Data\":{\"Access-Restriction-Data\":41,\"Subscriber-Status\":0,\"Network-Access-Mode\":2,\"Regional-Subscription-Zone-Code\":[\"0x0123\",\"0x4567\",\"0x89AB\",\"0xCDEF\",\"0x1234\",\"0x5678\",\"0x9ABC\",\"0xDEF0\",\"0x2345\",\"0x6789\"],\"MSISDN\":\"0x$msisdn\",\"AMBR\":{\"Max-Requested-Bandwidth-UL\":50000000,\"Max-Requested-Bandwidth-DL\":100000000},\"APN-Configuration-Profile\":{\"Context-Identifier\":0,\"All-APN-Configurations-Included-Indicator\":0,\"APN-Configuration\":{\"Context-Identifier\":0,\"PDN-Type\":0,\"Served-Party-IP-Address\":[\"$staticAddr\"],\"Service-Selection\":\"$apn\",\"EPS-Subscribed-QoS-Profile\":{\"QoS-Class-Identifier\":9,\"Allocation-Retention-Priority\":{\"Priority-Level\":15,\"Pre-emption-Capability\":0,\"Pre-emption-Vulnerability\":0}},\"AMBR\":{\"Max-Requested-Bandwidth-UL\":50000000,\"Max-Requested-Bandwidth-DL\":100000000},\"PDN-GW-Allocation-Type\":0,\"MIP6-Agent-Info\":{\"MIP-Home-Agent-Address\":[\"172.26.17.183\"]}}},\"Subscribed-Periodic-RAU-TAU-Timer\":0}}');"
+
+ cqlsh $cassandra_ip -e "INSERT INTO vhss.msisdn_imsi (msisdn, imsi) VALUES ($msisdn, '$imsi');"
+ echo -e "Added $imsi\n"
+}
+
+function provision_mme() {
+ id=$1
+ isdn=$2
+ host=$3
+ realm=$4
+ uereachability=$5
+ cassandra_ip=$6
+
+ cqlsh $cassandra_ip -e "INSERT INTO vhss.mmeidentity (idmmeidentity, mmeisdn, mmehost, mmerealm, ue_reachability) VALUES ($id, '$isdn', '$host', '$realm', $uereachability);"
+ if [ $? -ne 0 ];then
+ echo -e "oops! Something went wrong adding to vhss.mmeidentity!\n"
+ exit 1
+ fi
+
+ cqlsh $cassandra_ip -e "INSERT INTO vhss.mmeidentity_host (idmmeidentity, mmeisdn, mmehost, mmerealm, ue_reachability) VALUES ($id, '$isdn', '$host', '$realm', $uereachability);"
+ if [ $? -ne 0 ];then
+ echo -e "oops! Something went wrong adding to vhss.mmeidentity_host!\n"
+ exit 1
+ fi
+
+ echo -e "Added mme $id\n"
+}
+
+mme_identity={{ tuple "mme" "identity" . | include "omec-control-plane.diameter_endpoint" }}
+mme_realm={{ tuple "mme" "realm" . | include "omec-control-plane.diameter_endpoint" }}
+
+{{- range .Values.config.hss.bootstrap.users }}
+provision_users \
+ {{ .count }} \
+ {{ .imsiStart }} \
+ {{ .msisdnStart }} \
+ {{ $.Values.config.hss.bootstrap.apn }} \
+ {{ $.Values.config.hss.bootstrap.key }} \
+ {{ $.Values.config.hss.bootstrap.opc }} \
+ {{ $.Values.config.hss.bootstrap.sqn }} \
+ {{ $.Values.config.hss.hssdb }} \
+ $mme_identity \
+ $mme_realm
+{{- end }}
+
+{{- range .Values.config.hss.bootstrap.staticusers }}
+provision_staticusers \
+ {{ .imsi }} \
+ {{ .msisdn }} \
+ {{ $.Values.config.hss.bootstrap.apn }} \
+ {{ $.Values.config.hss.bootstrap.key }} \
+ {{ $.Values.config.hss.bootstrap.opc }} \
+ {{ $.Values.config.hss.bootstrap.sqn }} \
+ {{ $.Values.config.hss.hssdb }} \
+ $mme_identity \
+ $mme_realm \
+ {{ .staticAddr }}
+{{- end }}
+
+{{- range .Values.config.hss.bootstrap.mmes }}
+provision_mme \
+ {{ .id }} \
+ {{ .isdn }} \
+ $mme_identity \
+ $mme_realm \
+ {{ .unreachability }} \
+ {{ $.Values.config.hss.hssdb }}
+{{- end }}
diff --git a/omec/omec-control-plane/templates/bin/_hss-run.sh.tpl b/omec/omec-control-plane/templates/bin/_hss-run.sh.tpl
new file mode 100644
index 0000000..a391541
--- /dev/null
+++ b/omec/omec-control-plane/templates/bin/_hss-run.sh.tpl
@@ -0,0 +1,34 @@
+#!/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.
+
+set -ex
+
+{{- if .Values.config.coreDump.enabled }}
+cp /bin/hss /tmp/coredump/
+{{- end }}
+
+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
+cat $CONF_DIR/{hss.json,hss.conf}
+
+cd $CONF_DIR
+make_certs.sh {{ tuple "hss" "host" . | include "omec-control-plane.diameter_endpoint" }} {{ tuple "hss" "realm" . | include "omec-control-plane.diameter_endpoint" }}
+
+cd ..
+hss -j $CONF_DIR/hss.json
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..76948b7
--- /dev/null
+++ b/omec/omec-control-plane/templates/bin/_mme-init.sh.tpl
@@ -0,0 +1,59 @@
+#!/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 "$POD_IP" '.mme.ip_addr=$MME_LOCAL_IP' config.json > config.tmp && mv config.tmp config.json
+jq --arg MME_LOCAL_IP "$POD_IP" '.s1ap.s1ap_local_addr=$MME_LOCAL_IP' config.json > config.tmp && mv config.tmp config.json
+jq --arg MME_LOCAL_IP "$POD_IP" '.s11.egtp_local_addr=$MME_LOCAL_IP' config.json > config.tmp && mv config.tmp config.json
+
+# Set SPGWC address to the config
+# We need to convert service domain name to actual IP address
+# because mme apps does not take domain address - should be fixed in openmme
+SPGWC_ADDR=$(dig +short +search {{ .Values.config.mme.spgwAddr }})
+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
+cp /opt/mme/config/mme_exporter.json /opt/mme/config/shared/mme_exporter.json
+
+#This multiple copies of config needs some cleanup. For now I want
+#that after running mme_init config to be present in the target directory
+cp /opt/mme/config/shared/* /openmme/target/conf/
+
+# Generate certs
+MME_IDENTITY={{ tuple "mme" "identity" . | include "omec-control-plane.diameter_endpoint" | quote }};
+DIAMETER_HOST=$(echo $MME_IDENTITY | cut -d'.' -f1)
+DIAMETER_REALM={{ tuple "mme" "realm" . | include "omec-control-plane.diameter_endpoint" | 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..f1b937c
--- /dev/null
+++ b/omec/omec-control-plane/templates/bin/_mme-run.sh.tpl
@@ -0,0 +1,59 @@
+#!/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
+
+{{- if .Values.config.coreDump.enabled }}
+cp /openmme/target/bin/$APPLICATION /tmp/coredump/
+{{- end }}
+
+# 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/bin/_spgwc-run.sh.tpl b/omec/omec-control-plane/templates/bin/_spgwc-run.sh.tpl
new file mode 100644
index 0000000..9dfa29f
--- /dev/null
+++ b/omec/omec-control-plane/templates/bin/_spgwc-run.sh.tpl
@@ -0,0 +1,30 @@
+#!/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.
+
+set -xe
+
+{{- if .Values.config.coreDump.enabled }}
+cp /bin/ngic_controlplane /tmp/coredump/
+{{- end }}
+
+mkdir -p /opt/cp/config
+cd /opt/cp/config
+
+cp /etc/cp/config/{adc_rules.cfg,cp_config.cfg,interface.cfg,meter_profile.cfg,pcc_rules.cfg,sdf_rules.cfg,app_config.cfg} .
+sed -i "s/CP_ADDR/$POD_IP/g" interface.cfg
+
+. cp_config.cfg
+ngic_controlplane $EAL_ARGS -- $APP_ARGS
diff --git a/omec/omec-control-plane/templates/configmap-hss.yaml b/omec/omec-control-plane/templates/configmap-hss.yaml
new file mode 100644
index 0000000..c831c87
--- /dev/null
+++ b/omec/omec-control-plane/templates/configmap-hss.yaml
@@ -0,0 +1,110 @@
+{{/*
+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.
+
+Default values for mcord-vepc-helm.
+This is a YAML-formatted file.
+Declare variables to be passed into your templates.
+*/}}
+
+{{- $hssJson := index .Values.config.hss.cfgFiles "hss.json" }}
+{{- $hssJsonCommon := index $hssJson "common" }}
+{{- $hssJsonHss := index $hssJson "hss" }}
+
+{{- if not (hasKey $hssJsonCommon "originhost") -}}
+{{- $_ := tuple "hss" "identity" . | include "omec-control-plane.diameter_endpoint" | set $hssJsonCommon "originhost" -}}
+{{- end }}
+{{- if not (hasKey $hssJsonCommon "originrealm") -}}
+{{- $_ := tuple "hss" "realm" . | include "omec-control-plane.diameter_endpoint" | set $hssJsonCommon "originrealm" -}}
+{{- end }}
+{{- if not (hasKey $hssJsonHss "casssrv") -}}
+{{- $_ := .Values.cassandra.fullnameOverride | set $hssJsonHss "casssrv" -}}
+{{- end }}
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: hss
+ labels:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+data:
+ acl.conf: |
+ {{- if hasKey .Values.config.hss.acl "oldTls" }}
+ ALLOW_OLD_TLS {{ .Values.config.hss.acl.oldTls }}
+ {{- end }}
+ {{- if hasKey .Values.config.hss.acl "ipSec" }}
+ ALLOW_IPSEC {{ .Values.config.hss.acl.ipSec }}
+ {{- end }}
+ hss.conf: |
+ Identity = {{ tuple "hss" "identity" . | include "omec-control-plane.diameter_endpoint" | quote }};
+ Realm = {{ tuple "hss" "realm" . | include "omec-control-plane.diameter_endpoint" | quote }};
+ TLS_Cred = "/opt/c3po/hss/conf/{{ tuple "hss" "host" . | include "omec-control-plane.diameter_endpoint" }}.cert.pem",
+ "/opt/c3po/hss/conf/{{ tuple "hss" "host" . | include "omec-control-plane.diameter_endpoint" }}.key.pem";
+ TLS_CA = "/opt/c3po/hss/conf/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" : "/opt/c3po/hss/conf/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-run.sh: |
+{{ tuple "bin/_hss-run.sh.tpl" . | include "omec-control-plane.template" | indent 4 }}
+ hss-bootstrap.sh: |
+{{ tuple "bin/_hss-bootstrap.sh.tpl" . | include "omec-control-plane.template" | indent 4 }}
+{{- range $key, $value := .Values.config.hss.cfgFiles }}
+ {{ $key }}: {{ toJson $value | quote }}
+{{- end }}
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..139ec8c
--- /dev/null
+++ b/omec/omec-control-plane/templates/configmap-mme.yaml
@@ -0,0 +1,97 @@
+{{/*
+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.
+*/}}
+
+{{- $configJson := index .Values.config.mme.cfgFiles "config.json" }}
+{{- $configJsonS6a := index $configJson "s6a" }}
+
+{{- if not (hasKey $configJsonS6a "host") -}}
+{{- $_ := tuple "hss" "identity" . | include "omec-control-plane.diameter_endpoint" | set $configJsonS6a "host" -}}
+{{- end }}
+{{- if not (hasKey $configJsonS6a "realm") -}}
+{{- $_ := tuple "hss" "realm" . | include "omec-control-plane.diameter_endpoint" | set $configJsonS6a "realm" -}}
+{{- end }}
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: mme
+ labels:
+{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+data:
+ s6a_fd.conf: |
+ Identity = {{ tuple "mme" "identity" . | include "omec-control-plane.diameter_endpoint" | quote }};
+ Realm = {{ tuple "mme" "realm" . | include "omec-control-plane.diameter_endpoint" | quote }};
+ TLS_Cred = "conf/{{ tuple "mme" "host" . | include "omec-control-plane.diameter_endpoint" }}.cert.pem",
+ "conf/{{ tuple "mme" "host" . | include "omec-control-plane.diameter_endpoint" }}.key.pem";
+ TLS_CA = "conf/cacert.pem";
+ AppServThreads = 40;
+ SCTP_streams = 3;
+ NoRelay;
+ No_IPv6;
+ #Port = 3868;
+ #SecPort = 3869;
+
+ ConnectPeer = {{ tuple "hss" "identity" . | include "omec-control-plane.diameter_endpoint" | quote }} { No_TLS; port = 3868; };
+
+ 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_S6c.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_S6t.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_SGd.fdx";
+ LoadExtension = "/usr/local/lib/freeDiameter/dict_T6aT6bT7.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 }}
+{{- range $key, $value := .Values.config.mme.cfgFiles }}
+ {{ $key }}: {{ toJson $value | quote }}
+{{- end }}
diff --git a/omec/omec-control-plane/templates/configmap-spgwc.yaml b/omec/omec-control-plane/templates/configmap-spgwc.yaml
new file mode 100644
index 0000000..bc71b34
--- /dev/null
+++ b/omec/omec-control-plane/templates/configmap-spgwc.yaml
@@ -0,0 +1,62 @@
+{{/*
+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: ConfigMap
+metadata:
+ name: spgwc
+ labels:
+{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+data:
+ cp_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} --no-pci"
+
+ MGMT_INFO="-s ${POD_IP} -w {{ .Values.config.spgwc.s1uAddr }}"
+ APN_INFO="-i {{ .Values.config.spgwc.ueIpPool.ip }} -p {{ .Values.config.spgwc.ueIpPool.mask }} -a {{ .Values.config.spgwc.apn }}"
+ MISC="-l 2"
+ SPGW_CFG="-d 03"
+
+{{- if .Values.config.spgwc.multiUpfs }}
+ CONFIG_UPDATE_FOLDER="-f /etc/cp/config/"
+ APP_ARGS="${MGMT_INFO} ${APN_INFO} ${MISC} ${SPGW_CFG} ${CONFIG_UPDATE_FOLDER}"
+{{- else }}
+ APP_ARGS="${MGMT_INFO} ${APN_INFO} ${MISC} ${SPGW_CFG} "
+{{- end }}
+ interface.cfg: |
+ [0]
+ zmq_protocol = tcp
+ cp_comm_ip = CP_ADDR
+ cp_comm_port = 21
+{{- if .Values.config.spgwc.multiUpfs }}
+ cp_nb_ip = CP_ADDR
+ cp_nb_port = 21
+ dp_comm_ip = 127.0.0.1
+ dp_comm_port = 20
+{{- else }}
+ dp_comm_ip = {{ .Values.config.spgwc.dpComm.addr }}
+ dp_comm_port = {{ .Values.config.spgwc.dpComm.port }}
+{{- end }}
+ spgwc-run.sh: |
+{{ tuple "bin/_spgwc-run.sh.tpl" . | include "omec-control-plane.template" | indent 4 }}
+{{- range $key, $value := .Values.config.spgwc.cfgFiles }}
+ {{ $key }}: |-
+{{ $value | indent 4 }}
+{{- end }}
diff --git a/omec/omec-control-plane/templates/job-hss-bootstrap.yaml b/omec/omec-control-plane/templates/job-hss-bootstrap.yaml
new file mode 100644
index 0000000..03ac80d
--- /dev/null
+++ b/omec/omec-control-plane/templates/job-hss-bootstrap.yaml
@@ -0,0 +1,74 @@
+{{/*
+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 .Values.config.hss.bootstrap }}
+---
+apiVersion: batch/v1
+kind: Job
+metadata:
+ name: job-hss-bootstrap
+ labels:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+ template:
+ metadata:
+{{ 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 }}
+ restartPolicy: OnFailure
+ serviceAccountName: hss
+ initContainers:
+ - name: job-bootstrap-dep-check
+ image: {{ .Values.images.tags.depCheck | quote }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ securityContext:
+ allowPrivilegeEscalation: false
+ readOnlyRootFilesystem: false
+ runAsUser: 0
+ env:
+ - 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_JOBS
+ value: job-hss-db-sync
+ command:
+ - kubernetes-entrypoint
+ volumeMounts:
+ []
+ containers:
+ - name: hss-bootstrap
+ image: {{ .Values.images.tags.hssdb }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ command: ["/opt/c3po/hss/hss-bootstrap.sh"]
+ volumeMounts:
+ - name: hss-script
+ mountPath: /opt/c3po/hss/hss-bootstrap.sh
+ subPath: hss-bootstrap.sh
+ volumes:
+ - name: hss-script
+ configMap:
+ name: hss
+ defaultMode: 493
+{{- end }}
diff --git a/omec/omec-control-plane/templates/job-hss-db-sync.yaml b/omec/omec-control-plane/templates/job-hss-db-sync.yaml
new file mode 100644
index 0000000..17f3213
--- /dev/null
+++ b/omec/omec-control-plane/templates/job-hss-db-sync.yaml
@@ -0,0 +1,67 @@
+{{/*
+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: batch/v1
+kind: Job
+metadata:
+ name: job-hss-db-sync
+ labels:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+ template:
+ metadata:
+{{ 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 }}
+ restartPolicy: OnFailure
+ serviceAccountName: hss
+ initContainers:
+ {{- if .Values.cassandra.deploy }}
+ - name: job-db-sync-dep-check
+ image: {{ .Values.images.tags.depCheck | quote }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ securityContext:
+ allowPrivilegeEscalation: false
+ readOnlyRootFilesystem: false
+ runAsUser: 0
+ env:
+ - 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_SERVICE
+ value: {{ .Values.config.hss.hssdb }}
+ command:
+ - kubernetes-entrypoint
+ volumeMounts:
+ []
+ {{- end }}
+ containers:
+ - name: hss-db-sync
+ image: {{ .Values.images.tags.hssdb }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ command: ["bash", "-xc"]
+ args:
+ - until cqlsh --file /opt/c3po/hssdb/oai_db.cql {{ .Values.config.hss.hssdb }}; do echo "Provisioning HSSDB"; sleep 2;done
diff --git a/omec/omec-control-plane/templates/service-hss.yaml b/omec/omec-control-plane/templates/service-hss.yaml
new file mode 100644
index 0000000..14bfbda
--- /dev/null
+++ b/omec/omec-control-plane/templates/service-hss.yaml
@@ -0,0 +1,63 @@
+{{/*
+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: hss
+ labels:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+ selector:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+ ports:
+ - name: s6a
+ port: 3868
+ protocol: TCP
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: hss-headless
+ 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
+{{- if .Values.config.hss.s6a.nodePort.enabled }}
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: hss-external
+ labels:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+ selector:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+ type: NodePort
+ ports:
+ - name: s6a
+ port: 3868
+ protocol: TCP
+ nodePort: {{ .Values.config.hss.s6a.nodePort.port }}
+{{- end }}
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..0e52bac
--- /dev/null
+++ b/omec/omec-control-plane/templates/service-mme.yaml
@@ -0,0 +1,100 @@
+{{/*
+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.
+*/}}
+
+{{- $configJson := index .Values.config.mme.cfgFiles "config.json" }}
+{{- $configJsonS11 := index $configJson "s11" }}
+{{- $configJsonS1ap := index $configJson "s1ap" }}
+---
+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 }}
+ type: ClusterIP
+ ports:
+ - name: s11
+ port: {{ index $configJsonS11 "egtp_default_port" }}
+ protocol: UDP
+ - name: s6a
+ port: 3868
+ protocol: TCP
+ - name: s1ap
+ port: {{ index $configJsonS1ap "sctp_port" }}
+ protocol: SCTP
+{{- if .Values.prometheusExporter.mme.enabled }}
+ - name: exporter
+ port: 3081
+ protocol: TCP
+{{- end }}
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: mme-headless
+ 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: {{ index $configJsonS11 "egtp_default_port" }}
+ protocol: UDP
+ - name: s6a
+ port: 3868
+ protocol: TCP
+ - name: s1ap
+ port: {{ index $configJsonS1ap "sctp_port" }}
+ protocol: SCTP
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: mme-external
+ 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:
+ {{- if .Values.config.mme.s11.nodePort.enabled }}
+ - name: s11
+ port: {{ index $configJsonS11 "egtp_default_port" }}
+ protocol: UDP
+ nodePort: {{ .Values.config.mme.s11.nodePort.port }}
+ {{- end }}
+ {{- if .Values.config.mme.s6a.nodePort.enabled }}
+ - name: s6a
+ port: 3868
+ protocol: TCP
+ nodePort: {{ .Values.config.mme.s6a.nodePort.port }}
+ {{- end }}
+ - name: s1ap
+ port: {{ index $configJsonS1ap "sctp_port" }}
+ nodePort: {{ index $configJsonS1ap "sctp_port_external" }}
+ protocol: SCTP
+ {{- if .Values.prometheusExporter.mme.enabled }}
+ - name: exporter
+ port: 3081
+ nodePort: {{ .Values.prometheusExporter.mme.port }}
+ protocol: TCP
+ {{- end }}
diff --git a/omec/omec-control-plane/templates/service-spgwc.yaml b/omec/omec-control-plane/templates/service-spgwc.yaml
new file mode 100644
index 0000000..fe1e68c
--- /dev/null
+++ b/omec/omec-control-plane/templates/service-spgwc.yaml
@@ -0,0 +1,86 @@
+{{/*
+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: spgwc
+ labels:
+{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+ type: ClusterIP
+ selector:
+{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+ ports:
+ - name: cp-comm
+ port: {{ .Values.config.spgwc.cpComm.port }}
+{{- if .Values.config.spgwc.multiUpfs }}
+ protocol: TCP
+{{- else }}
+ protocol: UDP
+{{- end }}
+ - name: s11
+ port: {{ .Values.config.spgwc.s11.port }}
+ protocol: UDP
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: spgwc-headless
+ labels:
+{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+ clusterIP: None
+ selector:
+{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+ ports:
+ - name: cp-comm
+ port: {{ .Values.config.spgwc.cpComm.port }}
+{{- if .Values.config.spgwc.multiUpfs }}
+ protocol: TCP
+{{- else }}
+ protocol: UDP
+{{- end }}
+ - name: s11
+ port: {{ .Values.config.spgwc.s11.port }}
+ protocol: UDP
+{{- if not .Values.config.spgwc.multiUpfs }}
+{{- if or .Values.config.spgwc.cpComm.nodePort.enabled .Values.config.spgwc.s11.nodePort.enabled }}
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: spgwc-external
+ labels:
+{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+ type: NodePort
+ selector:
+{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+ ports:
+{{- if .Values.config.spgwc.cpComm.nodePort.enabled }}
+ - name: cp-comm
+ port: {{ .Values.config.spgwc.cpComm.port }}
+ protocol: TCP
+{{- end }}
+{{- if .Values.config.spgwc.s11.nodePort.enabled }}
+ - name: s11
+ port: {{ .Values.config.spgwc.s11.port }}
+ protocol: UDP
+{{- end }}
+{{- end }}
+{{- end }}
diff --git a/omec/omec-control-plane/templates/statefulset-hss.yaml b/omec/omec-control-plane/templates/statefulset-hss.yaml
new file mode 100644
index 0000000..dc461b8
--- /dev/null
+++ b/omec/omec-control-plane/templates/statefulset-hss.yaml
@@ -0,0 +1,118 @@
+{{/*
+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.
+
+Default values for mcord-vepc-helm.
+This is a YAML-formatted file.
+Declare variables to be passed into your templates.
+*/}}
+
+{{ tuple "hss" . | include "omec-control-plane.service_account" }}
+---
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+ name: hss
+ labels:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+ replicas: 1
+ serviceName: hss-headless
+ selector:
+ matchLabels:
+{{ tuple "hss" . | include "omec-control-plane.metadata_labels" | indent 6 }}
+ 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 }}
+ serviceAccountName: hss
+ initContainers:
+ - name: hss-dep-check
+ image: {{ .Values.images.tags.depCheck | quote }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ securityContext:
+ allowPrivilegeEscalation: false
+ readOnlyRootFilesystem: false
+ runAsUser: 0
+ env:
+ - 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_JOBS
+ {{- if .Values.config.hss.bootstrap }}
+ value: job-hss-db-sync,job-hss-bootstrap
+ {{- else }}
+ value: job-hss-db-sync
+ {{- end }}
+ command:
+ - kubernetes-entrypoint
+ volumeMounts:
+ []
+ {{- if .Values.config.coreDump.enabled }}
+{{ tuple "hss" . | include "omec-control-plane.coredump_init" | indent 6 }}
+ {{- end }}
+ containers:
+ - name: hss
+ image: {{ .Values.images.tags.hss }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ {{- if .Values.config.coreDump.enabled }}
+ securityContext:
+ privileged: true
+ runAsUser: 0
+ {{- end }}
+ stdin: true
+ tty: true
+ command: ["bash", "-c", "/opt/c3po/hss/hss-run.sh; sleep 3600"]
+ {{- if .Values.resources.enabled }}
+ resources:
+{{ toYaml .Values.resources.hss | indent 10 }}
+ {{- end }}
+ volumeMounts:
+ - name: hss-script
+ mountPath: /opt/c3po/hss/hss-run.sh
+ subPath: hss-run.sh
+ - name: hss-config
+ mountPath: /etc/hss/conf
+ {{- if .Values.config.coreDump.enabled }}
+ - name: coredump
+ mountPath: /tmp/coredump
+ {{- end }}
+ volumes:
+ - name: hss-script
+ configMap:
+ name: hss
+ defaultMode: 493
+ - name: hss-config
+ configMap:
+ name: hss
+ defaultMode: 420
+ {{- if .Values.config.coreDump.enabled }}
+ - name: host-rootfs
+ hostPath:
+ path: /
+ - name: coredump
+ hostPath:
+ path: {{ .Values.config.coreDump.path }}
+ {{- end }}
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..3560344
--- /dev/null
+++ b/omec/omec-control-plane/templates/statefulset-mme.yaml
@@ -0,0 +1,278 @@
+{{/*
+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.
+*/}}
+
+{{ tuple "mme" . | include "omec-control-plane.service_account" }}
+---
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+ name: mme
+ labels:
+{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+ replicas: 1
+ serviceName: mme-headless
+ selector:
+ matchLabels:
+{{ tuple "mme" . | include "omec-control-plane.metadata_labels" | indent 6 }}
+ 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-load-sctp-module
+ image: {{ .Values.images.tags.init | quote }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ securityContext:
+ privileged: true
+ runAsUser: 0
+ command: ["bash", "-xc"]
+ args:
+ - |
+ if chroot /mnt/host-rootfs modinfo nf_conntrack_proto_sctp > /dev/null 2>&1; then \
+ chroot /mnt/host-rootfs modprobe nf_conntrack_proto_sctp; \
+ fi;
+ chroot /mnt/host-rootfs modprobe tipc
+ volumeMounts:
+ - name: host-rootfs
+ mountPath: /mnt/host-rootfs
+ - 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": "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: POD_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
+ {{- if .Values.config.coreDump.enabled }}
+{{ tuple "mme" . | include "omec-control-plane.coredump_init" | indent 6 }}
+ {{- end }}
+ containers:
+ - name: mme-app
+ image: {{ .Values.images.tags.mme | quote }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ {{- if .Values.config.coreDump.enabled }}
+ securityContext:
+ privileged: true
+ runAsUser: 0
+ {{- end }}
+ command: ["bash", "-xc"]
+ args:
+ - /opt/mme/scripts/mme-run.sh mme-app
+ {{- if .Values.resources.enabled }}
+ resources:
+{{ toYaml .Values.resources.mme | indent 10 }}
+ {{- end }}
+ env:
+ - name: POD_IP
+ valueFrom:
+ fieldRef:
+ fieldPath: status.podIP
+ - name: MMERUNENV
+ value: "container"
+ 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: configs
+ mountPath: /opt/mme/config
+ {{- if .Values.config.coreDump.enabled }}
+ - name: coredump
+ mountPath: /tmp/coredump
+ {{- end }}
+ - name: s1ap-app
+ image: {{ .Values.images.tags.mme | quote }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ {{- if .Values.config.coreDump.enabled }}
+ securityContext:
+ privileged: true
+ runAsUser: 0
+ {{- end }}
+ command: ["bash", "-xc"]
+ args:
+ - /opt/mme/scripts/mme-run.sh s1ap-app
+ {{- if .Values.resources.enabled }}
+ resources:
+{{ toYaml .Values.resources.mme | indent 10 }}
+ {{- end }}
+ env:
+ - name: MMERUNENV
+ value: "container"
+ 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: configs
+ mountPath: /opt/mme/config
+ {{- if .Values.config.coreDump.enabled }}
+ - name: coredump
+ mountPath: /tmp/coredump
+ {{- end }}
+ - name: s6a-app
+ image: {{ .Values.images.tags.mme | quote }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ {{- if .Values.config.coreDump.enabled }}
+ securityContext:
+ privileged: true
+ runAsUser: 0
+ {{- end }}
+ command: ["bash", "-xc"]
+ args:
+ - /opt/mme/scripts/mme-run.sh s6a-app
+ {{- if .Values.resources.enabled }}
+ resources:
+{{ toYaml .Values.resources.mme | indent 10 }}
+ {{- end }}
+ env:
+ - name: MMERUNENV
+ value: "container"
+ 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
+ {{- if .Values.config.coreDump.enabled }}
+ - name: coredump
+ mountPath: /tmp/coredump
+ {{- end }}
+ - name: s11-app
+ image: {{ .Values.images.tags.mme | quote }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ {{- if .Values.config.coreDump.enabled }}
+ securityContext:
+ privileged: true
+ runAsUser: 0
+ {{- end }}
+ command: ["bash", "-xc"]
+ args:
+ - /opt/mme/scripts/mme-run.sh s11-app
+ {{- if .Values.resources.enabled }}
+ resources:
+{{ toYaml .Values.resources.mme | indent 10 }}
+ {{- end }}
+ env:
+ - name: MMERUNENV
+ value: "container"
+ 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
+ {{- if .Values.config.coreDump.enabled }}
+ - name: coredump
+ mountPath: /tmp/coredump
+ {{- end }}
+ {{- if .Values.prometheusExporter.mme.enabled }}
+ - name: subscriber-exporter
+ image: {{ .Values.images.tags.mmeExporter }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ securityContext:
+ privileged: true
+ command: ["bash", "-xc"]
+ args:
+ - cp /opt/mme/config/shared/mme_exporter.json /openmme/conf/mme_exporter.json;
+ until [ -e /tmp/unix_socket ]; do sleep 1; done;
+ chmod 777 /tmp/unix_socket;
+ while true; do python3 monitor_client.py; sleep 1; done;
+ {{- if .Values.resources.enabled }}
+ resources:
+{{ toYaml .Values.resources.mme | indent 10 }}
+ {{- end }}
+ volumeMounts:
+ - name: shared-data
+ mountPath: /opt/mme/config/shared
+ - name: shared-app
+ mountPath: /tmp
+ {{- end }}
+ volumes:
+ - name: scripts
+ configMap:
+ name: mme
+ defaultMode: 493
+ - name: configs
+ configMap:
+ name: mme
+ defaultMode: 420
+ - name: shared-data
+ emptyDir: {}
+ - name: shared-app
+ emptyDir: {}
+ - name: host-rootfs
+ hostPath:
+ path: /
+ {{- if .Values.config.coreDump.enabled }}
+ - name: coredump
+ hostPath:
+ path: {{ .Values.config.coreDump.path }}
+ {{- end }}
diff --git a/omec/omec-control-plane/templates/statefulset-spgwc.yaml b/omec/omec-control-plane/templates/statefulset-spgwc.yaml
new file mode 100644
index 0000000..cd094ee
--- /dev/null
+++ b/omec/omec-control-plane/templates/statefulset-spgwc.yaml
@@ -0,0 +1,122 @@
+{{/*
+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.
+*/}}
+
+{{ tuple "spgwc" . | include "omec-control-plane.service_account" }}
+---
+apiVersion: apps/v1
+kind: StatefulSet
+metadata:
+ name: spgwc
+ labels:
+{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 4 }}
+spec:
+ replicas: 1
+ serviceName: spgwc-headless
+ selector:
+ matchLabels:
+{{ tuple "spgwc" . | include "omec-control-plane.metadata_labels" | indent 6 }}
+ 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: spgwc-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": "mme"}, "requireSameNode": false}]'
+ {{- if .Values.config.coreDump.enabled }}
+{{ tuple "spgwc" . | include "omec-control-plane.coredump_init" | indent 6 }}
+ {{- end }}
+ containers:
+ - name: spgwc
+ image: {{ .Values.images.tags.spgwc }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ {{- if .Values.config.coreDump.enabled }}
+ securityContext:
+ privileged: true
+ runAsUser: 0
+ {{- end }}
+ stdin: true
+ tty: true
+ command: ["/opt/cp/scripts/spgwc-run.sh"]
+ env:
+ - name: MEM_LIMIT
+ valueFrom:
+ resourceFieldRef:
+ containerName: spgwc
+ resource: limits.memory
+ divisor: 1Mi
+ - name: POD_IP
+ valueFrom:
+ fieldRef:
+ fieldPath: status.podIP
+ {{- if .Values.resources.enabled }}
+ resources:
+{{ toYaml .Values.resources.spgwc | indent 10 }}
+ {{- end }}
+ volumeMounts:
+ - name: cp-script
+ mountPath: /opt/cp/scripts/spgwc-run.sh
+ subPath: spgwc-run.sh
+ - name: cp-config
+ mountPath: /etc/cp/config
+ {{- if .Values.config.coreDump.enabled }}
+ - name: coredump
+ mountPath: /tmp/coredump
+ {{- end }}
+ volumes:
+ - name: cp-script
+ configMap:
+ name: spgwc
+ defaultMode: 493
+ - name: cp-config
+ configMap:
+ name: spgwc
+ defaultMode: 420
+ {{- if .Values.config.coreDump.enabled }}
+ - name: host-rootfs
+ hostPath:
+ path: /
+ - name: coredump
+ hostPath:
+ path: {{ .Values.config.coreDump.path }}
+ {{- end }}