fix(kubelet-proxy): support IPv6 node service addresses by immanuwell · Pull Request #4169 · loft-sh/vcluster · GitHub
Skip to content

fix(kubelet-proxy): support IPv6 node service addresses - #4169

Open
immanuwell wants to merge 1 commit into
loft-sh:mainfrom
immanuwell:fix/ipv6-kubelet-host
Open

immanuwell wants to merge 1 commit into
loft-sh:mainfrom
immanuwell:fix/ipv6-kubelet-host

Conversation

@immanuwell

@immanuwell immanuwell commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

What issue type does this pull request address?
/kind bugfix

What does this pull request do? Which issues does it resolve?
IPv6 kubelet requests use hosts like [fd00::1234]:10250.
Splitting on : skips the node Service lookup, so metrics-server gets 403 Forbidden

This uses net.SplitHostPort and adds IPv4 and IPv6 regression tests

Reproduce in an IPv6-only Kind cluster: enable sync.fromHost.nodes.enabled and networking.advanced.proxyKubelets.byIP, install metrics-server, then run kubectl top nodes

Please provide a short message that should be published in the vcluster release notes
Fixed kubelet proxy routing for IPv6 node Service addresses.

What else do we need to know?
Tested with go test -race ./pkg/server/filters -count=1 and an IPv6-only Kind cluster.

E2E Tests

Additional test suites

Additional test suite(s) that will be executed before the mandatory PR suite:

none

@immanuwell
immanuwell requested a review from a team as a code owner September 6, 2026 12:00

@blacksoxx blacksoxx 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.

Thanks for the fix. I checked out the branch: go test ./pkg/server/filters/ is green, vet and gofmt are clean, and against main's nodename.go the IPv6 case of TestNodeNameFromIPHost fails with an empty node name while IPv4 passes, which is exactly the bug. net.SplitHostPort returns the address without the brackets, so both the IndexByHostName lookup on the virtual nodes and the IndexByClusterIP lookup on the node Services see the same form the objects store. A Host header without a port is skipped as before, since the old code required exactly two parts.

Looks good to me.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants