Hybrid per-slice UPF autoscaling — reactive and proactive orchestrator with MLP inference sidecar
200
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.
| Subsystem | Package | Responsibility |
|---|---|---|
| Bootstrap & Control Manager | cmd/ | Initializes metrics, registers HTTP handlers, polls MLP readiness before enabling the proactive scheduler |
| UPF Infrastructure Orchestrator | infra/ | Builds and applies Kubernetes manifests (Deployment, Service, NADs, ConfigMap) — full UPF lifecycle |
| Reactive Control Engine | reactive/ | Unified scaling entry point for reactive and proactive requests, cascade guards, SMF callback handlers |
| Control Loop Coordinator | proactive/ | 5s tick pipeline: sliding window aggregation → normalization → fault injection → MLP inference → dispatch |
| Telemetry Ingestion Pipeline | api/ | Receives UPF Agent push, enriches with Kubernetes Metrics Server CPU/mem, feeds 30s sliding window buffer |
| Observability Subsystem | metrics/ | Defines and registers all Gauges, Counters and Histograms across subsystems — 20 metrics, 3 dashboards |
| UE Session State Manager | monitor/ | Polls SMF extended every 10s for active UE sessions, publishes upf_active_ues{upf, imsi, ue_ip} |
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-in — GetUPFToScaleIn() 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.
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.
| Endpoint | Method | Purpose |
|---|---|---|
/api/scale | GET / POST | Unified scaling entry — reactive (SMF) and proactive (scheduler) |
/api/check-upf | GET | Checks Running+Ready UPF pod for a given slice |
/api/scale/ack | POST | PFCP association + first PDU session confirmation from SMF |
/api/upf/disabled/done | POST | SMF callback — triggers full K8s resource cleanup |
/api/v1/upf-metrics | POST | UPF Agent telemetry push — enriched with K8s CPU/mem |
/active-ues | GET | Transparent proxy to SMF extended /active-ues |
/release-ue-sessions | POST | ACK for gradual session release during draining |
/metrics | GET | Prometheus scraping — 20 instrumented metrics |
/healthz | GET | Kubernetes liveness probe |
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.
Multi-stage — golang:1.24 (build) + debian:bookworm-slim (runtime) — static binary, CGO disabled.
8080 HTTP — Controller API + Prometheus /metrics
Controller repository: github.com/5gc-hybrid-upf-autoscaling-system/hybrid-controller
Full project: github.com/5gc-hybrid-upf-autoscaling-system
Content type
Image
Digest
sha256:75e422159…
Size
42.1 MB
Last updated
5 months ago
docker pull lpoclin/hybrid-controller:v2