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
76f9c406
Commit
76f9c406
authored
Oct 05, 2018
by
Darren Shepherd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove ExperimentalCriticalPodAnnotation
parent
c524ae33
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1 addition
and
48 deletions
+1
-48
daemonset_util.go
pkg/controller/daemon/util/daemonset_util.go
+1
-8
kube_features.go
pkg/features/kube_features.go
+0
-10
pod_update.go
pkg/kubelet/types/pod_update.go
+0
-22
admission.go
plugin/pkg/admission/priority/admission.go
+0
-8
No files found.
pkg/controller/daemon/util/daemonset_util.go
View file @
76f9c406
...
...
@@ -24,11 +24,8 @@ import (
"k8s.io/api/core/v1"
extensions
"k8s.io/api/extensions/v1beta1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
utilfeature
"k8s.io/apiserver/pkg/util/feature"
podutil
"k8s.io/kubernetes/pkg/api/v1/pod"
v1helper
"k8s.io/kubernetes/pkg/apis/core/v1/helper"
"k8s.io/kubernetes/pkg/features"
kubelettypes
"k8s.io/kubernetes/pkg/kubelet/types"
schedulerapi
"k8s.io/kubernetes/pkg/scheduler/api"
)
...
...
@@ -120,11 +117,7 @@ func AddOrUpdateDaemonPodTolerations(spec *v1.PodSpec, isCritical bool) {
func
CreatePodTemplate
(
ns
string
,
template
v1
.
PodTemplateSpec
,
generation
*
int64
,
hash
string
)
v1
.
PodTemplateSpec
{
newTemplate
:=
*
template
.
DeepCopy
()
// TODO(k82cn): when removing CritialPod feature, also remove 'ns' parameter.
isCritical
:=
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
ExperimentalCriticalPodAnnotation
)
&&
kubelettypes
.
IsCritical
(
ns
,
newTemplate
.
Annotations
)
AddOrUpdateDaemonPodTolerations
(
&
newTemplate
.
Spec
,
isCritical
)
AddOrUpdateDaemonPodTolerations
(
&
newTemplate
.
Spec
,
false
)
if
newTemplate
.
ObjectMeta
.
Labels
==
nil
{
newTemplate
.
ObjectMeta
.
Labels
=
make
(
map
[
string
]
string
)
...
...
pkg/features/kube_features.go
View file @
76f9c406
...
...
@@ -46,15 +46,6 @@ const (
// SYS_TIME). This should only be enabled if user namespace remapping is enabled in the docker daemon.
ExperimentalHostUserNamespaceDefaultingGate
utilfeature
.
Feature
=
"ExperimentalHostUserNamespaceDefaulting"
// owner: @vishh
// alpha: v1.5
//
// DEPRECATED - This feature is deprecated by Pod Priority and Preemption as of Kubernetes 1.13.
// Ensures guaranteed scheduling of pods marked with a special pod annotation `scheduler.alpha.kubernetes.io/critical-pod`
// and also prevents them from being evicted from a node.
// Note: This feature is not supported for `BestEffort` pods.
ExperimentalCriticalPodAnnotation
utilfeature
.
Feature
=
"ExperimentalCriticalPodAnnotation"
// owner: @jiayingz
// beta: v1.10
//
...
...
@@ -399,7 +390,6 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
AppArmor
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
DynamicKubeletConfig
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
ExperimentalHostUserNamespaceDefaultingGate
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Beta
},
ExperimentalCriticalPodAnnotation
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
DevicePlugins
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
TaintBasedEvictions
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
RotateKubeletServerCertificate
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
...
...
pkg/kubelet/types/pod_update.go
View file @
76f9c406
...
...
@@ -22,7 +22,6 @@ import (
"k8s.io/api/core/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
utilfeature
"k8s.io/apiserver/pkg/util/feature"
kubeapi
"k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/apis/scheduling"
"k8s.io/kubernetes/pkg/features"
)
...
...
@@ -32,7 +31,6 @@ const (
ConfigMirrorAnnotationKey
=
v1
.
MirrorPodAnnotationKey
ConfigFirstSeenAnnotationKey
=
"kubernetes.io/config.seen"
ConfigHashAnnotationKey
=
"kubernetes.io/config.hash"
CriticalPodAnnotationKey
=
"scheduler.alpha.kubernetes.io/critical-pod"
)
// PodOperation defines what changes will be made on a pod configuration.
...
...
@@ -151,11 +149,6 @@ func IsCriticalPod(pod *v1.Pod) bool {
return
true
}
}
if
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
ExperimentalCriticalPodAnnotation
)
{
if
IsCritical
(
pod
.
Namespace
,
pod
.
Annotations
)
{
return
true
}
}
return
false
}
...
...
@@ -175,21 +168,6 @@ func Preemptable(preemptor, preemptee *v1.Pod) bool {
return
false
}
// IsCritical returns true if parameters bear the critical pod annotation
// key. The DaemonSetController use this key directly to make scheduling decisions.
// TODO: @ravig - Deprecated. Remove this when we move to resolving critical pods based on priorityClassName.
func
IsCritical
(
ns
string
,
annotations
map
[
string
]
string
)
bool
{
// Critical pods are restricted to "kube-system" namespace as of now.
if
ns
!=
kubeapi
.
NamespaceSystem
{
return
false
}
val
,
ok
:=
annotations
[
CriticalPodAnnotationKey
]
if
ok
&&
val
==
""
{
return
true
}
return
false
}
// IsCriticalPodBasedOnPriority checks if the given pod is a critical pod based on priority resolved from pod Spec.
func
IsCriticalPodBasedOnPriority
(
priority
int32
)
bool
{
if
priority
>=
scheduling
.
SystemCriticalPriority
{
...
...
plugin/pkg/admission/priority/admission.go
View file @
76f9c406
...
...
@@ -33,7 +33,6 @@ import (
api
"k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/apis/scheduling"
"k8s.io/kubernetes/pkg/features"
kubelettypes
"k8s.io/kubernetes/pkg/kubelet/types"
)
const
(
...
...
@@ -179,13 +178,6 @@ func (p *priorityPlugin) admitPod(a admission.Attributes) error {
if
operation
==
admission
.
Create
{
var
priority
int32
// TODO: @ravig - This is for backwards compatibility to ensure that critical pods with annotations just work fine.
// Remove when no longer needed.
if
len
(
pod
.
Spec
.
PriorityClassName
)
==
0
&&
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
ExperimentalCriticalPodAnnotation
)
&&
kubelettypes
.
IsCritical
(
a
.
GetNamespace
(),
pod
.
Annotations
)
{
pod
.
Spec
.
PriorityClassName
=
scheduling
.
SystemClusterCritical
}
if
len
(
pod
.
Spec
.
PriorityClassName
)
==
0
{
var
err
error
var
pcName
string
...
...
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