Skip to content

pull mode attempts to connect to karmada control plane via karmada-apiserver.karmada-system.svc.cluster.local #6865

@ssenecal-modular

Description

@ssenecal-modular
# karmadactl register karmada.example.com:5443 --token ***REDACTED***--discovery-token-ca-cert-hash sha256:***REDACTED*** --cluster-name=my-cluster
[preflight] Running pre-flight checks
[preflight] All pre-flight checks were passed
[karmada-agent-start] Waiting to perform the TLS Bootstrap
Unable to connect to the server: dial tcp: lookup karmada-apiserver.karmada-system.svc.cluster.local on 127.0.0.53:53: no such host

Despite the register command being given the API endpoint of karmada.example.com:5443, the command persists in attempting to connect to karmada-apiserver.karmada-system.svc.cluster.local instead, which is not resolvable because the 2 clusters are not in the same network.

It looks like there was a previous attempt to address this in #4562 but it appears that perhaps that fix was incomplete as there is another place in the code that references the cluster info and ignores the user provided one.

What you expected to happen:
register should always use the user-provided API endpoint

How to reproduce it (as minimally and precisely as possible):

  1. deploy karmada in cluster A with load balancer pointing to karmada.example.com
  2. generate a token for setting up a pull mode cluster:
karmadactl token create --print-register-command=true
  1. attempt to run the ccommand from cluster B:
karmadactl register karmada.example.com:5443 --token ***REDACTED***--discovery-token-ca-cert-hash sha256:***REDACTED*** --cluster-name=my-cluster

Environment:

  • Karmada version: 1.15.0
  • kubectl-karmada or karmadactl version (the result of kubectl-karmada version or karmadactl version): 1.15.1, tried using build from master as well)
  • Others:

Metadata

Metadata

Labels

kind/bugCategorizes issue or PR as related to a bug.

Type

No type

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions