Skip to content

fix(agents-login): strip AAAA via CoreDNS sidecar so codex sign-in uses IPv4#746

Merged
ExtraToast merged 1 commit into
mainfrom
fix/agents-login-codex-filter-aaaa
Jun 27, 2026
Merged

fix(agents-login): strip AAAA via CoreDNS sidecar so codex sign-in uses IPv4#746
ExtraToast merged 1 commit into
mainfrom
fix/agents-login-codex-filter-aaaa

Conversation

@ExtraToast

Copy link
Copy Markdown
Owner

Why the prior two attempts failed

Definitive fix

A per-pod CoreDNS sidecar that answers AAAA with NODATA (template IN AAAA . { rcode NOERROR }) and forwards everything else to kube-dns (10.43.0.10). The pod uses dnsPolicy: None + dnsConfig127.0.0.1, preserving cluster search domains + ndots:5. With no AAAA ever returned, codex resolves only IPv4 (which has working egress) — resolver-agnostic, regardless of codex bypassing libc. Replaces the ineffective #745 init container.

Validation

Needs a real deploy (sandbox can't reach the cluster). After Flux reconciles I'll verify: AAAA→NODATA, A still resolves (incl. cluster names), and codex login --device-auth reaches the user-code step. Runtime codex in agent-runner needs the same — separate follow-up.

🤖 Generated with Claude Code

…uses IPv4

The /etc/hosts init container (#745) and gai.conf (#742) were both ineffective:
codex's musl-static Rust client ignores /etc/hosts and /etc/gai.conf, and a hosts
A-record doesn't suppress the DNS AAAA — so codex still resolved auth.openai.com's
IPv6, tried it, and failed (no IPv6 egress, no IPv4 fallback). Confirmed live:
even with the IPv4 hosts pin, `getent hosts auth.openai.com` returned the DNS IPv6
and `codex login --device-auth` still exited 1.

Replace that approach with a per-pod CoreDNS sidecar that answers AAAA with NODATA
(`template IN AAAA . { rcode NOERROR }`) and forwards everything else to kube-dns
(10.43.0.10). Point the pod at it via dnsPolicy: None + dnsConfig nameserver
127.0.0.1, preserving the cluster search domains + ndots. With no AAAA ever
returned, codex resolves only IPv4 (which has working egress). Resolver-agnostic —
works regardless of codex bypassing libc.

Needs live deploy validation (sandbox can't reach the cluster). Runtime codex in
the agent-runner needs the same treatment separately.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ExtraToast ExtraToast merged commit 1e619a5 into main Jun 27, 2026
22 checks passed
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.

1 participant