-
Notifications
You must be signed in to change notification settings - Fork 747
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
Resource Event Reprocesses 'Events' and Doesn't Support Annotation Filters #560
Comments
Are you using v0.13.0? Take a look at the updated event-source for resource gateway at https://github.com/argoproj/argo-events/blob/master/examples/event-sources/resource.yaml . The The resource gateway runs a shared informer for events (Add, Update and Delete) and doesn't just list objects in a for-loop. If you want to listen to new objects, then you need to specify the correct To listen to new objects. specify The gateway does not process any object twice. It only processes objects notified to it by Kubernetes API server. Annotations are not meant to be used for filtering purposes. They contain non-identifying information as specified in Kubernetes guidelines. Besides K8s Informer API does not allow to filter on annotations. If you still want to filter on annotations, I'd suggest using There is a pr #561 to support a list of event types for resource gateway which will be available in next release. |
I am using eventType and Label filters; however, I am not getting the expected behavior. Expected Behavior: Generate event each time a new AWS EBS persistentvolume is created. Data filters are not working with the Sensor because Kubernetes resource event data is base64 encoded - once decoded, the body is also encoded. I do not see where I can specify dataDecoded (for example): as a data filter within the sensor. This is preventing me from mapping event data to parameters as well. ############Event Source File############### |
The reprocessing that is occurring also do to the base64 encoding issue. The eventType is within the data element that is encoded; so it is not filtering correctly. I am getting all updates, add, deletes. |
update? |
Everything seems to work. Let's take an example,
4.Set up the gateway
|
@VaibhavPage, I have the same problem. I am trying to react to node deletions using resource events and the
Note that this does not look like the example you gave: The
|
This is a continuation of the post above (coming from the same team). For now, we use a data filter in the sensor as a workaround to weed out non-delete events. The data filter looks like this:
|
@ozankabak @gordiustechnologies Appreciate the second observation - I have tested your workaround and it does permit the filtering on event type (at the secondary level; event sensor). Thank you very much! @VaibhavPage Understanding that it is not desirable to implement event type filtering within the event sensor and that we are still unable to leverage data filters within the event sensor, can you add this as an enhancement request? To reiterate; it would be desired to have a base64 decode option for event source's resource type and event sensors' filter. |
@gordiustechnologies Although the event data is base64 encoded when you use the
The body is also base64 encode, but once you refer it in the sensor as I have done in the filter posted above, it decodes it into JSON format of the corresponding K8s object,
Node events of all types going through gateway should not be related to the event body being base64 encoded. I'll try to replicate it on my setup and check if there is an issue with node events. @bpayt2 maybe I am not able to understand the problem, can you post your gateway, sensor and event source file and walk me through the desired outcome? It'll help me test on my local setup. Thanks!! |
Thanks @VaibhavPage. Considering @bpayt2's posts, I suspect the event type filtering issue is not specific to nodes, but possibly affecting other resources too. Encoding may not be the root cause, but something is definitely interfering with the |
Got it. I have a pr #561 which will fix the issue if any. I'll keep you guys posted. |
@VaibhavPage, can you make a 0.13.1 release so that we can verify whether |
I'll cut a release in couple of days. |
@VaibhavPage Does 0.14 fix this? Should we try it out in our setups? |
Yes, please try v0.14.0. Also, take a look at https://argoproj.github.io/argo-events/setup/resource/#list-options and https://github.com/argoproj/argo-events/blob/master/examples/event-sources/resource.yaml#L20 |
@ozankabak did it fix the issue? |
@VaibhavPage @ozankabak I have tested the latest and it fixes my reported issue. Please feel free to close. Thank you! |
@VaibhavPage: I can confirm that it works too. Thanks! |
The resource event source type is performing a list operation for a particular resources within Kubernetes. This is not an 'event/trigger' but just a continual list. I am reprocessing the same resources continuously. Can you add support for only new resources?
Also, I am unable to filter on annotations.
The text was updated successfully, but these errors were encountered: