Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clusterctl init failed #146

Closed
gyliu513 opened this issue Jun 28, 2021 · 6 comments
Closed

clusterctl init failed #146

gyliu513 opened this issue Jun 28, 2021 · 6 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@gyliu513
Copy link
Contributor

What steps did you take and what happened:
[A clear and concise description on how to REPRODUCE the bug.]

I was trying to test #41 , but failed to set up the control plane.

root@gyliu-dev21:~/go/src/github.com/kubernetes-sigs/cluster-api# ./bin/clusterctl init --core cluster-api:v0.4.0-beta.0  --control-plane nested:v0.1.0  --infrastructure nested:v0.1.0 --config ~/.cluster-api/dev-repository/config.yaml
Fetching providers
Error: failed to get provider components for the "cluster-api:v0.4.0-beta.0" provider: failed to read "core-components.yaml" from provider's repository "cluster-api": failed to get GitHub release v0.4.0-beta.0: failed to read release "v0.4.0-beta.0": GET https://api.github.com/repos/kubernetes-sigs/cluster-api/releases/tags/v0.4.0-beta.0: 401 Bad credentials []
root@gyliu-dev21:~/go/src/github.com/kubernetes-sigs/cluster-api# kubectl get nodes
NAME                 STATUS   ROLES                  AGE   VERSION
capn-control-plane   Ready    control-plane,master   99s   v1.21.1
root@gyliu-dev21:~/go/src/github.com/kubernetes-sigs/cluster-api# kind version
kind v0.11.1 go1.16.4 linux/amd64

/cc @christopherhein

What did you expect to happen:

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • cluster-api-provider-nested version:
  • Minikube/KIND version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

/kind bug
[One or more /area label. See https://github.com/kubernetes-sigs/cluster-api-provider-nested/labels?q=area for the list of labels]

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 28, 2021
@christopherhein
Copy link
Member

@gyliu513 interesting, it appears that this should work, in your error message it says you have bad credentials.

Error: failed to get provider components for the "cluster-api:v0.4.0-beta.0" provider: failed to read "core-components.yaml" from provider's repository "cluster-api": failed to get GitHub release v0.4.0-beta.0: failed to read release "v0.4.0-beta.0": GET https://api.github.com/repos/kubernetes-sigs/cluster-api/releases/tags/v0.4.0-beta.0: 401 Bad credentials []

Can you view: https://api.github.com/repos/kubernetes-sigs/cluster-api/releases/tags/v0.4.0-beta.0 in the browser?

@jichenjc
Copy link
Contributor

I recompiled latest clusterctl and it works fine
so @gyliu513 I guess you might want to check whether your cred has some problem?

# ./bin/clusterctl init --core cluster-api:v0.4.0-beta.0  --control-plane nested:v0.1.0  --infrastructure nested:v0.1.0 --config ~/.cluster-api/dev-repository/config.yaml
Fetching providers
Installing cert-manager Version="v1.1.0"
Waiting for cert-manager to be available...
Installing Provider="cluster-api" Version="v0.4.0-beta.0" TargetNamespace="capi-system"
Installing Provider="bootstrap-kubeadm" Version="v0.4.0-beta.0" TargetNamespace="capi-kubeadm-bootstrap-system"
Installing Provider="control-plane-nested" Version="v0.1.0" TargetNamespace="capn-nested-control-plane-system"
Installing Provider="infrastructure-nested" Version="v0.1.0" TargetNamespace="capn-system"

Your management cluster has been initialized successfully!

You can now create your first workload cluster by running the following:

  clusterctl generate cluster [name] --kubernetes-version [version] | kubectl apply -f -

@christopherhein
Copy link
Member

@jichenjc @gyliu513 think this can be closed now that #147 is closed?

@gyliu513
Copy link
Contributor Author

Works now, thanks @jichenjc and @christopherhein !

@aanoaa
Copy link

aanoaa commented Oct 11, 2022

I faced this error cause my shell has GITHUB_TOKEN environment.

https://github.com/kubernetes-sigs/cluster-api/blob/main/cmd/clusterctl/client/repository/repository_github.go#L175

after unset works.

@wyike
Copy link

wyike commented May 23, 2023

In my case, the GITHUB_TOKEN is expired. So I regenerate one and export it, then 401 Bad credentials issue resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

6 participants