Skip to content

Bug using the cli in hcp mode #1005

Description

@jp-gouin

Environmental Info:
Host Cluster Version:
2 nodes downstream clusters with RKE2 v1.33.5+rke2r1

K3K Cluster Configuration:
hcp mode virtual cluster with 1 control plane

Describe the bug:
When creating a virtual cluster using the cli and a host kubeconfig proxied by Rancher the tlsSan gets the Rancher host by default.
In hcp mode this is problematic as this SAN will be picked for the kubernetes endpoint.

When using the command:
k3kcli cluster create --mode hcp --tls-sans <downstream_node_ip> hcp-server

The created virtual cluster has the following tlsSANs

tlsSANs:
  - <rancher_endpoint>
  - <downstream_node_ip>

Which result of the following kubernetes endpoint declaration inside the hcp virtual cluster

kubectl --kubeconfig ./kconfig.yaml -n default get endpointslice kubernetes -o wide
NAME         ADDRESSTYPE   PORTS   ENDPOINTS            AGE
kubernetes   IPv4          32195   <rancher_endpoint>   38m
kubectl --kubeconfig ./kconfig.yaml -n default get endpoints kubernetes -o wide
Warning: v1 Endpoints is deprecated in v1.33+; use discovery.k8s.io/v1 EndpointSlice
NAME         ENDPOINTS                   AGE
kubernetes    <rancher_endpoint>:32195   38m

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghcp

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions