Skip to content

fix(cni): pin the OTLP endpoint to the collector's ClusterIP so the host-resolver plugin can export (#950) - #969

Merged
bpalermo merged 2 commits into
mainfrom
fix/cni-otlp-host-resolver
Sep 26, 2026
Merged

bpalermo merged 2 commits into
mainfrom
fix/cni-otlp-host-resolver

Conversation

@bpalermo

Copy link
Copy Markdown
Owner

Closes #950. Draft until the new e2e/uds.sh assertion has run on kind.

The CNI plugin runs under the HOST resolver, so otel-collector.o11y.svc.cluster.local:4317 never resolved on Talos ("name resolver error: produced zero addresses") and no aether_cni_* series ever existed — including aether_cni_operations_total{operation="capture_divert",result="error"}, the only signal that a pod started uncaptured (#947).

What

  • cni-install (which runs in the agent pod, ClusterFirstWithHostNet, so it CAN resolve Services) resolves the endpoint's host once (5 s timeout) and writes <ClusterIP>:4317 into the netconf; the plugin then dials an IP that kube-proxy makes reachable from the host. Unchanged when the endpoint is empty, already an IP, portless, or unresolvable (old behaviour). Several answers → lowest address, IPv4 first, deterministic bytes; a headless Service gets a warning. Plaintext OTLP gRPC as before, so no TLS name to preserve. Flag --otlp-pin-endpoint (default true).
  • Chart 0.95.1: cniInstall.otlpEndpoint (CNI-only override of otel.endpoint) and cniInstall.pinOTLPEndpoint.
  • cni/internal/telemetry: flush failures log at WARN, not DEBUG.
  • Known gap, documented in values/configuration/soak README: the IP is fixed at agent start; a collector Service recreated later keeps the stale value until the next agent roll (the conflist re-assert loop re-appends, it does not re-resolve).

Gates

gate red state
TestPinOTLPEndpoint (9 cases) + TestCreateCNIConfigFilePinsTheOTLPEndpoint stub returning the endpoint unchanged → 6 subtests red (expected "10.96.12.34:4317", actual "otel-collector.o11y.svc.cluster.local:4317")
TestOTLPPinDefaultsOn flag absent → "--otlp-pin-endpoint must be registered"
aether_cni_otlp_pin_test, aether_cni_otlp_override_test (helm_template_test) template/values reverted → "does not contain the pattern"
e2e/uds.sh assertion f (verify_cni_telemetry): conflist otlp_endpoint == <ClusterIP>:4317 on the kind node, collector debug log shows aether.cni.operations within 60 s of a pause-pod ADD/DEL, plugin log has no produced zero addresses not yet run — the kind node's resolver (docker 127.0.0.11) cannot resolve cluster.local, the same situation as Talos; up now deploys a collector in o11y and points only the CNI at it

Not run: the kind e2e (queued now), anything on talos, --config=race.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr

@bpalermo

Copy link
Copy Markdown
Owner Author

Kind run 2026-09-26 22:06–22:16Z on uds (twice): all pre-existing assertions green; assertion f green after one fix to the assertion itself — its kubectl logs | grep -q was a pipefail false negative (grep -q's early exit SIGPIPEs kubectl, rc 141) while the collector's debug log already carried aether.cni.operations at every plugin ADD/DEL. The export itself worked on the first run: netconf pinned to <ClusterIP>:4317, Metrics batches from service.name=aether-cni at each ADD/DEL, no resolver errors in the plugin log. Un-drafting.

@bpalermo
bpalermo marked this pull request as ready for review September 26, 2026 22:17
bpalermo and others added 2 commits September 26, 2026 20:37
…#950)

The CNI plugin binary is exec'd by the container runtime on the HOST, under
the host's resolver, which cannot resolve cluster Service names on Talos (or
kind). Every flush failed with "name resolver error: produced zero addresses"
and no aether_cni_* series ever existed in Prometheus -- including the
capture_divert error counter (#947), the only non-log signal of a pod that
started uncaptured.

cni-install runs in the agent pod (dnsPolicy ClusterFirstWithHostNet), so it
resolves the endpoint's host through cluster DNS and writes "<ClusterIP>:port"
into the netconf (--otlp-pin-endpoint, default true). Addresses, empty
endpoints and names that fail to resolve are written unchanged (the pre-#950
behaviour). Multiple answers pin deterministically (lowest, IPv4 first). The
transport is unchanged: plaintext OTLP gRPC, so no TLS server name to keep.

Chart 0.95.1: cniInstall.pinOTLPEndpoint (default true) and
cniInstall.otlpEndpoint (overrides otel.endpoint for the CNI alone). Flush
failures are logged at WARN instead of DEBUG.

Gates: install_test (pin + netconf render), cmd_test (flag default),
aether_cni_otlp_{pin,override}_test (chart argv), and e2e/uds.sh assertion f:
an OTLP collector at otel-collector.o11y.svc.cluster.local must receive
aether.cni.operations after a pod ADD on kind, whose node resolver cannot
resolve cluster names either.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
…(pipefail SIGPIPE false negative)

The first kind run of assertion f stayed red for 60s while the collector's
debug log already carried aether.cni.operations: under set -o pipefail,
grep -q's early exit SIGPIPEs kubectl logs and the pipeline reports failure
(rc 141) even though the metric matched. Grep a captured string instead.
Seen: rc=141 on the exact pipeline against the live cluster; green after.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
@bpalermo
bpalermo force-pushed the fix/cni-otlp-host-resolver branch from 7cf4891 to ced0c23 Compare September 26, 2026 23:37
@bpalermo
bpalermo merged commit b3baabd into main Sep 26, 2026
24 checks passed
@bpalermo
bpalermo deleted the fix/cni-otlp-host-resolver branch September 26, 2026 23:46
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.

CNI plugin OTLP metrics never reach Prometheus on talos-main: host resolver cannot resolve the collector's cluster DNS name

1 participant