-
Notifications
You must be signed in to change notification settings - Fork 248
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
add configurable pagination to nfd-master #2000
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ivelichkovich The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @ivelichkovich! |
Hi @ivelichkovich. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
✅ Deploy Preview for kubernetes-sigs-nfd ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
/ok-to-test |
@ivelichkovich: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the work, small comment out there. Can you please add the documentation for this new option?
cmd/nfd-master/main.go
Outdated
@@ -122,6 +122,8 @@ func initFlags(flagset *flag.FlagSet) (*master.Args, *master.ConfigOverrideArgs) | |||
"in the same format as in the config file (i.e. json or yaml). These options") | |||
flagset.BoolVar(&args.EnableLeaderElection, "enable-leader-election", false, | |||
"Enables a leader election. Enable this when running more than one replica on nfd master.") | |||
flagset.Int64Var(&args.ListSize, "node-feature-informer-list-size", 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest a shorter way like this.
flagset.Int64Var(&args.ListSize, "node-feature-informer-list-size", 0, | |
flagset.Int64Var(&args.ListSize, "informer-list-size", 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the flag and updated docs, let me know if you'd prefer the doc update somewhere else
I wasn't sure if we'd want to default to 500 (default list pagination size) to keep new default behavior consistent with old behavior or set it to default to 200 to match the gc pagination default size. I'm open to either but would lean towards making them consistent and setting the default here to 200, ref: https://github.com/kubernetes-sigs/node-feature-discovery/pull/2001/files |
api/generated/informers/externalversions/nfd/v1alpha1/nodefeature.go
Outdated
Show resolved
Hide resolved
@@ -101,6 +102,7 @@ func newNfdController(config *restclient.Config, nfdApiControllerOptions nfdApiC | |||
if opts.ResourceVersion == "0" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw noticed the (TODO: find out why)
about scalability of this resource version override. While researching the pagination stuff I think this is likely due to this snippet of code: https://github.com/kubernetes/kubernetes/blob/ace55542575fb098b3e413692bbe2bc20d2348ba/staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go#L600-L616 if you set resource version to 0 it serves the request from apiservers cache and doesn't use pagination otherwise pagination will default to 500 so that may explain why it blows up on large clusters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So by setting this we're making it go to ETCD instead of from api-server cache, I found some WIP in k/k that seems to imply they're working on improving this behavior where you'll be able to paginate from apiserver cache but AFAICT it's not supported yet, would be good to track this though kubernetes/kubernetes#108003
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @ivelichkovich for the enhancement. A few small comments below
/ok-to-test
/cc @ArangoGutierrez @adrianchiris
@@ -122,6 +122,8 @@ func initFlags(flagset *flag.FlagSet) (*master.Args, *master.ConfigOverrideArgs) | |||
"in the same format as in the config file (i.e. json or yaml). These options") | |||
flagset.BoolVar(&args.EnableLeaderElection, "enable-leader-election", false, | |||
"Enables a leader election. Enable this when running more than one replica on nfd master.") | |||
flagset.Int64Var(&args.ListSize, "informer-list-size", 200, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just pondering (bike-shedding) on the naming. Would -informer-paginate
or -informer-page-size
be more descriptive, thoughts?
@@ -122,6 +122,8 @@ func initFlags(flagset *flag.FlagSet) (*master.Args, *master.ConfigOverrideArgs) | |||
"in the same format as in the config file (i.e. json or yaml). These options") | |||
flagset.BoolVar(&args.EnableLeaderElection, "enable-leader-election", false, | |||
"Enables a leader election. Enable this when running more than one replica on nfd master.") | |||
flagset.Int64Var(&args.ListSize, "informer-list-size", 200, | |||
"The list size to use when listing node features to sync informer cache.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest to use the name of the CRD.
"The list size to use when listing node features to sync informer cache.") | |
"The list size to use when listing NodeFeature objects to sync informer cache.") |
### -informer-list-size | ||
|
||
The `-informer-list-size` flag is used to control pagination during informer cache sync on nfd-master startup. | ||
This is useful to control load on api-server/etcd as listing `nodefeatures` can be expensive, especially in large clusters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is useful to control load on api-server/etcd as listing `nodefeatures` can be expensive, especially in large clusters. | |
This is useful to control load on api-server/etcd as listing NodeFeature objects can be expensive, especially in large clusters. |
@ivelichkovich: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
addresses scalability and api-server load concerns for large clusters by adding configurable pagination to the informer cache of nfd-master
related to: #1998