Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
ca0c4464
Unverified
Commit
ca0c4464
authored
Apr 17, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Apr 17, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #76413 from yue9944882/chore/feature-gates
Add feature gates for switching between the legacy inflight limiting
parents
18b4e1b8
87d09301
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
7 deletions
+37
-7
kube_features.go
pkg/features/kube_features.go
+1
-0
kube_features.go
staging/src/k8s.io/apiserver/pkg/features/kube_features.go
+8
-0
server_run_options.go
...k8s.io/apiserver/pkg/server/options/server_run_options.go
+28
-7
No files found.
pkg/features/kube_features.go
View file @
ca0c4464
...
@@ -519,6 +519,7 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
...
@@ -519,6 +519,7 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
genericfeatures
.
APIListChunking
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
genericfeatures
.
APIListChunking
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
genericfeatures
.
DryRun
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
genericfeatures
.
DryRun
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
genericfeatures
.
ServerSideApply
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
genericfeatures
.
ServerSideApply
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
genericfeatures
.
RequestManagement
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
// inherited features from apiextensions-apiserver, relisted here to get a conflict if it is changed
// inherited features from apiextensions-apiserver, relisted here to get a conflict if it is changed
// unintentionally on either side:
// unintentionally on either side:
...
...
staging/src/k8s.io/apiserver/pkg/features/kube_features.go
View file @
ca0c4464
...
@@ -115,6 +115,13 @@ const (
...
@@ -115,6 +115,13 @@ const (
//
//
// Enables support for watch bookmark events.
// Enables support for watch bookmark events.
WatchBookmark
utilfeature
.
Feature
=
"WatchBookmark"
WatchBookmark
utilfeature
.
Feature
=
"WatchBookmark"
// owner: @MikeSpreitzer @yue9944882
// alpha: v1.15
//
//
// Enables managing request concurrency with prioritization and fairness at each server
RequestManagement
utilfeature
.
Feature
=
"RequestManagement"
)
)
func
init
()
{
func
init
()
{
...
@@ -137,4 +144,5 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
...
@@ -137,4 +144,5 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
WinOverlay
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
WinOverlay
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
WinDSR
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
WinDSR
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
WatchBookmark
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
WatchBookmark
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
RequestManagement
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
}
}
staging/src/k8s.io/apiserver/pkg/server/options/server_run_options.go
View file @
ca0c4464
...
@@ -18,6 +18,7 @@ package options
...
@@ -18,6 +18,7 @@ package options
import
(
import
(
"fmt"
"fmt"
"k8s.io/apiserver/pkg/features"
"net"
"net"
"time"
"time"
...
@@ -49,8 +50,9 @@ type ServerRunOptions struct {
...
@@ -49,8 +50,9 @@ type ServerRunOptions struct {
// decoded in a write request. 0 means no limit.
// decoded in a write request. 0 means no limit.
// We intentionally did not add a flag for this option. Users of the
// We intentionally did not add a flag for this option. Users of the
// apiserver library can wire it to a flag.
// apiserver library can wire it to a flag.
MaxRequestBodyBytes
int64
MaxRequestBodyBytes
int64
TargetRAMMB
int
TargetRAMMB
int
EnableInfightQuotaHandler
bool
}
}
func
NewServerRunOptions
()
*
ServerRunOptions
{
func
NewServerRunOptions
()
*
ServerRunOptions
{
...
@@ -104,11 +106,27 @@ func (s *ServerRunOptions) Validate() []error {
...
@@ -104,11 +106,27 @@ func (s *ServerRunOptions) Validate() []error {
if
s
.
TargetRAMMB
<
0
{
if
s
.
TargetRAMMB
<
0
{
errors
=
append
(
errors
,
fmt
.
Errorf
(
"--target-ram-mb can not be negative value"
))
errors
=
append
(
errors
,
fmt
.
Errorf
(
"--target-ram-mb can not be negative value"
))
}
}
if
s
.
MaxRequestsInFlight
<
0
{
errors
=
append
(
errors
,
fmt
.
Errorf
(
"--max-requests-inflight can not be negative value"
))
if
s
.
EnableInfightQuotaHandler
{
}
if
!
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
RequestManagement
)
{
if
s
.
MaxMutatingRequestsInFlight
<
0
{
errors
=
append
(
errors
,
fmt
.
Errorf
(
"--enable-inflight-quota-handler can not be set if feature "
+
errors
=
append
(
errors
,
fmt
.
Errorf
(
"--max-mutating-requests-inflight can not be negative value"
))
"gate RequestManagement is disabled"
))
}
if
s
.
MaxMutatingRequestsInFlight
!=
0
{
errors
=
append
(
errors
,
fmt
.
Errorf
(
"--max-mutating-requests-inflight=%v "
+
"can not be set if enabled inflight quota handler"
,
s
.
MaxMutatingRequestsInFlight
))
}
if
s
.
MaxRequestsInFlight
!=
0
{
errors
=
append
(
errors
,
fmt
.
Errorf
(
"--max-requests-inflight=%v "
+
"can not be set if enabled inflight quota handler"
,
s
.
MaxRequestsInFlight
))
}
}
else
{
if
s
.
MaxRequestsInFlight
<
0
{
errors
=
append
(
errors
,
fmt
.
Errorf
(
"--max-requests-inflight can not be negative value"
))
}
if
s
.
MaxMutatingRequestsInFlight
<
0
{
errors
=
append
(
errors
,
fmt
.
Errorf
(
"--max-mutating-requests-inflight can not be negative value"
))
}
}
}
if
s
.
RequestTimeout
.
Nanoseconds
()
<
0
{
if
s
.
RequestTimeout
.
Nanoseconds
()
<
0
{
...
@@ -174,5 +192,8 @@ func (s *ServerRunOptions) AddUniversalFlags(fs *pflag.FlagSet) {
...
@@ -174,5 +192,8 @@ func (s *ServerRunOptions) AddUniversalFlags(fs *pflag.FlagSet) {
"handler, which picks a randomized value above this number as the connection timeout, "
+
"handler, which picks a randomized value above this number as the connection timeout, "
+
"to spread out load."
)
"to spread out load."
)
fs
.
BoolVar
(
&
s
.
EnableInfightQuotaHandler
,
"enable-inflight-quota-handler"
,
s
.
EnableInfightQuotaHandler
,
""
+
"If true, replace the max-in-flight handler with an enhanced one that queues and dispatches with priority and fairness"
)
utilfeature
.
DefaultMutableFeatureGate
.
AddFlag
(
fs
)
utilfeature
.
DefaultMutableFeatureGate
.
AddFlag
(
fs
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment