Add host override capability to aid in tunnel scenarios#147
Add host override capability to aid in tunnel scenarios#147xrstf wants to merge 3 commits intokcp-dev:mainfrom
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
PR needs rebase. DetailsInstructions 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. |
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:8445would rewrite all virtual workspace endpoint URLs fromexample.comtolocalhost: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