You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by GitBox <gi...@apache.org> on 2021/10/13 22:55:46 UTC

[GitHub] [incubator-yunikorn-k8shim] ycr-oss commented on a change in pull request #310: [YUNIKORN-874] Implement PredicateManager.

ycr-oss commented on a change in pull request #310:
URL: https://github.com/apache/incubator-yunikorn-k8shim/pull/310#discussion_r728504513



##########
File path: pkg/plugin/predicates/predicate_manager.go
##########
@@ -0,0 +1,365 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+package predicates
+
+import (
+	"context"
+	"errors"
+	"fmt"
+
+	"go.uber.org/zap"
+	v1 "k8s.io/api/core/v1"
+	"k8s.io/apimachinery/pkg/runtime"
+	"k8s.io/kube-scheduler/config/v1beta1"
+	"k8s.io/kubernetes/pkg/scheduler/algorithmprovider"
+	apiConfig "k8s.io/kubernetes/pkg/scheduler/apis/config"
+	"k8s.io/kubernetes/pkg/scheduler/apis/config/scheme"
+	"k8s.io/kubernetes/pkg/scheduler/framework"
+	"k8s.io/kubernetes/pkg/scheduler/framework/plugins"
+	fwruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
+
+	"github.com/apache/incubator-yunikorn-core/pkg/log"
+)
+
+/*
+Default K8S plugins as of 1.20 that implement PreFilter:
+	NodeResourcesFit
+	NodePorts
+	PodTopologySpread
+	InterPodAffinity
+	VolumeBinding
+*/
+
+// run only the simpler PreFilter plugins during reservation phase
+var reservationPreFilters = map[string]bool{
+	"NodeResourcesFit":  true,
+	"NodePorts":         true,
+	"PodTopologySpread": true,
+	"InterPodAffinity":  true,
+	// VolumeBinding
+}
+
+// run all PreFilter plugins during allocation phase
+var allocationPreFilters = map[string]bool{
+	"*": true,
+}
+
+/*
+Default K8S plugins as of 1.20 that implement Filter:
+	NodeUnschedulable
+	NodeName
+	TaintToleration
+	NodeAffinity
+	NodePorts
+	NodeResourcesFit
+	VolumeRestrictions
+	EBSLimits
+	GCEPDLimits
+	NodeVolumeLimits
+	AzureDiskLimits
+	VolumeBinding
+	VolumeZone
+	PodTopologySpread
+	InterPodAffinity
+*/
+
+// run only the simpler Filter plugins during reservation phase
+var reservationFilters = map[string]bool{
+	"NodeUnschedulable": true,
+	"NodeName":          true,
+	"TaintToleration":   true,
+	"NodeAffinity":      true,
+	"NodePorts":         true,
+	"NodeResourcesFit":  true,
+	// VolumeRestrictions
+	// EBSLimits
+	// GCEPDLimits
+	// NodeVolumeLimits
+	// AzureDiskLimits
+	// VolumeBinding
+	// VolumeZone
+	"PodTopologySpread": true,
+	"InterPodAffinity":  true,

Review comment:
       I didn't know that. You are correct!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org