mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 08:17:26 +00:00
feat: graduate SchedulerQueueingHints to beta
This commit is contained in:
parent
48ead4e622
commit
b96eee847e
@ -641,6 +641,7 @@ var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate
|
|||||||
|
|
||||||
SchedulerQueueingHints: {
|
SchedulerQueueingHints: {
|
||||||
{Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Beta},
|
{Version: version.MustParse("1.28"), Default: false, PreRelease: featuregate.Beta},
|
||||||
|
{Version: version.MustParse("1.32"), Default: true, PreRelease: featuregate.Beta},
|
||||||
},
|
},
|
||||||
|
|
||||||
SELinuxChangePolicy: {
|
SELinuxChangePolicy: {
|
||||||
|
@ -104,6 +104,10 @@ var (
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
metrics.Register()
|
||||||
|
}
|
||||||
|
|
||||||
func setQueuedPodInfoGated(queuedPodInfo *framework.QueuedPodInfo) *framework.QueuedPodInfo {
|
func setQueuedPodInfoGated(queuedPodInfo *framework.QueuedPodInfo) *framework.QueuedPodInfo {
|
||||||
queuedPodInfo.Gated = true
|
queuedPodInfo.Gated = true
|
||||||
return queuedPodInfo
|
return queuedPodInfo
|
||||||
@ -129,7 +133,6 @@ func TestPriorityQueue_Add(t *testing.T) {
|
|||||||
logger, ctx := ktesting.NewTestContext(t)
|
logger, ctx := ktesting.NewTestContext(t)
|
||||||
ctx, cancel := context.WithCancel(ctx)
|
ctx, cancel := context.WithCancel(ctx)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
metrics.Register()
|
|
||||||
q := NewTestQueueWithObjects(ctx, newDefaultQueueSort(), objs)
|
q := NewTestQueueWithObjects(ctx, newDefaultQueueSort(), objs)
|
||||||
q.Add(logger, medPriorityPodInfo.Pod)
|
q.Add(logger, medPriorityPodInfo.Pod)
|
||||||
q.Add(logger, unschedulablePodInfo.Pod)
|
q.Add(logger, unschedulablePodInfo.Pod)
|
||||||
@ -994,7 +997,7 @@ func TestPriorityQueue_AddUnschedulableIfNotPresent_Backoff(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
err := q.AddUnschedulableIfNotPresent(logger, newQueuedPodInfoForLookup(unschedulablePod, "plugin"), oldCycle)
|
err := q.AddUnschedulableIfNotPresent(logger, attemptQueuedPodInfo(newQueuedPodInfoForLookup(unschedulablePod, "plugin")), oldCycle)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unexpected error from AddUnschedulableIfNotPresent: %v", err)
|
t.Fatalf("unexpected error from AddUnschedulableIfNotPresent: %v", err)
|
||||||
}
|
}
|
||||||
@ -1031,7 +1034,6 @@ func TestPriorityQueue_Pop(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestPriorityQueue_Update(t *testing.T) {
|
func TestPriorityQueue_Update(t *testing.T) {
|
||||||
metrics.Register()
|
|
||||||
c := testingclock.NewFakeClock(time.Now())
|
c := testingclock.NewFakeClock(time.Now())
|
||||||
|
|
||||||
queuePlugin := "queuePlugin"
|
queuePlugin := "queuePlugin"
|
||||||
@ -2054,7 +2056,6 @@ func TestPriorityQueue_AssignedPodAdded_(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestPriorityQueue_AssignedPodUpdated(t *testing.T) {
|
func TestPriorityQueue_AssignedPodUpdated(t *testing.T) {
|
||||||
metrics.Register()
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
unschedPod *v1.Pod
|
unschedPod *v1.Pod
|
||||||
@ -3068,7 +3069,6 @@ func TestPendingPodsMetric(t *testing.T) {
|
|||||||
pInfosWithDelay[i].Attempts = 0
|
pInfosWithDelay[i].Attempts = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
metrics.Register()
|
|
||||||
|
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
@ -3445,7 +3445,7 @@ func TestIncomingPodsMetrics(t *testing.T) {
|
|||||||
timestamp := time.Now()
|
timestamp := time.Now()
|
||||||
unschedulablePlg := "unschedulable_plugin"
|
unschedulablePlg := "unschedulable_plugin"
|
||||||
var pInfos = make([]*framework.QueuedPodInfo, 0, 3)
|
var pInfos = make([]*framework.QueuedPodInfo, 0, 3)
|
||||||
metrics.Register()
|
|
||||||
for i := 1; i <= 3; i++ {
|
for i := 1; i <= 3; i++ {
|
||||||
p := &framework.QueuedPodInfo{
|
p := &framework.QueuedPodInfo{
|
||||||
PodInfo: mustNewTestPodInfo(t,
|
PodInfo: mustNewTestPodInfo(t,
|
||||||
|
@ -57,6 +57,7 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort"
|
||||||
frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
|
frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
|
||||||
|
"k8s.io/kubernetes/pkg/scheduler/metrics"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/profile"
|
"k8s.io/kubernetes/pkg/scheduler/profile"
|
||||||
st "k8s.io/kubernetes/pkg/scheduler/testing"
|
st "k8s.io/kubernetes/pkg/scheduler/testing"
|
||||||
tf "k8s.io/kubernetes/pkg/scheduler/testing/framework"
|
tf "k8s.io/kubernetes/pkg/scheduler/testing/framework"
|
||||||
@ -247,6 +248,7 @@ func TestSchedulerCreation(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestFailureHandler(t *testing.T) {
|
func TestFailureHandler(t *testing.T) {
|
||||||
|
metrics.Register()
|
||||||
testPod := st.MakePod().Name("test-pod").Namespace(v1.NamespaceDefault).Obj()
|
testPod := st.MakePod().Name("test-pod").Namespace(v1.NamespaceDefault).Obj()
|
||||||
testPodUpdated := testPod.DeepCopy()
|
testPodUpdated := testPod.DeepCopy()
|
||||||
testPodUpdated.Labels = map[string]string{"foo": ""}
|
testPodUpdated.Labels = map[string]string{"foo": ""}
|
||||||
@ -285,7 +287,8 @@ func TestFailureHandler(t *testing.T) {
|
|||||||
// Need to add/update/delete testPod to the store.
|
// Need to add/update/delete testPod to the store.
|
||||||
podInformer.Informer().GetStore().Add(testPod)
|
podInformer.Informer().GetStore().Add(testPod)
|
||||||
|
|
||||||
queue := internalqueue.NewPriorityQueue(nil, informerFactory, internalqueue.WithClock(testingclock.NewFakeClock(time.Now())))
|
recorder := metrics.NewMetricsAsyncRecorder(3, 20*time.Microsecond, ctx.Done())
|
||||||
|
queue := internalqueue.NewPriorityQueue(nil, informerFactory, internalqueue.WithClock(testingclock.NewFakeClock(time.Now())), internalqueue.WithMetricsRecorder(*recorder))
|
||||||
schedulerCache := internalcache.New(ctx, 30*time.Second)
|
schedulerCache := internalcache.New(ctx, 30*time.Second)
|
||||||
|
|
||||||
queue.Add(logger, testPod)
|
queue.Add(logger, testPod)
|
||||||
|
@ -1072,6 +1072,10 @@
|
|||||||
lockToDefault: false
|
lockToDefault: false
|
||||||
preRelease: Beta
|
preRelease: Beta
|
||||||
version: "1.28"
|
version: "1.28"
|
||||||
|
- default: true
|
||||||
|
lockToDefault: false
|
||||||
|
preRelease: Beta
|
||||||
|
version: "1.32"
|
||||||
- name: SELinuxChangePolicy
|
- name: SELinuxChangePolicy
|
||||||
versionedSpecs:
|
versionedSpecs:
|
||||||
- default: false
|
- default: false
|
||||||
|
Loading…
Reference in New Issue
Block a user