Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

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
Contributor

@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
Contributor

@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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

6 participants