Architecture: The 10G eBPF Edge with OPNsense & Istio-Ready Cilium DSR
Achieve maximum 10G throughput. Learn how to configure Cilium with Native Routing and DSR for real client IP preservation and enterprise-grade observability.
In a high-performance compute (HPC) cluster, the goal is to reduce the "cost per packet". Standard Kubernetes networking relies on legacy iptables and packet encapsulation, which adds latency and hides the truth.
My current setup moves the entire networking logic into the kernel via eBPF, utilizing** Native Routing and Direct Server Return (DSR) to achieve maximum throughput on a 10G bond, while hardening the perimeter with OPNsense**.
The Datapath: Native Routing on a 10G Bond
Instead of using VXLAN or Geneve tunnels, which wrap every packet in an extra layer of metadata, I use Native Routing.
- Hardware: I utilize a 10G bonded interface (
nm-bond) running on** Rocky Linux**. - eBPF Logic: Cilium acts as a full** kube-proxy replacement**, handling routing at the eBPF layer to jump packets directly from the physical NIC into the pod's network namespace.
- The CIDR: By defining a surgical native routing range (
10.x.y.0/16), the cluster knows exactly which traffic can be "fast-pathed" without translation.
The Load Balancer: Direct Server Return (DSR)
The "Holy Grail" of ingress performance is DSR.
- Request: Traffic hits the** MetalLB external IP on the bond, where Cilium’s eBPF program forwards it to the Nginx pod without changing the source IP**.
- Processing:** Nginx + ModSecurity** sees the real client IP (e.g.,
174.x.x.x) immediately, ensuring accurate logging and WAF triggers. - The Short-Circuit: The pod sends the response** directly back to the client**, bypassing the node's NAT engine entirely and reducing latency by roughly 50% on the return path.
Identity-Aware Observability (Hubble)
By moving the External Nginx Ingress from a hostNetwork configuration into a standard Pod network, I’ve unlocked full L4/L7 visibility without losing the Real IP.
- Security Identities: Every pod now has a unique** Cilium Identity ID**.
- The Hubble UI: Instead of traffic being buried in a generic "Host" icon, the UI now renders distinct service maps for the external ingress and other application engines.
The Hubble UI provides more than a static architectural overview; it offers a real-time, identity-aware network graph of the active cluster datapath. By inspecting traffic at the eBPF layer, it visualizes the exact flow of packets across each namespace with sub-millisecond precision.

