-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 max-requests-inflight parameter #4395
Conversation
/assign @mikesplain |
Hey @ihoegen thanks so much for the contribution! This looks pretty good but we need a few things.
Let me know if you have any questions! Thanks again! |
/ok-to-test |
/retest |
Also which versions of k8s does this run on? |
Earliest occurrence of the flag I could find on the kube apiserver was on 1.0 |
@ihoegen Great! Looks like you have some test issues though, when I run locally I get
|
/retest |
/lgtm thanks so much! |
/assign @chrislovecnm |
/approve |
@@ -31,38 +31,52 @@ func Test_KubeAPIServer_BuildFlags(t *testing.T) { | |||
}{ | |||
{ | |||
kops.KubeAPIServerConfig{}, | |||
"--insecure-port=0 --secure-port=0", | |||
"--insecure-port=0 --max-requests-inflight=0 --secure-port=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.
Unfortunately I think this might actually be honored - i.e. we would actually set the limit as 0.
I actually thought that int=0 defaulted to a omitted flag, but I guess not.
I think you need to add flag-empty:"0"
pkg/apis/kops/componentconfig.go
Outdated
@@ -293,6 +293,8 @@ type KubeAPIServerConfig struct { | |||
RequestheaderAllowedNames []string `json:"requestheaderAllowedNames,omitempty" flag:"requestheader-allowed-names"` | |||
// FeatureGates is set of key=value pairs that describe feature gates for alpha/experimental features. | |||
FeatureGates map[string]string `json:"featureGates,omitempty" flag:"feature-gates"` | |||
// MaxRequestsInflight The maximum number of non-mutating requests in flight at a given time. | |||
MaxRequestsInflight int `json:"maxRequestsInflight,omitempty" flag:"max-requests-inflight"` |
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 you need to add flag-empty:"0"
here (although separately we might want to figure out if 0 should be omitted I guess!)
Also technically this should be int32 (or int64), because it's part of our API and we shouldn't have architecture dependent types in our API. Not that it matters in practice :-)
@@ -293,6 +293,8 @@ type KubeAPIServerConfig struct { | |||
RequestheaderAllowedNames []string `json:"requestheaderAllowedNames,omitempty" flag:"requestheader-allowed-names"` | |||
// FeatureGates is set of key=value pairs that describe feature gates for alpha/experimental features. | |||
FeatureGates map[string]string `json:"featureGates,omitempty" flag:"feature-gates"` | |||
// MaxRequestsInflight The maximum number of non-mutating requests in flight at a given time. | |||
MaxRequestsInflight int `json:"maxRequestsInflight,omitempty" flag:"max-requests-inflight"` |
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.
int32
and flag-empty:"0"
here as well
@@ -293,6 +293,8 @@ type KubeAPIServerConfig struct { | |||
RequestheaderAllowedNames []string `json:"requestheaderAllowedNames,omitempty" flag:"requestheader-allowed-names"` | |||
// FeatureGates is set of key=value pairs that describe feature gates for alpha/experimental features. | |||
FeatureGates map[string]string `json:"featureGates,omitempty" flag:"feature-gates"` | |||
// MaxRequestsInflight The maximum number of non-mutating requests in flight at a given time. | |||
MaxRequestsInflight int `json:"maxRequestsInflight,omitempty" flag:"max-requests-inflight"` |
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.
And don't forget here either :-) int32
and flag-empty:"0"
Generally looks good but I think we want int32 and flag-empty:"0", as otherwise I think we will actually set the limit to 0 (?) |
/approve cancel |
Many thanks for updating @ihoegen /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ihoegen, justinsb, mikesplain The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these OWNERS Files:
Approvers can indicate their approval by writing |
Adding the field as described in #4322