# CoreDNS custom config for k3d clusters # Rewrites *.openchoreo.localhost, *.amp.localhost, *.agentmanager.localhost, # *.am-gateway.localhost and *.gateway.localhost hostnames to host.k3d.internal so # pods can reach services exposed via the k3d load balancer (including agent # endpoints and the AI gateway / LLM proxy vhost fronted by the data-plane gateway). apiVersion: v1 kind: ConfigMap metadata: name: coredns-custom namespace: kube-system data: openchoreo.override: | rewrite stop { name regex (.+\.)?openchoreo\.localhost host.k3d.internal answer auto } amp.override: | rewrite stop { name regex (.+\.)?amp\.localhost host.k3d.internal answer auto } # Data-plane default agent host (ClusterDataPlane gateway ingress host). The # "default" environment and any env that doesn't override the gateway host use # "-.agentmanager.localhost"; without this rewrite in-cluster lookups # fall through to loopback (127.0.0.1) and agent-to-agent calls fail. agentmanager.override: | rewrite stop { name regex (.+\.)?agentmanager\.localhost host.k3d.internal answer auto } # Agent gateway host advertised on Environment CRs (ENV_INGRESS_HOST in # add-environment.sh). Without this, in-cluster lookups of # "-.am-gateway.localhost" fall through to loopback (127.0.0.1), # breaking agent-to-agent calls through the gateway. Route them to the k3d # host so they hairpin back into the data-plane gateway on its published port. amgateway.override: | rewrite stop { name regex (.+\.)?am-gateway\.localhost host.k3d.internal answer auto } # AI gateway / LLM proxy vhost advertised on the data-plane gateway. The LLM # provider URL injected into agent pods uses "-.gateway.localhost" # (gateway.Vhost); without this rewrite in-cluster lookups fall through to # loopback (127.0.0.1) and the agent's calls to the LLM gateway are refused. # Routing to host.k3d.internal preserves the vhost Host header so Envoy routes # the request correctly (an in-cluster Service DNS name would not). gateway.override: | rewrite stop { name regex (.+\.)?gateway\.localhost host.k3d.internal answer auto } # The dev gateway chart + setup-gateway.sh reach agent-manager via # host.docker.internal (Docker Desktop / Colima inject it into k3d pods). # A plain Linux k3d runner (CI) has no such injection, so fold it onto # host.k3d.internal, which k3d guarantees on every platform. hostdocker.override: | rewrite stop { name regex host\.docker\.internal host.k3d.internal answer auto }