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 pod and node informers to reduce APIServer load #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mikkeloscar
Copy link
Collaborator

This introduces the use of informers for listing pods and nodes. It's inspired by what is done in external-dns: https://github.com/kubernetes-sigs/external-dns/blob/805555872ee7e27ab15802a86e313120432117fa/source/ingress.go#L78

The main idea of informers are that they use an internal cache which is maintained via a watch. Whenever the operator will do a list pods or list nodes it will read from the internal cache instead of making an API call to the APIServer thus reducing the load which is usually caused by listing pods in big clusters.

This needs a bit of testing before it can be considered. I had to change a lot of []v1.Pod to []*v1.Pod because of the informer semantics, but I don't fully understand the API yet so I won't to make sure we are still using the values in a safe way.
Additionally we need to understand how this watch behaves when there are connection issues to the APIServer.

Copy link
Contributor

@njuettner njuettner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@njuettner
Copy link
Contributor

👍

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
@otrosien
Copy link
Member

Is it still WIP or ready for review?

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

Successfully merging this pull request may close these issues.

None yet

3 participants