karmada-io / karmada

Open, Multi-Cloud, Multi-Cluster Kubernetes Orchestration
https://karmada.io
Apache License 2.0
4.12k stars 807 forks source link

Register cluster with 'Pull' mode failde #4810

Open xuyongsan opened 3 weeks ago

xuyongsan commented 3 weeks ago

What happened: when I use 'Pull' mode to Register cluster according offficial guide(https://karmada.io/zh/docs/userguide/clustermanager/cluster-registration), register fail. What you expected to happen:

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

  1. In Karmada control plane, I use karmadactl token create command to successful create bootstrap tokens

    Create bootstrap tokens:

    karmadactl token create --print-register-command --kubeconfig /etc/karmada/karmada.kubeconfig

    The example output:

    karmadactl register 10.50.4.85:5443 --token d9dxml.oln5fcltzbvyxi98 --discovery-token-ca-cert-hash sha256:5a1e46b465208d1c9d48f68e98992c4cc2d78af9ae4b4b9e4457bc8a0453a283

  2. In member clusters control plane,I use the token to register

    Register karmada:

    karmadactl register 10.50.4.85:5443 --token d9dxml.oln5fcltzbvyxi98 --discovery-token-ca-cert-hash sha256:5a1e46b465208d1c9d48f68e98992c4cc2d78af9ae4b4b9e4457bc8a0453a283 --cluster-name member1 --kubeconfig=/root/.kube/config

    Return fail:

    [preflight] Running pre-flight checks [preflight] All pre-flight checks were passed [karmada-agent-start] Waiting to perform the TLS Bootstrap W0408 11:42:00.735750 27492 register.go:350] Failed to remove bootstrapKubeConfigFile: remove /etc/karmada/bootstrap-karmada-agent.conf: no such file or directory error: couldn't validate the identity of the API Server: Unauthorized

Anything else we need to know?:

Environment:

XiShanYongYe-Chang commented 3 weeks ago

Hi @lonelyCZ, can you help take a look? /cc @lonelyCZ