Skip to content

fix: read ScaleToZero TAP stats via runtime RPC - #99

Merged
syscod3 merged 3 commits into
mainfrom
fix/runtime-link-stats
Sep 12, 2026
Merged

syscod3 merged 3 commits into
mainfrom
fix/runtime-link-stats

Conversation

@syscod3

@syscod3 syscod3 commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Summary

ScaleToZero idle detection no longer fails with Link not found when the agent and runtime use separate network namespaces. TAP byte counters are now read through the existing node-local runtime Unix-socket RPC, where the runtime performs the netlink lookup in the namespace that owns the TAP. The change keeps the existing injected unit-test seam and leaves ScaleToZero behavior, packet capture, and networking mutations unchanged.

Tests

  • go test ./internal/runtimeapi ./internal/noderuntime ./internal/agent
  • go vet ./...
  • go test ./... (controller package requires unavailable envtest binaries: /usr/local/kubebuilder/bin/etcd and bin/k8s)
  • golangci-lint run
  • git diff --check

Closes #73.

@syscod3
syscod3 merged commit 867ac97 into main Sep 12, 2026
16 checks passed
@syscod3
syscod3 deleted the fix/runtime-link-stats branch September 12, 2026 15:04
syscod3 added a commit that referenced this pull request Sep 24, 2026
The wake-on-traffic hook opened its AF_PACKET socket inside the agent pod.
The impbr-* bridges and VM TAPs live in the host network namespace (owned
by the runtime DaemonSet, hostNetwork: true), so the pod-side socket only
ever saw pod traffic (loopback, pod veths, Service IPs) — never the
overlay frames a suspended ScaleToZero VM must be woken by. The nightly
datapath E2E failure streak since 2026-08-29 shows it directly: framesSeen
increments while lastDstIP is always 10.244.x/10.96.x/127.0.0.1, never the
target VM's 10.45.0.x.

Mirror the PR #99 pattern used for TAP stats: capture on the runtime (host
netns) and expose it over the existing runtime RPC.

- runtimeapi: WakeHits backend method + RPC (drains observed destination IPs)
- noderuntime: host-netns AF_PACKET capture (ETH_P_ALL — preserved the
  ptype_all/br_handle_frame analysis; do not simplify to ETH_P_IP)
- agent: NewLinuxScaleToZeroWithRuntime now wires a runtimeWakeSource that
  polls WakeHits at interval/2 instead of opening a pod-side socket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(agent): read ScaleToZero TAP stats through runtime ownership

1 participant