Skip to content

Route OTEL collector around authbridge sidecar via skip_hosts#45

Open
yoavkatz wants to merge 1 commit into
rossoctl:mainfrom
yoavkatz:fix/authbridge-otel-skip-hosts
Open

Route OTEL collector around authbridge sidecar via skip_hosts#45
yoavkatz wants to merge 1 commit into
rossoctl:mainfrom
yoavkatz:fix/authbridge-otel-skip-hosts

Conversation

@yoavkatz

Copy link
Copy Markdown
Contributor

Problem

Agent pods crash-loop with a misleading "OTEL is enabled but collector is not reachable: Protocol mismatch" error (#34). The collector is actually healthy — the real cause is that the agent's OTLP egress is forced through the authbridge sidecar, which isn't configured to route the collector host and resets the connection. The exgentic library misreports the reset ([Errno 104] Connection reset by peer) as a protocol/reachability problem and the agent exits 1 → CrashLoopBackOff.

Changes

deploy-agent.sh — bake OTEL-collector skip_hosts into the namespace authbridge base (authbridge-runtime-config) before the agent is created, so the sidecar has it from first pod boot — no post-deploy patch of the running agent, no reload race.

  • The operator webhook force-overwrites per-agent ConfigMaps (server-side apply, ForceOwnership), so a per-agent pre-seed can't survive. It does honor the namespace-level base and merges config.yaml into each per-agent CM, so a listener.skip_hosts added here rides through untouched.
  • The merge is idempotent (union + sort + de-dupe → byte-stable re-runs) and guarded on PyYAML availability and the base ConfigMap existing.

authbridge/wait-for-reload.sh — during a rollout, probe every sidecar-bearing pod each poll and succeed as soon as any reports the target SHA, instead of assuming .items[0].

  • The old assumption often picked the old/terminating or agent-only pod and either found no sidecar at all or waited forever on a config that would never advance. Success is now defined as "some sidecar reports the target SHA", so the converged pod wins regardless of list order.

Notes

  • skip_hosts is an AuthBridge-binary listener key; it is not defined in operator source and has not been verified against the sidecar's config schema. If the sidecar rejects the merged config, a reload failed / parse error will appear in the sidecar container logs — the key name/shape may need correcting. This is documented inline.

Fixes #34

Agent pods crash-loop with a misleading "OTEL is enabled but collector
is not reachable: Protocol mismatch" error. The real cause is that the
agent's OTLP egress is forced through the authbridge sidecar, which is
not configured to route the collector host and resets the connection.
The exgentic library then misreports the reset as a protocol/reachability
problem and exits 1 → CrashLoopBackOff.

deploy-agent.sh: bake OTEL-collector skip_hosts into the namespace
authbridge base (authbridge-runtime-config) BEFORE the agent is created,
so the sidecar has it from first pod boot — no post-deploy patch, no
reload race. The operator webhook force-overwrites per-agent ConfigMaps
but honors the namespace base and merges it into each per-agent CM, so a
listener.skip_hosts added here rides through untouched. The merge is
idempotent (union + sort + de-dupe) for byte-stable re-runs.

wait-for-reload.sh: during a rollout, probe every sidecar-bearing pod
each poll and succeed as soon as any reports the target SHA, instead of
assuming .items[0]. The old assumption often picked the old/terminating
or agent-only pod and either found no sidecar or waited forever on a
config that would never advance.

Fixes rossoctl#34

Signed-off-by: Yoav Katz <katz@il.ibm.com>
@kellyaa

kellyaa commented Jul 24, 2026

Copy link
Copy Markdown
Member

Tested locally and works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants