Skip to content

IPv6 control-plane endpoint: join URL is not bracketed #1565

Description

@Zyplonox

What happened?

Workers never join when the control-plane Service has an IPv6 LoadBalancer address:

unable to create certificates signing request client: host must be a URL or a host:port pair: "https://xxxx:xxxx:11:1103:t::3:443"

internal/controller/bootstrap/worker_bootstrap_controller.go:532 (also :534, and
controlplane_bootstrap_controller.go:698 and :710) build the URL with
fmt.Sprintf("https://%s:%d", host, port). An IPv6 literal needs brackets —
net.JoinHostPort adds them, which is what k0s does in pkg/apis/k0s/v1beta1/api.go.

The endpoint itself is fine: curl -sk 'https://[https://xxxx:xxxx:11:1103:t::3]/version' → 401.

Involved Areas

Cluster API integration

What did you expect to happen?

The worker joins. The join URL has to be https://[https://xxxx:xxxx:11:1103:t::3]:443 — an IPv6 literal in a URL needs brackets.

Steps to reproduce

  1. Dual-stack management cluster with an IPv6 LoadBalancer pool (MetalLB here).
  2. K0smotronControlPlane with service.type: LoadBalancer, apiPort 443, and a Service that ends up single-stack IPv6, so the VIP is an IPv6 address.
  3. Create a worker Machine.
    The control plane comes up and answers on https://[]:443, the worker aborts while bootstrapping the kubelet.

k0smotron version

2.0.4

k0s version

1.36.2+k0s.0

Anything else we need to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions