88Auto scaling 5G NFs
99===================
1010
11+ .. warning ::
12+ **This feature is deprecated. ** Autoscaling using KEDA was supported in the legacy
13+ Aether-in-a-Box (AIAB) deployment method, which has been replaced by
14+ `Aether OnRamp <https://github.com/opennetworkinglab/aether-onramp >`_.
15+ Aether OnRamp does not currently support autoscaling. This documentation is
16+ preserved for historical reference only.
17+
1118Autoscaling cloud native network functions is a critical capability for modern cloud infrastructure.
1219It enables dynamic scaling of network functions to handle increased traffic or workload demands,
1320ensuring optimal performance and cost-effectiveness.
@@ -21,10 +28,10 @@ minimize costs.
2128
2229We can enable autoscaling based on memory usage, CPU usage, and custom metrics.
2330
24- Illustration
25- ------------
31+ Illustration (Legacy AIAB)
32+ --------------------------
2633
27- Let's explore the steps on how to set up autoscaling in AIAB.
34+ The following steps were used to set up autoscaling in the legacy AIAB deployment .
2835
2936In this example, we are setting up KEDA to scale the smf pod up for every 50 N4 messages received by SMF
3037
@@ -44,125 +51,125 @@ Run the following steps in aether-in-a-box folder:
4451
4552Create file aiab.diff with following content
4653
47- .. code-block ::
48-
49- diff --git a/Makefile b/Makefile
50- index bd54a7a..df85e0a 100644
51- --- a/Makefile
52- +++ b/Makefile
53- @@ -26,9 +26,10 @@ GET_HELM = get_helm.sh
54- KUBESPRAY_VERSION ?= release-2.17
55- DOCKER_VERSION ?= '20.10'
56- HELM_VERSION ?= v3.10.3
57- -KUBECTL_VERSION ?= v1.23.15
58- +KUBECTL_VERSION ?= v1.24.11
59-
60- -RKE2_K8S_VERSION ?= v1.23.15+rke2r1
61- +RKE2_K8S_VERSION ?= v1.24.11+rke2r1
62- +#RKE2_K8S_VERSION ?= v1.23.15+rke2r1
63- K8S_VERSION ?= v1.21.6
64-
65- OAISIM_UE_IMAGE ?= andybavier/lte-uesoftmodem:1.1.0-$(shell uname -r)
66- @@ -65,6 +66,8 @@ ROUTER_HOST_NETCONF := /etc/systemd/network/10-aiab-access.netdev /etc/systemd
67- UE_NAT_CONF := /etc/systemd/system/aiab-ue-nat.service
68-
69- # monitoring
70- +AUTOSCALE_CHART := kedacore/keda
71- +AUTOSCALE_VALUES ?= $(MAKEDIR)/autoscale.yaml
72- RANCHER_MONITORING_CRD_CHART := rancher/rancher-monitoring-crd
73- RANCHER_MONITORING_CHART := rancher/rancher-monitoring
74- MONITORING_VALUES ?= $(MAKEDIR)/monitoring.yaml
75- @@ -675,6 +678,26 @@ test: | 4g-core $(M)/oaisim
76- fi
77- @grep -q "Simulation Result: PASS\|Profile Status: PASS" /tmp/gnbsim.out
78-
79- +autoscale: $(M)/autoscale
80- +$(M)/autoscale: $(M)/helm-ready
81- + helm repo add kedacore https://kedacore.github.io/charts
82- + helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \
83- + --namespace=autoscale \
84- + --create-namespace \
85- + --values=$(AUTOSCALE_VALUES) \
86- + keda-aiab \
87- + $(AUTOSCALE_CHART)
88- + touch $(M)/autoscale
89- +
90- +autoscale-aiab: $(M)/autoscale
91- + kubectl apply -f resources/keda.yaml
92- +
93- +autoscale-clean:
94- + kubectl delete -f resources/keda.yaml
95- + helm -n autoscale delete keda-aiab || true
96- + kubectl delete namespace autoscale || true
97- + rm $(M)/autoscale
98- +
99- reset-test: | oaisim-clean omec-clean router-clean
100- @cd $(M); rm -f omec oaisim 5g-core
101-
102- diff --git a/resources/5g-monitoring/kustomization.yaml b/resources/5g-monitoring/kustomization.yaml
103- index 96bc72b..0b757e9 100644
104- --- a/resources/5g-monitoring/kustomization.yaml
105- +++ b/resources/5g-monitoring/kustomization.yaml
106- @@ -5,6 +5,7 @@
107- resources:
108- - ./metricfunc-monitor.yaml
109- - ./upf-monitor.yaml
110- + - ./smf-monitor.yaml
111-
112- configMapGenerator:
113- - name: grafana-ops-dashboards
54+ .. code-block :: diff
55+
56+ diff --git a/Makefile b/Makefile
57+ index bd54a7a..df85e0a 100644
58+ --- a/Makefile
59+ +++ b/Makefile
60+ @@ -26,9 +26,10 @@ GET_HELM = get_helm.sh
61+ KUBESPRAY_VERSION ?= release-2.17
62+ DOCKER_VERSION ?= '20.10'
63+ HELM_VERSION ?= v3.10.3
64+ -KUBECTL_VERSION ?= v1.23.15
65+ +KUBECTL_VERSION ?= v1.24.11
66+
67+ -RKE2_K8S_VERSION ?= v1.23.15+rke2r1
68+ +RKE2_K8S_VERSION ?= v1.24.11+rke2r1
69+ +#RKE2_K8S_VERSION ?= v1.23.15+rke2r1
70+ K8S_VERSION ?= v1.21.6
71+
72+ OAISIM_UE_IMAGE ?= andybavier/lte-uesoftmodem:1.1.0-$(shell uname -r)
73+ @@ -65,6 +66,8 @@ ROUTER_HOST_NETCONF := /etc/systemd/network/10-aiab-access.netdev /etc/systemd
74+ UE_NAT_CONF := /etc/systemd/system/aiab-ue-nat.service
75+
76+ # monitoring
77+ +AUTOSCALE_CHART := kedacore/keda
78+ +AUTOSCALE_VALUES ?= $(MAKEDIR)/autoscale.yaml
79+ RANCHER_MONITORING_CRD_CHART := rancher/rancher-monitoring-crd
80+ RANCHER_MONITORING_CHART := rancher/rancher-monitoring
81+ MONITORING_VALUES ?= $(MAKEDIR)/monitoring.yaml
82+ @@ -675,6 +678,26 @@ test: | 4g-core $(M)/oaisim
83+ fi
84+ @grep -q "Simulation Result: PASS\|Profile Status: PASS" /tmp/gnbsim.out
85+
86+ +autoscale: $(M)/autoscale
87+ +$(M)/autoscale: $(M)/helm-ready
88+ + helm repo add kedacore https://kedacore.github.io/charts
89+ + helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \
90+ + --namespace=autoscale \
91+ + --create-namespace \
92+ + --values=$(AUTOSCALE_VALUES) \
93+ + keda-aiab \
94+ + $(AUTOSCALE_CHART)
95+ + touch $(M)/autoscale
96+ +
97+ +autoscale-aiab: $(M)/autoscale
98+ + kubectl apply -f resources/keda.yaml
99+ +
100+ +autoscale-clean:
101+ + kubectl delete -f resources/keda.yaml
102+ + helm -n autoscale delete keda-aiab || true
103+ + kubectl delete namespace autoscale || true
104+ + rm $(M)/autoscale
105+ +
106+ reset-test: | oaisim-clean omec-clean router-clean
107+ @cd $(M); rm -f omec oaisim 5g-core
108+
109+ diff --git a/resources/5g-monitoring/kustomization.yaml b/resources/5g-monitoring/kustomization.yaml
110+ index 96bc72b..0b757e9 100644
111+ --- a/resources/5g-monitoring/kustomization.yaml
112+ +++ b/resources/5g-monitoring/kustomization.yaml
113+ @@ -5,6 +5,7 @@
114+ resources:
115+ - ./metricfunc-monitor.yaml
116+ - ./upf-monitor.yaml
117+ + - ./smf-monitor.yaml
118+
119+ configMapGenerator:
120+ - name: grafana-ops-dashboards
114121
115122
116123 Create a file resources/keda.yaml with the following content
117124
118- .. code-block ::
119-
120- ---
121- apiVersion: keda.sh/v1alpha1
122- kind: ScaledObject
123- metadata:
124- name: smf-scale
125- namespace: omec
126- spec:
127- scaleTargetRef:
128- kind: Deployment
129- name: smf
130- minReplicaCount: 1
131- maxReplicaCount: 5
132- cooldownPeriod: 30
133- pollingInterval: 1
134- triggers:
135- - type: prometheus
136- metadata:
137- serverAddress: http://rancher-monitoring-prometheus.cattle-monitoring-system.svc:9090
138- metricName: n4_messages_total
139- query: |
140- sum(n4_messages_total{job="smf"})
125+ .. code-block :: yaml
126+
127+ ---
128+ apiVersion : keda.sh/v1alpha1
129+ kind : ScaledObject
130+ metadata :
131+ name : smf-scale
132+ namespace : omec
133+ spec :
134+ scaleTargetRef :
135+ kind : Deployment
136+ name : smf
137+ minReplicaCount : 1
138+ maxReplicaCount : 5
139+ cooldownPeriod : 30
140+ pollingInterval : 1
141+ triggers :
142+ - type : prometheus
143+ metadata :
144+ serverAddress : http://rancher-monitoring-prometheus.cattle-monitoring-system.svc:9090
145+ metricName : n4_messages_total
146+ query : |
147+ sum(n4_messages_total{job="smf"})
141148 threshold: "50"
142149
143150 Create file resources/5g-monitoring/smf-monitor.yaml with following content
144151
145- .. code-block ::
146-
147- apiVersion: monitoring.coreos.com/v1
148- kind: ServiceMonitor
149- metadata:
150- name: smf
151- namespace: omec
152- spec:
153- endpoints:
154- - path: /metrics
155- port: prometheus-exporter
156- namespaceSelector:
157- matchNames:
158- - omec
159- selector:
160- matchLabels:
161- app: smf
152+ .. code-block :: yaml
153+
154+ apiVersion : monitoring.coreos.com/v1
155+ kind : ServiceMonitor
156+ metadata :
157+ name : smf
158+ namespace : omec
159+ spec :
160+ endpoints :
161+ - path : /metrics
162+ port : prometheus-exporter
163+ namespaceSelector :
164+ matchNames :
165+ - omec
166+ selector :
167+ matchLabels :
168+ app : smf
162169
163170 Add an empty autoscale.yaml in aiab folder. This file can be used to add override values for keda helm chart.
164171
165- .. code-block ::
172+ .. code-block :: bash
166173
167- touch autoscale.yaml
174+ touch autoscale.yaml
168175
0 commit comments