Skip to content

Add host override capability to aid in tunnel scenarios#147

Draft
xrstf wants to merge 3 commits intokcp-dev:mainfrom
xrstf:host-override
Draft

Add host override capability to aid in tunnel scenarios#147
xrstf wants to merge 3 commits intokcp-dev:mainfrom
xrstf:host-override

Conversation

@xrstf
Copy link
Contributor

@xrstf xrstf commented Mar 10, 2026

Summary

Sometimes the agent might get access to kcp through tunneling or other advanced routing network magic. In this case, the URL in its kubeconfig might point to localhost on a random port. However when the agent then watches an APIExportEndpointSlice and tries to connect to it, it would only have the kcp-provided URLs for the VW endpoints. URLs which might not be directly accessible.

This PR adds a new CLI flag, --apiexport-hostport-override, which allows to configure multiple host overrides that are applied to the URLs in the APIExportEndpointSlice status. For example ./api-syncagent --apiexport-hostport-override "example.com=localhost:8445 would rewrite all virtual workspace endpoint URLs from example.com to localhost:8445. I chose to allow multiple overrides so that in complex deployment scenarios where you deploy many agents, you don't necessarily need to figure out which override is relevant to which agent, but can just give all agents the same flags, and they will use whatever matches.

What Type of PR Is This?

/kind feature

Related Issue(s)

Fixes #146

Release Notes

Add `--apiexport-hostport-override` flag to override hostnames in APIExportEndpointSlices

xrstf added 3 commits March 9, 2026 16:32
On-behalf-of: @SAP christoph.mewes@sap.com
On-behalf-of: @SAP christoph.mewes@sap.com
@kcp-ci-bot kcp-ci-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Mar 10, 2026
@kcp-ci-bot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kcp-ci-bot kcp-ci-bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Mar 10, 2026
@kcp-ci-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign xrstf for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@kcp-ci-bot kcp-ci-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: host override for virtual workspace URLs

2 participants