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
4d1d98c4
Commit
4d1d98c4
authored
Dec 02, 2016
by
Dr. Stefan Schimanski
Committed by
Dr. Stefan Schimanski
Dec 05, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove namespace controller pod precedence
parent
a8ebc131
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
21 deletions
+0
-21
namespace_controller_utils.go
pkg/controller/namespace/namespace_controller_utils.go
+0
-21
No files found.
pkg/controller/namespace/namespace_controller_utils.go
View file @
4d1d98c4
...
...
@@ -18,7 +18,6 @@ package namespace
import
(
"fmt"
"sort"
"sync"
"time"
...
...
@@ -350,9 +349,6 @@ func deleteAllContent(
)
(
int64
,
error
)
{
estimate
:=
int64
(
0
)
glog
.
V
(
4
)
.
Infof
(
"namespace controller - deleteAllContent - namespace: %s, gvrs: %v"
,
namespace
,
groupVersionResources
)
// iterate over each group version, and attempt to delete all of its resources
// we sort resources to delete in a priority order that deletes pods LAST
sort
.
Sort
(
sortableGroupVersionResources
(
groupVersionResources
))
for
_
,
gvr
:=
range
groupVersionResources
{
gvrEstimate
,
err
:=
deleteAllContentForGroupVersionResource
(
kubeClient
,
clientPool
,
opCache
,
gvr
,
namespace
,
namespaceDeletedAt
)
if
err
!=
nil
{
...
...
@@ -502,20 +498,3 @@ func estimateGracefulTerminationForPods(kubeClient clientset.Interface, ns strin
}
return
estimate
,
nil
}
// sortableGroupVersionResources sorts the input set of resources for deletion, and orders pods to always be last.
// the idea is that the namespace controller will delete all things that spawn pods first in order to reduce the time
// those controllers spend creating pods only to be told NO in admission and potentially overwhelming cluster especially if they lack rate limiting.
type
sortableGroupVersionResources
[]
schema
.
GroupVersionResource
func
(
list
sortableGroupVersionResources
)
Len
()
int
{
return
len
(
list
)
}
func
(
list
sortableGroupVersionResources
)
Swap
(
i
,
j
int
)
{
list
[
i
],
list
[
j
]
=
list
[
j
],
list
[
i
]
}
func
(
list
sortableGroupVersionResources
)
Less
(
i
,
j
int
)
bool
{
return
list
[
j
]
.
Group
==
""
&&
list
[
j
]
.
Resource
==
"pods"
}
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