Sign inSign up

lpoclin/hybrid-controller

By lpoclin

Updated 5 months ago

Hybrid per-slice UPF autoscaling — reactive and proactive orchestrator with MLP inference sidecar

Image
Networking
0

200

lpoclin/hybrid-controller repository overview

Hybrid Controller — Per-Slice UPF Autoscaling Orchestrator for 5G Core

Cloud-native orchestrator implementing hybrid reactive + proactive per-slice UPF autoscaling over free5GC v4.0.1 on Kubernetes. Deployed as a two-container pod alongside an MLP Inference Engine sidecar — both sharing the same network namespace via localhost. The controller is composed of seven internal subsystems with defined responsibilities, structured as Go packages.

Internal subsystems

SubsystemPackageResponsibility
Bootstrap & Control Managercmd/Initializes metrics, registers HTTP handlers, polls MLP readiness before enabling the proactive scheduler
UPF Infrastructure Orchestratorinfra/Builds and applies Kubernetes manifests (Deployment, Service, NADs, ConfigMap) — full UPF lifecycle
Reactive Control Enginereactive/Unified scaling entry point for reactive and proactive requests, cascade guards, SMF callback handlers
Control Loop Coordinatorproactive/5s tick pipeline: sliding window aggregation → normalization → fault injection → MLP inference → dispatch
Telemetry Ingestion Pipelineapi/Receives UPF Agent push, enriches with Kubernetes Metrics Server CPU/mem, feeds 30s sliding window buffer
Observability Subsystemmetrics/Defines and registers all Gauges, Counters and Histograms across subsystems — 20 metrics, 3 dashboards
UE Session State Managermonitor/Polls SMF extended every 10s for active UE sessions, publishes upf_active_ues{upf, imsi, ue_ip}

Scaling modes

Reactive scale-out — triggered by the extended SMF on UPF unavailability. The Reactive Control Engine creates NADs, ConfigMap, Service and Deployment sequentially, waits for pod Running+Ready via Kubernetes watch stream, notifies SMF via POST /force-upf-association {status=active} and responds only after confirmation.

Proactive scale-out — driven by the Control Loop Coordinator on a 5s tick per active UPF. An 8-dimensional normalized feature vector is classified by the MLP Inference Engine sidecar returning {action, confidence}. Valid predictions are dispatched to the Reactive Control Engine. The trigger UPF enters DRAINING — a background goroutine releases 50% of active sessions after 5 min.

Proactive scale-inGetUPFToScaleIn() selects the most recently deployed pod by CreationTimestamp as the lowest-risk candidate. On POST /api/upf/disabled/done callback from SMF, the controller deletes Deployment, Service, NADs, ConfigMap and releases IPs back to the internal pool.

Cascade guards — Reactive Control Engine

Seven guards evaluated in cascade before any scaling action: DISABLE_REACTIVE env toggle, anti-storm lock per slice+DNN, 30s reactive cooldown, 60s global cooldown, trigger-must-be-newest check, max draining per DNN limit (default 2), and no-double-draining validation.

HTTP endpoints (port :8080)

EndpointMethodPurpose
/api/scaleGET / POSTUnified scaling entry — reactive (SMF) and proactive (scheduler)
/api/check-upfGETChecks Running+Ready UPF pod for a given slice
/api/scale/ackPOSTPFCP association + first PDU session confirmation from SMF
/api/upf/disabled/donePOSTSMF callback — triggers full K8s resource cleanup
/api/v1/upf-metricsPOSTUPF Agent telemetry push — enriched with K8s CPU/mem
/active-uesGETTransparent proxy to SMF extended /active-ues
/release-ue-sessionsPOSTACK for gradual session release during draining
/metricsGETPrometheus scraping — 20 instrumented metrics
/healthzGETKubernetes liveness probe

Observability

20 Prometheus metrics across 3 Grafana dashboards covering hybrid autoscaling effectiveness, scale-out and scale-in latency phases, proactive consistency ratio, MLP inference latency and confidence, and scheduler policy counters. All metrics carry {slice, dnn} labels for per-slice granular analysis.

Build

Multi-stage — golang:1.24 (build) + debian:bookworm-slim (runtime) — static binary, CGO disabled.

Exposed ports

8080 HTTP — Controller API + Prometheus /metrics

Source

Controller repository: github.com/5gc-hybrid-upf-autoscaling-system/hybrid-controller
Full project: github.com/5gc-hybrid-upf-autoscaling-system

Tag summary

Content type

Image

Digest

sha256:75e422159

Size

42.1 MB

Last updated

5 months ago

docker pull lpoclin/hybrid-controller:v2