util

package
v0.0.0-...-3dc4fa0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NodeType is define the node type key
	NodeType = "type"
	// VirtualPodLabel is the label of virtual pod
	VirtualPodLabel = "virtual-pod"
	// VirtualKubeletLabel is the label of virtual kubelet
	VirtualKubeletLabel = "virtual-kubelet"
	// TrippedLabels is the label of tripped labels
	TrippedLabels = "tripped-labels"
	// ClusterID marks the id of a cluster
	ClusterID = "clusterID"
	// SelectorKey is the key of ClusterSelector
	SelectorKey = "clusterSelector"
)
View Source
const (
	TopologySchedulingLabelKey = "topology-scheduling-policy.scheduling.sigs.k8s.io"
)

Variables

View Source
var (
	// ErrorNotMatched means pod does not match coscheduling
	ErrorNotMatched = fmt.Errorf("not match coscheduling")
	// ErrorWaiting means pod number does not match the min pods required
	ErrorWaiting = fmt.Errorf("waiting")
	// ErrorResourceNotEnough means cluster resource is not enough, mainly used in Pre-Filter
	ErrorResourceNotEnough = fmt.Errorf("resource not enough")
)

Functions

func CovertPolicy

func CovertPolicy(dp []v1alpha1.SchedulePolicy) map[string]int32

func GetClusterID

func GetClusterID(node *corev1.Node) string

GetClusterID return the cluster in node label

func IsVirtualNode

func IsVirtualNode(node *corev1.Node) bool

IsVirtualNode defines if a node is virtual node

func IsVirtualPod

func IsVirtualPod(pod *corev1.Pod) bool

IsVirtualPod defines if a pod is virtual pod

func Until

func Until(ctx context.Context, pieces int, doWorkPiece workqueue.DoWorkPieceFunc)

Until is a wrapper around workqueue.ParallelizeUntil to use in scheduling algorithms.

Types

type ClustersNodeSelection

type ClustersNodeSelection struct {
	NodeSelector map[string]string   `json:"nodeSelector,omitempty"`
	Affinity     *corev1.Affinity    `json:"affinity,omitempty"`
	Tolerations  []corev1.Toleration `json:"tolerations,omitempty"`
}

ClustersNodeSelection is a struct including some scheduling parameters

func ConvertAnnotations

func ConvertAnnotations(annotation map[string]string) *ClustersNodeSelection

ConvertAnnotations converts annotations to ClustersNodeSelection

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL