Added a new scheduling queue based on priority queue.

This commit is contained in:
Bobby (Babak) Salamat
2017-10-24 11:14:29 -07:00
parent ff0d72a3fa
commit daf8492bc5
6 changed files with 1090 additions and 32 deletions

View File

@@ -21,7 +21,9 @@ import (
"sort"
"k8s.io/api/core/v1"
"k8s.io/apiserver/pkg/util/feature"
"k8s.io/kubernetes/pkg/apis/scheduling"
"k8s.io/kubernetes/pkg/features"
)
const DefaultBindAllHostIP = "0.0.0.0"
@@ -59,6 +61,11 @@ func GetUsedPorts(pods ...*v1.Pod) map[string]bool {
return ports
}
// PodPriorityEnabled indicates whether pod priority feature is enabled.
func PodPriorityEnabled() bool {
return feature.DefaultFeatureGate.Enabled(features.PodPriority)
}
// GetPodFullName returns a name that uniquely identifies a pod.
func GetPodFullName(pod *v1.Pod) string {
// Use underscore as the delimiter because it is not allowed in pod name