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

Use client-go's informer to replace the custom routing table config map updater #287

Closed
arschles opened this issue Oct 7, 2021 · 4 comments · Fixed by #326
Closed

Use client-go's informer to replace the custom routing table config map updater #287

arschles opened this issue Oct 7, 2021 · 4 comments · Fixed by #326
Labels
enhancement New feature or request good first issue Good for newcomers Hacktoberfest Great issues to tackle for Hacktoberfest 2021

Comments

@arschles
Copy link
Collaborator

arschles commented Oct 7, 2021

There are quite a few places where we have to consume a kubernetes resource, watch it for changes, and keep a copy of it (or some data derived from a copy of it) in memory and up-to-date. So far, we have written code from scratch that uses a watch.Interface to watch for changes, and uses a Kubernetes client to periodically do a full fetch of the Kubernetes resource(s) in question.

In #269, we're beginning to remove some of this custom code in favor of the informer framework for the deployment cache. This issue is to replace all of the other appropriate instances of such code:

  • Watching the routing table ConfigMap in the scaler
  • Watching the routing table ConfigMap in the interceptor

Use-Case

We will be able to delete a nontrivial amount of code by doing this work.

Specification

  • Refactor the code in https://github.com/kedacore/http-add-on/blob/main/pkg/routing/config_map_updater.go to use an informer rather than a custom-built for loop
@arschles arschles added the enhancement New feature or request label Oct 7, 2021
@arschles arschles added this to the v0.3.0 milestone Oct 8, 2021
@arschles arschles added the Hacktoberfest Great issues to tackle for Hacktoberfest 2021 label Oct 11, 2021
@tpiperatgod
Copy link
Contributor

I am interested in this matter, is it possible to assign it to me?

@arschles
Copy link
Collaborator Author

@tpiperatgod GitHub won't let me set the "assignee" field to you, but please feel free to work on it.

#269 will replace the deployment cache with the informer, so would you mind working on the routing table updater code?

@arschles arschles changed the title Use client-go's informer throughout the codebase Use client-go's informer to replace the custom routing table config map updater Nov 16, 2021
@arschles arschles added the good first issue Good for newcomers label Nov 16, 2021
@tpiperatgod tpiperatgod mentioned this issue Nov 17, 2021
2 tasks
@tpiperatgod
Copy link
Contributor

I submitted a pr but still have some matters I would like to discuss with you:

When the configmap named "keda-http-routing-table" changes (e.g., a new httpscaledobjects is created), the external-scaler service will request keda to access the IsActive rpc of the http-add-on in the external-push mode.

However, since the minimum resynchronization period of the informer is 1s, the IsActive rpc request launched by keda will fail in the first 1s (this has no effect on the subsequent functionality, but there will be error log output).

Should we make StreamIsActive run after a 1 second delay? or just keep it.

And according to the optimization for the external-scaler(and interceptor) mentioned at https://hackmd.io/ttpSY5KQQtGIqbAzyKex3g, it will also solve this problem I think.

@arschles
Copy link
Collaborator Author

@tpiperatgod I just reviewed your PR (#326) - thanks for submitting it. I answered your question there, so let's discuss it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers Hacktoberfest Great issues to tackle for Hacktoberfest 2021
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants