karmada
karmada copied to clipboard
Unable to join kind cluster to karmada control plane because of failing to get serviceAccount
What happened:
I deployed karmada env with hack/local-up-karmada.sh successfuly. As it is expected, three member1, member2, and member3 have been created.
Then I just tried to join a simple kind cluster with only one control plane to the federation in push mode by running:
kubectl karmada join kind-kind --kubeconfig=$HOME/.kube/karmada.config --karmada-context=karmada --cluster-kubeconfig=$HOME/.kube/members.config --cluster-context=kind-kind
and then got this error:
Error: failed to get serviceAccount secret from cluster(kind-kind), error: failed to get serviceAccount secret, error: no specific secret found in namespace: karmada-cluster
What you expected to happen: I was expected be able to join kind-kind cluster to the karmada control plane.
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
I also checked for kind-kind cluster client-certificate-data and client-key-data. They are available in $HOME/.kube/members.config
Environment:
- Karmada version:
- kubectl-karmada or karmadactl version (the result of
kubectl-karmada versionorkarmadactl version):kubectl karmada version: version.Info{GitVersion:"v1.2.1", GitTreeState:"clean", BuildDate:"2022-07-14T09:33:32Z", GoVersion:"go1.17.11", Compiler:"gc", Platform:"linux/amd64"} - Others:
Hi @Fatimastm could you please tell us the following information:
- Which Karmada version you are using?
- What's the Kubernetes version of the
kind-kindcluster?
With this information, I can try to reproduce it on my side.
I think the issue has been resolved by #1972, maybe you can try with karmadactl(or kubectl-karmada)@v1.2.2.
By the way, what's the endpoint of the kind-kind cluster? Does it use a localhost address? Like server: https://127.0.0.1:37519.
Just a reminder, karmadactl can join a cluster with localhost endpoint, but after the joining process, Karmada control plane may not connect to the cluster.
It is recommended to create a kind cluster by hack/create-cluster.sh, this create will uses a docker IP for kind cluster.
Hi @RainbowMango.
- Which Karmada version you are using? v1.2
- What's the Kubernetes version of the kind-kind cluster? v0.16.0
It is worth to mention that, I installed the kind in docker after karmada installation because kind was not insatalled automatically with hack/local-up-karmada.sh.
The endpoint of the kind-kind is like server:https://127.0.0.1:37519 and is differenet with the endpoint of karmada member clusters.
Since I want to add a new kind cluster to the federation, do you recommend first create a new single cluster with hack/create-cluster.sh and then with kubectl karmada join, join it to karmada control plane?
It is worst to mention that, I installed the kind in docker after karmada installation because kind was not insatlled automaticaly with hack/local-up-karmada.sh.
I don't get it. You can start the kind cluster before or after Karmada installation.
Since I want to add a new kind cluster to the federation, do you recommend first create a new single cluster with hack/create-cluster.sh and then with kubectl karmada join, join it to karmada control plane?
Yes, the reason why I recommend to use hack/create-cluster.sh to create kind cluster is this script will replace the endpoint of the kind cluster.
Any way, can you try again with karmadactl v1.2.2?
Any way, can you try again with karmadactl
v1.2.2
Yes. Thanks @RainbowMango. By upgrading kubectl karmada version, I was able to join my cluster tothe karmada control plane.
However after 5 minutes has not been ready kind-kind Push False 5m10s.
However after 5 minutes has not been ready kind-kind Push False 5m10s.
Is the kind-kind created by hack/create-cluster.sh?
Is the
kind-kindcreated byhack/create-cluster.sh
This one ( kind-kind ) is created with kind create cluster. The reason is I want to have multi worker nodes in the clsuter. I am not sure how to handle if I use hack/create-cluster.sh. Can I change the script to create a cluster with multi worker nodes?
This one ( kind-kind ) is created with kind create cluster.
That's the reason why Karmada can't sync the cluster's healthy status. Because the Karmada control plane can't access it with a localhost endpoint.
The reason is I want to have multi worker nodes in the clsuter. I am not sure how to hnadle with it if I use hack/create-cluster.sh
Two solutions.
- after you create your kind cluster, you can update the endpoint in the generated kubconfig file, as per: https://github.com/karmada-io/karmada/blob/12d2a2998d44d49f5578a91c88586be12873a510/hack/create-cluster.sh#L97-L100
Then join the cluster.
hack/create-cluster.shwill use a kind configuration located at here to create kind cluster. You can edit the configuration, for example, add extra nodes to it, then, create kind cluster by the script.
@Fatimastm Does this issue be solved? Is there anything else that I can help with it?
Yes @RainbowMango, the problem has been solved and I can manage the federation enviornment. Thank you very much.
Thanks for your response. /close
@RainbowMango: Closing this issue.
In response to this:
Thanks for your response. /close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.