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
d2ee8f7e
Commit
d2ee8f7e
authored
Mar 03, 2016
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #22423 from wojtek-t/increase_qps_for_admission_control
Stop the bleeding of long latency of POST pods
parents
ad69472a
2f6d034c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
0 deletions
+15
-0
server.go
cmd/kube-apiserver/app/server.go
+5
-0
admission.go
plugin/pkg/admission/limitranger/admission.go
+5
-0
admission.go
plugin/pkg/admission/resourcequota/admission.go
+5
-0
No files found.
cmd/kube-apiserver/app/server.go
View file @
d2ee8f7e
...
@@ -256,6 +256,11 @@ func Run(s *options.APIServer) error {
...
@@ -256,6 +256,11 @@ func Run(s *options.APIServer) error {
clientConfig
:=
&
restclient
.
Config
{
clientConfig
:=
&
restclient
.
Config
{
Host
:
net
.
JoinHostPort
(
s
.
InsecureBindAddress
.
String
(),
strconv
.
Itoa
(
s
.
InsecurePort
)),
Host
:
net
.
JoinHostPort
(
s
.
InsecureBindAddress
.
String
(),
strconv
.
Itoa
(
s
.
InsecurePort
)),
// Increase QPS limits. The client is currently passed to all admission plugins,
// and those can be throttled in case of higher load on apiserver - see #22340 and #22422
// for more details. Once #22422 is fixed, we may want to remove it.
QPS
:
50
,
Burst
:
100
,
}
}
if
len
(
s
.
DeprecatedStorageVersion
)
!=
0
{
if
len
(
s
.
DeprecatedStorageVersion
)
!=
0
{
gv
,
err
:=
unversioned
.
ParseGroupVersion
(
s
.
DeprecatedStorageVersion
)
gv
,
err
:=
unversioned
.
ParseGroupVersion
(
s
.
DeprecatedStorageVersion
)
...
...
plugin/pkg/admission/limitranger/admission.go
View file @
d2ee8f7e
...
@@ -103,6 +103,11 @@ func (l *limitRanger) Admit(a admission.Attributes) (err error) {
...
@@ -103,6 +103,11 @@ func (l *limitRanger) Admit(a admission.Attributes) (err error) {
if
len
(
items
)
==
0
{
if
len
(
items
)
==
0
{
lruItemObj
,
ok
:=
l
.
liveLookupCache
.
Get
(
a
.
GetNamespace
())
lruItemObj
,
ok
:=
l
.
liveLookupCache
.
Get
(
a
.
GetNamespace
())
if
!
ok
||
lruItemObj
.
(
liveLookupEntry
)
.
expiry
.
Before
(
time
.
Now
())
{
if
!
ok
||
lruItemObj
.
(
liveLookupEntry
)
.
expiry
.
Before
(
time
.
Now
())
{
// TODO: If there are multiple operations at the same time and cache has just expired,
// this may cause multiple List operations being issued at the same time.
// If there is already in-flight List() for a given namespace, we should wait until
// it is finished and cache is updated instead of doing the same, also to avoid
// throttling - see #22422 for details.
liveList
,
err
:=
l
.
client
.
Core
()
.
LimitRanges
(
a
.
GetNamespace
())
.
List
(
api
.
ListOptions
{})
liveList
,
err
:=
l
.
client
.
Core
()
.
LimitRanges
(
a
.
GetNamespace
())
.
List
(
api
.
ListOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
admission
.
NewForbidden
(
a
,
err
)
return
admission
.
NewForbidden
(
a
,
err
)
...
...
plugin/pkg/admission/resourcequota/admission.go
View file @
d2ee8f7e
...
@@ -128,6 +128,11 @@ func (q *quotaAdmission) Admit(a admission.Attributes) (err error) {
...
@@ -128,6 +128,11 @@ func (q *quotaAdmission) Admit(a admission.Attributes) (err error) {
if
len
(
items
)
==
0
{
if
len
(
items
)
==
0
{
lruItemObj
,
ok
:=
q
.
liveLookupCache
.
Get
(
a
.
GetNamespace
())
lruItemObj
,
ok
:=
q
.
liveLookupCache
.
Get
(
a
.
GetNamespace
())
if
!
ok
||
lruItemObj
.
(
liveLookupEntry
)
.
expiry
.
Before
(
time
.
Now
())
{
if
!
ok
||
lruItemObj
.
(
liveLookupEntry
)
.
expiry
.
Before
(
time
.
Now
())
{
// TODO: If there are multiple operations at the same time and cache has just expired,
// this may cause multiple List operations being issued at the same time.
// If there is already in-flight List() for a given namespace, we should wait until
// it is finished and cache is updated instead of doing the same, also to avoid
// throttling - see #22422 for details.
liveList
,
err
:=
q
.
client
.
Core
()
.
ResourceQuotas
(
namespace
)
.
List
(
api
.
ListOptions
{})
liveList
,
err
:=
q
.
client
.
Core
()
.
ResourceQuotas
(
namespace
)
.
List
(
api
.
ListOptions
{})
if
err
!=
nil
{
if
err
!=
nil
{
return
admission
.
NewForbidden
(
a
,
err
)
return
admission
.
NewForbidden
(
a
,
err
)
...
...
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