Skip to content

fix(devcontainer): use Kind's internal endpoint - #3668

Draft
pkothare wants to merge 2 commits into
kagent-dev:mainfrom
pkothare:fix/devcontainer-internal-endpoint
Draft

pkothare wants to merge 2 commits into
kagent-dev:mainfrom
pkothare:fix/devcontainer-internal-endpoint

Conversation

@pkothare

@pkothare pkothare commented Nov 13, 2026 •

Copy link
Copy Markdown

The devcontainer shares the host Docker daemon but has its own network namespace. Its loopback address therefore cannot reach the Kind API, causing kubectl setup to fail.

Use the internal endpoint only when the Docker daemon can inspect the devcontainer by hostname. In that case, connect it to the Docker kind network and export an internal kubeconfig. Share the endpoint check between setup-kind.sh and use-kind-cluster so both select the same address.

When the container is not visible to the daemon, as in Codespaces-style setups, keep the default loopback endpoint.

Validation:

  1. make open-dev-container completed successfully on Linux with Docker.
  2. postCreateCommand completed successfully in GitHub Codespace on initial setup.

The devcontainer shares the host's Docker daemon but has its own
network namespace. The Kind API's loopback address therefore points
back into the devcontainer, causing `kubectl` to fail during setup.

When enabled, connect the devcontainer to the Docker `kind` network
and export kubeconfig using Kind's internal endpoint. Make
`use-kind-cluster` request `--internal` too, so later kubeconfig
refreshes keep working.

Enable this only in `devcontainer.json`; when unset, host-based
workflows retain the default endpoint.

Signed-off-by: Pranav Kothare <kothare.pranav@gmail.com>
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Nov 13, 2026
Signed-off-by: Pranav Kothare <kothare.pranav@gmail.com>
@pkothare
pkothare force-pushed the fix/devcontainer-internal-endpoint branch from a5e9f3c to 088cacb Compare November 13, 2026 03:13
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant