-
Notifications
You must be signed in to change notification settings - Fork 239
Increase the QPS limits on clients slightly and use protobuf for sync #90
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
Changes from 2 commits
95ed276
2376468
0a255ab
f7fbfb2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -231,21 +231,24 @@ type ClientBuilder struct { | |
| config *rest.Config | ||
| } | ||
|
|
||
| func (cb *ClientBuilder) RestConfig() *rest.Config { | ||
| func (cb *ClientBuilder) RestConfig(fns ...func(*rest.Config)) *rest.Config { | ||
| c := rest.CopyConfig(cb.config) | ||
| for _, fn := range fns { | ||
| fn(c) | ||
| } | ||
| return c | ||
| } | ||
|
|
||
| func (cb *ClientBuilder) ClientOrDie(name string) clientset.Interface { | ||
| return clientset.NewForConfigOrDie(rest.AddUserAgent(cb.config, name)) | ||
| func (cb *ClientBuilder) ClientOrDie(name string, fns ...func(*rest.Config)) clientset.Interface { | ||
| return clientset.NewForConfigOrDie(rest.AddUserAgent(cb.RestConfig(fns...), name)) | ||
| } | ||
|
|
||
| func (cb *ClientBuilder) KubeClientOrDie(name string) kubernetes.Interface { | ||
| return kubernetes.NewForConfigOrDie(rest.AddUserAgent(cb.config, name)) | ||
| func (cb *ClientBuilder) KubeClientOrDie(name string, fns ...func(*rest.Config)) kubernetes.Interface { | ||
| return kubernetes.NewForConfigOrDie(rest.AddUserAgent(cb.RestConfig(fns...), name)) | ||
| } | ||
|
|
||
| func (cb *ClientBuilder) APIExtClientOrDie(name string) apiext.Interface { | ||
| return apiext.NewForConfigOrDie(rest.AddUserAgent(cb.config, name)) | ||
| func (cb *ClientBuilder) APIExtClientOrDie(name string, fns ...func(*rest.Config)) apiext.Interface { | ||
| return apiext.NewForConfigOrDie(rest.AddUserAgent(cb.RestConfig(fns...), name)) | ||
| } | ||
|
|
||
| func newClientBuilder(kubeconfig string) (*ClientBuilder, error) { | ||
|
|
@@ -263,6 +266,11 @@ func newClientBuilder(kubeconfig string) (*ClientBuilder, error) { | |
| }, nil | ||
| } | ||
|
|
||
| func increaseQPS(config *rest.Config) { | ||
| config.QPS = 20 | ||
| config.Burst = 40 | ||
| } | ||
|
|
||
| type Context struct { | ||
| CVO *cvo.Operator | ||
| AutoUpdate *autoupdate.Controller | ||
|
|
@@ -291,7 +299,7 @@ func (o *Options) NewControllerContext(cb *ClientBuilder) *Context { | |
| resyncPeriod(o.ResyncInterval)(), | ||
| cvInformer.Config().V1().ClusterVersions(), | ||
| sharedInformers.Config().V1().ClusterOperators(), | ||
| cb.RestConfig(), | ||
| cb.RestConfig(increaseQPS), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this will only affect the generic resource builders. what about the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I left those at the defaults, those have low qps and low actions (rest config is what is used for sync loop). I'd like to do a shared qps pool eventually though for everything that isn't status updates to CV (which is effectively what this PR is). |
||
| cb.ClientOrDie(o.Namespace), | ||
| cb.KubeClientOrDie(o.Namespace), | ||
| cb.APIExtClientOrDie(o.Namespace), | ||
|
|
||
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.
fns ...isn't the bestgodoc, maybe either add comments / name the variable that it is evident that these are config modifiers...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.
oh, sorry