Sub-ms precision Hubble UI Graph
The Edge: OPNsense + CrowdSec
- Behavioral Protection: If someone triggers** ModSecurity rules too many times, CrowdSec** on OPNsense detects the attack pattern.
- The 24h Ban: Malicious IPs are banned at the OPNsense level for exactly** 24 hours**.
- Direct eBPF Synergy: Since** Cilium DSR preserves the True Source IP**, OPNsense can ban the actual attacker at the firewall level before the packet even touches the nodes.
Strategic Transition: Preparing for Istio/Envoy
With the community ingress-nginx project hitting End-of-Life (EOL) in March 2026, this architecture is built specifically for the move to** Istio/Envoy**.
- Why Istio?: The community
ingress-nginxis stagnant;** Istio/Envoy represents the future of the Gateway API**. - The Foundation: Moving to Pod-based networking and Native Routing satisfies the critical dependencies for Istio.
- The Future: Replacing Nginx with an** Istio Ingress Gateway will provide SPIRE/Citadel** for mTLS and deeper identity-based observability on the high-speed eBPF highway I've already built.
Cilium Configuration (Infrastructure as Code)
This YAML represents the realization of the strategy discussed above:
dsrDispatch: opt: Tells Cilium to use a specific IP option to carry service information, allowing the** 10G bond** to handle return traffic with zero NAT overhead.hostNamespaceOnly: true: This is a future-proofing flag ensuring Cilium's socket-level load balancing doesn't interfere with** Envoy sidecars** during the Istio migration.SYS_RESOURCE: Essential for** Rocky Linux** to bypass default memory locking limits, ensuring eBPF maps for software flows never hit a ceiling.
cluster:
name: kubernetes
# --- 1. The HPC Datapath (Native Routing + DSR) ---
routingMode: native
ipv4NativeRoutingCIDR: "10.x.y.0/16"
ipam:
mode: "cluster-pool"
operator:
clusterPoolIPv4PodCIDRList: ["10.x.y.0/16"]
loadBalancer:
mode: dsr
dsrDispatch: opt # Optimized for 10G; uses IP options to bypass NAT
# --- 2. Node & Performance Tuning ---
kubeProxyReplacement: "true"
bpf:
masquerade: true
tproxy: true # Future-proofing for Istio/Envoy
hostRouting: true # Native eBPF bypass of host network stack
monitorAggregation: medium
bandwidthManager:
enabled: true
bbr: true # Modern TCP congestion control for your high-speed link
devices: "nm-bond"
# --- 3. Rocky Linux / Kernel Compatibility ---
containerRuntime:
setMemlockUnlimited: true
daemonSet:
containerSecurityContext:
privileged: true
capabilities:
add:
- SYS_RESOURCE # Critical for Rocky Linux memory limits
- NET_ADMIN
- SYS_ADMIN
- BPF
- PERFMON
# --- 4. Hubble Observability (Production Grade) ---
hubble:
enabled: true
maxFlows: 65535 # Higher capacity for 10G traffic bursts
relay:
enabled: true
ui:
enabled: true
service:
type: LoadBalancer
# Resources tuned for your 32-core node
resources:
limits:
cpu: 1000m
memory: 1024Mi
# --- 5. Service Mesh (Istio) Readiness ---
socketLB:
enabled: true
hostNamespaceOnly: true # Prevents conflicts with Istio sidecars
cni:
exclusive: false # Allows Istio-CNI coexistence
Installation Steps:
helm repo add cilium https://helm.cilium.io/
helm repo update
helm upgrade cilium cilium/cilium \
--namespace kube-system \
--version 1.19.1 \
--values cilium.values.yaml \
--reset-values \
--wait
The Performance Verdict: Why I Moved to a 10G eBPF Architecture
Moving from a standard VXLAN overlay to an eBPF-Native + DSR architecture wasn't just a minor configuration change; it was a complete removal of the "network tax" typically paid in Kubernetes. In my high-throughput 10G bond environment, here is the impact I've seen:
1. Latency: The "Tunnel Tax" is Gone
By removing VXLAN, I eliminated the CPU-intensive process of wrapping every packet in a 50-byte UDP header.
- The VXLAN Penalty: Standard overlays add significant microsecond delays for every packet as the kernel performs encapsulation and decapsulation.
- The eBPF Speed: Native routing jumps packets from my physical NIC directly to the pod. I’ve seen P99 latency drops of** 30% to 40%** compared to standard tunneling (moving from ~1.2ms down to ~0.8ms).
2. Throughput: Full 10G Saturation
Encapsulation steals part of your "Maximum Transmission Unit" (MTU).
- Payload Recovery: VXLAN reduces available payload from 1500 bytes to 1450 bytes. By going native, I recovered those** 50 bytes per packet**.
- The Math: On a saturated 10G link, that 3.3% header overhead adds up to hundreds of megabits per second in wasted bandwidth. With Native Routing, my data streams now utilize the full capacity of the wire with zero fragmentation.
3. DSR: The Return-Path "Short Circuit"
External traffic (Ingress) usually suffers from a "double-hop" where the return packet must travel back through the entry node.
- The Advantage: With** Direct Server Return (DSR)**, the backend pod replies directly to the client gateway.
- The Result: This bypasses the node's NAT engine entirely on the way out, effectively** halving the network processing hops** for every response. For my high-traffic Nginx instance, this results in a significantly lower "Time to First Byte" (TTFB).

Direct Server Return (DSR) w/ Cilium eBPF
Field Log Discussion
Public @handle only · Private email hidden · Fenced code blocks supported
Join the architecture review under a self-chosen @handle. Your email address is never displayed publicly.
Loading discussion notes...