Repository navigation
fix: read ScaleToZero TAP stats via runtime RPC - #99
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ScaleToZero idle detection no longer fails with
Link not foundwhen 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/agentgo vet ./...go test ./...(controller package requires unavailable envtest binaries:/usr/local/kubebuilder/bin/etcdandbin/k8s)golangci-lint rungit diff --checkCloses #73.