Skip to content

feat: add CLUSTER_DOMAIN environment variable to the agent sandbox ro…#803

Merged
k8s-ci-robot merged 1 commit into
kubernetes-sigs:mainfrom
patcrombie:pat/feat/add-cluster-domain-env-var-to-sandbox-router
May 15, 2026
Merged

feat: add CLUSTER_DOMAIN environment variable to the agent sandbox ro…#803
k8s-ci-robot merged 1 commit into
kubernetes-sigs:mainfrom
patcrombie:pat/feat/add-cluster-domain-env-var-to-sandbox-router

Conversation

@patcrombie

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

These changes add an optional CLUSTER_DOMAIN environment variable to the sandbox router app. Some Kubernetes clusters have custom cluster domains that differ from the default cluster.local. The sandbox router won't work in these clusters becasue can't correctly build the target_url it needs to route requests to sandboxes. These changes allow a user to set the CLUSTER_DOMAIN environment variable and for the sandbox router to able to correctly proxy requests in clusters when this domain is not cluster.local

Which issue(s) this PR is related to:

Release Note

@linux-foundation-easycla

linux-foundation-easycla Bot commented May 14, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: patcrombie / name: Pat Crombie (8488e8b)

@netlify

netlify Bot commented May 14, 2026

Copy link
Copy Markdown

Deploy Preview for agent-sandbox canceled.

Name Link
🔨 Latest commit b86eaef
🔍 Latest deploy log https://app.netlify.com/projects/agent-sandbox/deploys/6a0654a7b17d4e0008762771
@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label May 14, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Welcome @patcrombie!

It looks like this is your first PR to kubernetes-sigs/agent-sandbox 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/agent-sandbox has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 14, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Hi @patcrombie. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels May 14, 2026
@janetkuo janetkuo requested a review from Copilot May 14, 2026 04:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for non-default Kubernetes cluster DNS domains in the sandbox-router by introducing an optional CLUSTER_DOMAIN environment variable used when constructing the in-cluster target URL for proxied requests.

Changes:

  • New _get_cluster_domain() helper and DEFAULT_CLUSTER_DOMAIN = "cluster.local" constant.
  • proxy_request now builds target_host using the resolved cluster domain instead of a hard-coded cluster.local.
  • Unit tests covering default value, env-var override, empty-string fallback, and target URL construction with a custom domain.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
clients/python/agentic-sandbox-client/sandbox-router/sandbox_router.py Adds CLUSTER_DOMAIN env-var support and uses it when building the proxy target host.
clients/python/agentic-sandbox-client/sandbox-router/test_sandbox_router.py Adds tests for the new helper and for target URL construction with a custom cluster domain.
Comment thread clients/python/agentic-sandbox-client/sandbox-router/sandbox_router.py Outdated
@barney-s

Copy link
Copy Markdown
Collaborator

/approve
/lgtm

please resolve the merge conflicts @patcrombie

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 14, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: barney-s, patcrombie

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels May 14, 2026
…uter

These changes add an optional CLUSTER_DOMAIN environment variable to the sandbox router app. Some Kubernetes clusters have custom cluster domains that differ from the default `cluster.local`. The sandbox router won't work in these clusters becasue can't correctly build the `target_url` it needs to route requests to sandboxes. These changes allow a user to set the `CLUSTER_DOMAIN` environment variable and for the sandbox router to able to correctly proxy requests in clusters when this domain is not `cluster.local`
@patcrombie patcrombie force-pushed the pat/feat/add-cluster-domain-env-var-to-sandbox-router branch from e217cad to b86eaef Compare May 14, 2026 23:03
@k8s-ci-robot k8s-ci-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels May 14, 2026
@barney-s

Copy link
Copy Markdown
Collaborator

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 15, 2026
@barney-s

Copy link
Copy Markdown
Collaborator

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 15, 2026
@k8s-ci-robot k8s-ci-robot merged commit 815864a into kubernetes-sigs:main May 15, 2026
10 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Agent Sandbox May 15, 2026
khirotaka pushed a commit to khirotaka/agent-sandbox that referenced this pull request Jun 12, 2026
…uter (kubernetes-sigs#803)

These changes add an optional CLUSTER_DOMAIN environment variable to the sandbox router app. Some Kubernetes clusters have custom cluster domains that differ from the default `cluster.local`. The sandbox router won't work in these clusters becasue can't correctly build the `target_url` it needs to route requests to sandboxes. These changes allow a user to set the `CLUSTER_DOMAIN` environment variable and for the sandbox router to able to correctly proxy requests in clusters when this domain is not `cluster.local`
alexatakvelon pushed a commit to volatilemolotov/agent-sandbox that referenced this pull request Jun 24, 2026
…uter (kubernetes-sigs#803)

These changes add an optional CLUSTER_DOMAIN environment variable to the sandbox router app. Some Kubernetes clusters have custom cluster domains that differ from the default `cluster.local`. The sandbox router won't work in these clusters becasue can't correctly build the `target_url` it needs to route requests to sandboxes. These changes allow a user to set the `CLUSTER_DOMAIN` environment variable and for the sandbox router to able to correctly proxy requests in clusters when this domain is not `cluster.local`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. ready-for-review size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

5 participants