feat(sandbox): inject host gateway hostAliases into sandbox pods#306
Merged
feat(sandbox): inject host gateway hostAliases into sandbox pods#306
Conversation
Sandbox pods running in the k3s cluster cannot resolve host.docker.internal by default, preventing them from reaching services on the Docker host. Detect the host gateway IP (default route) in the cluster entrypoint, thread it through the Helm chart to the gateway server, and inject hostAliases entries (host.docker.internal, host.openshell.internal) into every sandbox pod spec. The injection is conditional -- when the IP is empty (non-Docker deployments), no hostAliases are added.
89fe4a6 to
2846d1a
Compare
pimlock
approved these changes
Mar 14, 2026
drew
added a commit
that referenced
this pull request
Mar 16, 2026
* feat(sandbox): inject host gateway hostAliases into sandbox pods Sandbox pods running in the k3s cluster cannot resolve host.docker.internal by default, preventing them from reaching services on the Docker host. Detect the host gateway IP (default route) in the cluster entrypoint, thread it through the Helm chart to the gateway server, and inject hostAliases entries (host.docker.internal, host.openshell.internal) into every sandbox pod spec. The injection is conditional -- when the IP is empty (non-Docker deployments), no hostAliases are added. --------- Co-authored-by: Piotr Mlocek <pmlocek@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
host.docker.internalby default, preventing them from reaching services on the Docker host (e.g. local provider endpoints during development).SandboxClient→ sandbox pod spec.hostAliasesentries (host.docker.internal,host.openshell.internal) into every sandbox pod spec so processes inside sandboxes can resolve the Docker host.hostAliasesare added.Changes
deploy/docker/cluster-entrypoint.ship route; inject into HelmChart viaseddeploy/kube/manifests/openshell-helmchart.yamlhostGatewayIP: __HOST_GATEWAY_IP__placeholderdeploy/helm/openshell/values.yamlserver.hostGatewayIPdefaultdeploy/helm/openshell/templates/statefulset.yamlOPENSHELL_HOST_GATEWAY_IPenv varcrates/openshell-core/src/config.rshost_gateway_ipfield + builder methodcrates/openshell-server/src/main.rscrates/openshell-server/src/lib.rsSandboxClientcrates/openshell-server/src/sandbox/mod.rsSandboxClient; injecthostAliasesin both default and custom pod template pathsTest Plan
openshell-servertests passmise run pre-commitpasses (format, lint, check, all workspace tests)