Repository navigation
Can an agent join a server by hostname (SNI) through an SNI-routing proxy? (k3k HCP use case) #14949
|
Hi, everyone I’m running k3s control planes as pods using k3k in hcp mode, and letting users bring their own VMs as worker nodes. I’d like each worker to join by domain name, e.g. K3S_URL=https://k3s-c1.mywork.com, with many control planes sitting behind one IP:443 and routed by hostname (Cilium Ingress with TLS passthrough). It doesn’t work. This is the log. failed to get CA certs: Get "https://127.0.0.1:6444/cacerts": EOF It is like "The agent goes through the local load balancer at 127.0.0.1:6444, so the TLS ClientHello has no SNI, and the proxy can’t pick a backend". root@k3s-worker:~# curl -k https://k3s-c1.mywork.com/version So right now my only option without a LoadBalancer IP per cluster is a NodePort per cluster, reserved on every node of the host cluster. That works, but a hostname would be much nicer for a multi-tenant setup. One questions: Is there any supported way today for the agent to send the --server hostname as SNI when dialing through the local LB? Thanks for your time. Here is the yaml file and the command for joining VM agent. ======================= ======================== To join as agent ======================== Error log Nov 02 13:07:13 k3s-worker k3s[6493]: time="2026-11-02T13:07:13Z" level=error msg="Failed to validate connection to cluster at https://k3s-c1.mywork.com: failed to get CA certs: Get "https://127.0.0.1:6444/cacerts\": EOF"
======================== But if I use NodePort, everything works as expect. apiVersion: k3k.io/v1beta1 And joining the cluster as curl -sfL https://get.k3s.io |
|
Replies: 2 comments 1 reply
|
Yes. Add |
|
Thank you @g4lb , it works! I spent a few days on this. Thanks again. |


Yes. Add
--disable-apiserver-lb(experimental) to the agent. It then dialshttps://k3s-c1.mywork.comdirectly, so the ClientHello has SNI. Go sends no SNI to127.0.0.1