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

Harbor webhook issues with fluxv2 #309

Open
venkatesh-mb opened this issue Sep 9, 2022 · 6 comments
Open

Harbor webhook issues with fluxv2 #309

venkatesh-mb opened this issue Sep 9, 2022 · 6 comments

Comments

@venkatesh-mb
Copy link

Our flux auto deployment woroking without any issues.

But we are having loot of inconscity with Webhook to deploy latest image as soon as image pushed.
As soon as we configure 1st time it's working without any issues, later after coupole tages it's stopped working.
We as below template to test our webhook.

apiVersion: notification.toolkit.fluxcd.io/v1beta1
kind: Receiver
metadata:
  name: harbor-receiver
  namespace: tenant-dev
spec:
  type: harbor
  secretRef:
    name: webhook-token
  resources:
    - apiVersion: image.toolkit.fluxcd.io/v1beta1
      kind: ImageRepository
      name: application-testing

Any idea how can we troubleshoot this issue?

and second question relevent to same topic.

We have around 50 applications in each environment. Do we have create 50 yamls files for every imageRepositry? or is there any way we can manage all at a time.

@stefanprodan
Copy link
Member

Any idea how can we troubleshoot this issue?

Please look at the notification-controller logs and see if the receiver runs into errors, if there are no issues there, look at the image-reflector-controller logs. Also the status conditions of the ImageRepository object could tell you if it runs into an error or not. The recevier does the same thing as flux reconcile image repository <name> -n <namespace>, if you run the command does it pull the latest tags or not?

Do we have create 50 yamls files for every imageRepositry? or is there any way we can manage all at a time.

There is no way to register images bulk, you could use some script to generate all the YAMLs from a list of images.

@venkatesh-mb
Copy link
Author

There are no errors with
image-reflector-controller, notification-controller, and ImageRepository shows last run time according to the interval time specified at ImageRepository and it's working fine.

but we want to run this with webhook and it didn't deployed with as soon as image pushed to harbor.

flux reconcile image repository <name> -n <namespace>, this command pull the latest tags.

@stefanprodan
Copy link
Member

My guess is that the image is not really there in the Harbor API when you trigger the receiver, what happens if you add let's say a 10 seconds delay before you call the Flux receiver?

@venkatesh-mb
Copy link
Author

that would be fine, but where we could configure this delay time?

@venkatesh-mb
Copy link
Author

We believe this is something which we need to add at receiver level but syntax not allowing us to add.

@stefanprodan
Copy link
Member

I suspect this is a Harbor bug where the webhook is triggered by the query doesn't return new tags. Switch to a generic receiver, then in the CI job that pushes images to Harbor call the Flux webhook after docker pull works for that tag.

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

2 participants