Skip to content

error on bootstrapping flux #1265

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

Closed
sanjvij opened this issue Apr 14, 2021 · 10 comments
Closed

error on bootstrapping flux #1265

sanjvij opened this issue Apr 14, 2021 · 10 comments

Comments

@sanjvij
Copy link

sanjvij commented Apr 14, 2021

Hi . I am having a hard time in setting up flux on my Mac using bootstrap. when I try to run bootstrap command I get a health check error as below. Am I okay to ignore this ? Apologies if this is not the right forum and feel free me to direct in that case.

◎ waiting for Kustomization "flux-system/flux-system" to be reconciled
✗ failed to download artifact, error: GET http://source-controller.flux-system.svc.cluster.local./gitrepository/flux-system/flux-system/3f5e6a9863de3306a0ae2f9a69cf0fa62d558e0e.tar.gz giving up after 10 attempt(s)
► confirming components are healthy
✔ source-controller: deployment ready
✔ kustomize-controller: deployment ready
✔ helm-controller: deployment ready
✔ notification-controller: deployment ready
✔ all components are healthy
✗ bootstrap failed with 1 health check failure(s)

@stefanprodan
Copy link
Member

stefanprodan commented Apr 14, 2021

The failure happens on your cluster, is it Kubernetes on Docker for Mac? Can you post here the output of these commands:

flux check
flux get sources all
flux get kustomizations

@sanjvij
Copy link
Author

sanjvij commented Apr 14, 2021

Hi. yes its happened in Kubernetes on docker for Mac. Output of commands as below

(base) sanj@Sanjs-Air Flux % flux check
► checking prerequisites
✔ kubectl 1.19.7 >=1.18.0-0
✔ Kubernetes 1.19.7 >=1.16.0-0
► checking controllers
✔ helm-controller: deployment ready
► ghcr.io/fluxcd/helm-controller:v0.9.0
✔ kustomize-controller: deployment ready
► ghcr.io/fluxcd/kustomize-controller:v0.11.0
✔ notification-controller: deployment ready
► ghcr.io/fluxcd/notification-controller:v0.12.0
✔ source-controller: deployment ready
► ghcr.io/fluxcd/source-controller:v0.11.0
✔ all checks passed

(base) sanj@Sanjs-Air Flux % flux get sources all
NAME READY MESSAGE REVISION SUSPENDED
gitrepository/flux-system True Fetched revision: main/3f5e6a9863de3306a0ae2f9a69cf0fa62d558e0e main/3f5e6a9863de3306a0ae2f9a69cf0fa62d558e0e False

(base) sanj@Sanjs-Air Flux % flux get kustomizations
NAME READY MESSAGE REVISION SUSPENDED
flux-system True Applied revision: main/3f5e6a9863de3306a0ae2f9a69cf0fa62d558e0e main/3f5e6a9863de3306a0ae2f9a69cf0fa62d558e0e False

This is my third attempt as later on I get error in cloning sources and I was wondering if this was the reason. Thanks for a prompt reply

@hiddeco
Copy link
Member

hiddeco commented Apr 14, 2021

Looks like the error was transient, as the state of the resources now reflects that they could download and apply the artifact successfully.

@stefanprodan
Copy link
Member

stefanprodan commented Apr 14, 2021

Flux looks OK now, my guess is that the outbound network connection was really slow and it took some time for source-controller to clone the repo.

@sanjvij
Copy link
Author

sanjvij commented Apr 14, 2021

Okay thanks . So reason I wonder this was the issue was due to failure in creating sources. I will carry on and see if the sources get created successfully this time. thanks again.

@sanjvij
Copy link
Author

sanjvij commented Apr 14, 2021

Hi Stephan,

So reason I was trying to setup flux again was down to this error on creating sources. I am still new to this so feel free to correct me. When I create the source, I am getting the below error. the error is obvious as in it's missing authentication but I am not sure why the flux-system (default source I am guessing) is able to talk to git-hub but not the custom source named staging that I created. I have also pasted the content of the staging file.

(base) sanj@Sanjs-Air app-cluster % flux get sources git
NAME READY MESSAGE REVISION SUSPENDED
flux-system True Fetched revision: main/16cc882af5b03bf68e9ae5c2a0685734885c82a1 main/16cc882af5b03bf68e9ae5c2a0685734885c82a1 False
staging False unable to clone 'https://github.com/sanjvij/flux-infra', error: authentication required False

Contents of staging file**

apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: GitRepository
metadata:
name: staging
namespace: flux-system
spec:
interval: 30s
ref:
branch: master
url: https://github.com/sanjvij/flux-infra


apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
kind: Kustomization
metadata:
name: staging
namespace: flux-system
spec:
interval: 10m0s
path: ./
prune: true
sourceRef:
kind: GitRepository
name: staging
validation: client

***staging File Ends

@jdeokar95
Copy link

I see something similar, all the resources are healthy but there is one timeout which doesn't give enough details as to what went wrong.

◎ waiting for Kustomization "flux-v2-testing/flux-v2-testing" to be reconciled
✗ context deadline exceeded
► confirming components are healthy
✔ source-controller: deployment ready
✔ kustomize-controller: deployment ready
✔ helm-controller: deployment ready
✔ notification-controller: deployment ready
✔ all components are healthy
✗ bootstrap failed with 1 health check failure(s)

Any leads would be appreciated.

@somtochiama
Copy link
Member

When I create the source, I am getting the below error. the error is obvious as in it's missing authentication but I am not sure why the flux-system (default source I am guessing) is able to talk to git-hub but not the custom source named staging that I created. I have also pasted the content of the staging file.

@sanjvij You have to specify a secret containing the git credentials in spec.SecretRef in GitRepository CRD if the repository is private/ requires authentication. The reason that that flux-system can talk to GitHub is because this was automatically done for you during the bootstrap process.
See docs

@sanjvij
Copy link
Author

sanjvij commented Apr 15, 2021

Thanks. for time being I simply injected value from env variables. But Agree with your approach. Also the original bootstrapping error didn't came when I ran the bootstrap command again so am happy to close this as not an issue

@sanjvij sanjvij closed this as completed Apr 15, 2021
@fsteenkamp
Copy link

@jdeokar95 I read somewhere that the solution to your problem is proxy related, running:

unset http_proxy
unset https_proxy

worked for me. Can't give you more info than that, but it fixed the problem for me on an Ubuntu VM and on my Mac :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants