Documentation ¶
Index ¶
- Constants
- Variables
- func AddUnsetLabelsToMap(aL map[string]string, labelsToAdd []string, labelSet labels.Set)
- func CheckNodeConditionPredicate(pod *v1.Pod, meta algorithm.PredicateMetadata, ...) (bool, []algorithm.PredicateFailureReason, error)
- func CheckNodeDiskPressurePredicate(pod *v1.Pod, meta algorithm.PredicateMetadata, ...) (bool, []algorithm.PredicateFailureReason, error)
- func CheckNodeMemoryPressurePredicate(pod *v1.Pod, meta algorithm.PredicateMetadata, ...) (bool, []algorithm.PredicateFailureReason, error)
- func CreateSelectorFromLabels(aL map[string]string) labels.Selector
- func EssentialPredicates(pod *v1.Pod, meta algorithm.PredicateMetadata, ...) (bool, []algorithm.PredicateFailureReason, error)
- func FilterPodsByNamespace(pods []*v1.Pod, ns string) []*v1.Pod
- func FindLabelsInSet(labelsToKeep []string, selector labels.Set) map[string]string
- func GeneralPredicates(pod *v1.Pod, meta algorithm.PredicateMetadata, ...) (bool, []algorithm.PredicateFailureReason, error)
- func GetPodAffinityTerms(podAffinity *v1.PodAffinity) (terms []v1.PodAffinityTerm)
- func GetPodAntiAffinityTerms(podAntiAffinity *v1.PodAntiAffinity) (terms []v1.PodAffinityTerm)
- func GetResourceRequest(pod *v1.Pod) *schedulercache.Resource
- func NewEquivalencePodGenerator(pvcInfo PersistentVolumeClaimInfo) algorithm.GetEquivalencePodFunc
- func NewMaxPDVolumeCountPredicate(filterName string, pvInfo PersistentVolumeInfo, ...) algorithm.FitPredicate
- func NewNodeLabelPredicate(labels []string, presence bool) algorithm.FitPredicate
- func NewPodAffinityPredicate(info NodeInfo, podLister algorithm.PodLister) algorithm.FitPredicate
- func NewPredicateMetadataFactory(podLister algorithm.PodLister) algorithm.PredicateMetadataProducer
- func NewVolumeBindingPredicate(binder *volumebinder.VolumeBinder) algorithm.FitPredicate
- func NewVolumeZonePredicate(pvInfo PersistentVolumeInfo, pvcInfo PersistentVolumeClaimInfo, ...) algorithm.FitPredicate
- func NoDiskConflict(pod *v1.Pod, meta algorithm.PredicateMetadata, ...) (bool, []algorithm.PredicateFailureReason, error)
- func PodFitsHost(pod *v1.Pod, meta algorithm.PredicateMetadata, ...) (bool, []algorithm.PredicateFailureReason, error)
- func PodFitsHostPorts(pod *v1.Pod, meta algorithm.PredicateMetadata, ...) (bool, []algorithm.PredicateFailureReason, error)
- func PodFitsResources(pod *v1.Pod, meta algorithm.PredicateMetadata, ...) (bool, []algorithm.PredicateFailureReason, error)
- func PodMatchNodeSelector(pod *v1.Pod, meta algorithm.PredicateMetadata, ...) (bool, []algorithm.PredicateFailureReason, error)
- func PodToleratesNodeNoExecuteTaints(pod *v1.Pod, meta algorithm.PredicateMetadata, ...) (bool, []algorithm.PredicateFailureReason, error)
- func PodToleratesNodeTaints(pod *v1.Pod, meta algorithm.PredicateMetadata, ...) (bool, []algorithm.PredicateFailureReason, error)
- func RegisterPredicateMetadataProducer(predicateName string, precomp PredicateMetadataProducer)
- type CachedNodeInfo
- type CachedPersistentVolumeClaimInfo
- type CachedPersistentVolumeInfo
- type CachedStorageClassInfo
- type EquivalencePod
- type EquivalencePodGenerator
- type FailureReason
- type FakeNodeInfo
- type FakeNodeListInfo
- type FakePersistentVolumeClaimInfo
- type FakePersistentVolumeInfo
- type FakeStorageClassInfo
- type InsufficientResourceError
- type MaxPDVolumeCountChecker
- type NodeInfo
- type NodeLabelChecker
- type PersistentVolumeClaimInfo
- type PersistentVolumeInfo
- type PodAffinityChecker
- type PredicateFailureError
- type PredicateMetadataFactory
- type PredicateMetadataProducer
- type ServiceAffinity
- type StorageClassInfo
- type VolumeBindingChecker
- type VolumeFilter
- type VolumeZoneChecker
Examples ¶
Constants ¶
const ( MatchInterPodAffinity = "MatchInterPodAffinity" CheckVolumeBinding = "CheckVolumeBinding" // DefaultMaxGCEPDVolumes defines the maximum number of PD Volumes for GCE // GCE instances can have up to 16 PD volumes attached. DefaultMaxGCEPDVolumes = 16 // DefaultMaxAzureDiskVolumes defines the maximum number of PD Volumes for Azure // Larger Azure VMs can actually have much more disks attached. // TODO We should determine the max based on VM size DefaultMaxAzureDiskVolumes = 16 // KubeMaxPDVols defines the maximum number of PD Volumes per kubelet KubeMaxPDVols = "KUBE_MAX_PD_VOLS" // for EBSVolumeFilter EBSVolumeFilterType = "EBS" // for GCEPDVolumeFilter GCEPDVolumeFilterType = "GCE" // for AzureDiskVolumeFilter AzureDiskVolumeFilterType = "AzureDisk" )
Variables ¶
var ( // NOTE: If you add a new predicate failure error for a predicate that can never // be made to pass by removing pods, or you change an existing predicate so that // it can never be made to pass by removing pods, you need to add the predicate // failure error in nodesWherePreemptionMightHelp() in scheduler/core/generic_scheduler.go ErrDiskConflict = newPredicateFailureError("NoDiskConflict") ErrVolumeZoneConflict = newPredicateFailureError("NoVolumeZoneConflict") ErrNodeSelectorNotMatch = newPredicateFailureError("MatchNodeSelector") ErrPodAffinityNotMatch = newPredicateFailureError("MatchInterPodAffinity") ErrPodAffinityRulesNotMatch = newPredicateFailureError("PodAffinityRulesNotMatch") ErrPodAntiAffinityRulesNotMatch = newPredicateFailureError("PodAntiAffinityRulesNotMatch") ErrExistingPodsAntiAffinityRulesNotMatch = newPredicateFailureError("ExistingPodsAntiAffinityRulesNotMatch") ErrTaintsTolerationsNotMatch = newPredicateFailureError("PodToleratesNodeTaints") ErrPodNotMatchHostName = newPredicateFailureError("HostName") ErrPodNotFitsHostPorts = newPredicateFailureError("PodFitsHostPorts") ErrNodeLabelPresenceViolated = newPredicateFailureError("CheckNodeLabelPresence") ErrServiceAffinityViolated = newPredicateFailureError("CheckServiceAffinity") ErrMaxVolumeCountExceeded = newPredicateFailureError("MaxVolumeCount") ErrNodeUnderMemoryPressure = newPredicateFailureError("NodeUnderMemoryPressure") ErrNodeUnderDiskPressure = newPredicateFailureError("NodeUnderDiskPressure") ErrNodeOutOfDisk = newPredicateFailureError("NodeOutOfDisk") ErrNodeNotReady = newPredicateFailureError("NodeNotReady") ErrNodeUnschedulable = newPredicateFailureError("NodeUnschedulable") ErrNodeUnknownCondition = newPredicateFailureError("NodeUnknownCondition") ErrVolumeNodeConflict = newPredicateFailureError("VolumeNodeAffinityConflict") ErrVolumeBindConflict = newPredicateFailureError("VolumeBindingNoMatch") // ErrFakePredicate is used for test only. The fake predicates returning false also returns error // as ErrFakePredicate. ErrFakePredicate = newPredicateFailureError("FakePredicateError") )
Functions ¶
func AddUnsetLabelsToMap ¶ added in v1.5.0
AddUnsetLabelsToMap backfills missing values with values we find in a map.
func CheckNodeConditionPredicate ¶ added in v1.8.0
func CheckNodeConditionPredicate(pod *v1.Pod, meta algorithm.PredicateMetadata, nodeInfo *schedulercache.NodeInfo) (bool, []algorithm.PredicateFailureReason, error)
CheckNodeConditionPredicate checks if a pod can be scheduled on a node reporting out of disk, network unavailable and not ready condition. Only node conditions are accounted in this predicate.
func CheckNodeDiskPressurePredicate ¶ added in v1.4.0
func CheckNodeDiskPressurePredicate(pod *v1.Pod, meta algorithm.PredicateMetadata, nodeInfo *schedulercache.NodeInfo) (bool, []algorithm.PredicateFailureReason, error)
CheckNodeDiskPressurePredicate checks if a pod can be scheduled on a node reporting disk pressure condition.
func CheckNodeMemoryPressurePredicate ¶ added in v1.3.0
func CheckNodeMemoryPressurePredicate(pod *v1.Pod, meta algorithm.PredicateMetadata, nodeInfo *schedulercache.NodeInfo) (bool, []algorithm.PredicateFailureReason, error)
CheckNodeMemoryPressurePredicate checks if a pod can be scheduled on a node reporting memory pressure condition.
func CreateSelectorFromLabels ¶ added in v1.5.0
CreateSelectorFromLabels is used to define a selector that corresponds to the keys in a map.
func EssentialPredicates ¶ added in v1.6.0
func EssentialPredicates(pod *v1.Pod, meta algorithm.PredicateMetadata, nodeInfo *schedulercache.NodeInfo) (bool, []algorithm.PredicateFailureReason, error)
EssentialPredicates are the predicates that all pods, including critical pods, need
func FilterPodsByNamespace ¶ added in v1.5.0
FilterPodsByNamespace filters pods outside a namespace from the given list.
func FindLabelsInSet ¶ added in v1.5.0
FindLabelsInSet gets as many key/value pairs as possible out of a label set.
Example ¶
ExampleUtils is a https://blog.golang.org/examples styled unit test.
labelSubset := labels.Set{} labelSubset["label1"] = "value1" labelSubset["label2"] = "value2" // Lets make believe that these pods are on the cluster. // Utility functions will inspect their labels, filter them, and so on. nsPods := []*v1.Pod{ { ObjectMeta: metav1.ObjectMeta{ Name: "pod1", Namespace: "ns1", Labels: map[string]string{ "label1": "wontSeeThis", "label2": "wontSeeThis", "label3": "will_see_this", }, }, }, // first pod which will be used via the utilities { ObjectMeta: metav1.ObjectMeta{ Name: "pod2", Namespace: "ns1", }, }, { ObjectMeta: metav1.ObjectMeta{ Name: "pod3ThatWeWontSee", }, }, } fmt.Println(FindLabelsInSet([]string{"label1", "label2", "label3"}, nsPods[0].ObjectMeta.Labels)["label3"]) AddUnsetLabelsToMap(labelSubset, []string{"label1", "label2", "label3"}, nsPods[0].ObjectMeta.Labels) fmt.Println(labelSubset) for _, pod := range FilterPodsByNamespace(nsPods, "ns1") { fmt.Print(pod.Name, ",") }
Output: will_see_this label1=value1,label2=value2,label3=will_see_this pod1,pod2,
func GeneralPredicates ¶ added in v1.3.0
func GeneralPredicates(pod *v1.Pod, meta algorithm.PredicateMetadata, nodeInfo *schedulercache.NodeInfo) (bool, []algorithm.PredicateFailureReason, error)
GeneralPredicates checks whether noncriticalPredicates and EssentialPredicates pass. noncriticalPredicates are the predicates that only non-critical pods need and EssentialPredicates are the predicates that all pods, including critical pods, need
func GetPodAffinityTerms ¶ added in v1.9.0
func GetPodAffinityTerms(podAffinity *v1.PodAffinity) (terms []v1.PodAffinityTerm)
func GetPodAntiAffinityTerms ¶ added in v1.9.0
func GetPodAntiAffinityTerms(podAntiAffinity *v1.PodAntiAffinity) (terms []v1.PodAffinityTerm)
func GetResourceRequest ¶ added in v1.5.0
func GetResourceRequest(pod *v1.Pod) *schedulercache.Resource
GetResourceRequest returns a *schedulercache.Resource that covers the largest width in each resource dimension. Because init-containers run sequentially, we collect the max in each dimension iteratively. In contrast, we sum the resource vectors for regular containers since they run simultaneously.
Example:
Pod:
InitContainers IC1: CPU: 2 Memory: 1G IC2: CPU: 2 Memory: 3G Containers C1: CPU: 2 Memory: 1G C2: CPU: 1 Memory: 1G
Result: CPU: 3, Memory: 3G
func NewEquivalencePodGenerator ¶ added in v1.8.6
func NewEquivalencePodGenerator(pvcInfo PersistentVolumeClaimInfo) algorithm.GetEquivalencePodFunc
NewEquivalencePodGenerator returns a getEquivalencePod method with consideration of PVC info.
func NewMaxPDVolumeCountPredicate ¶ added in v1.2.0
func NewMaxPDVolumeCountPredicate(filterName string, pvInfo PersistentVolumeInfo, pvcInfo PersistentVolumeClaimInfo) algorithm.FitPredicate
NewMaxPDVolumeCountPredicate creates a predicate which evaluates whether a pod can fit based on the number of volumes which match a filter that it requests, and those that are already present.
The predicate looks for both volumes used directly, as well as PVC volumes that are backed by relevant volume types, counts the number of unique volumes, and rejects the new pod if it would place the total count over the maximum.
func NewNodeLabelPredicate ¶
func NewNodeLabelPredicate(labels []string, presence bool) algorithm.FitPredicate
func NewPodAffinityPredicate ¶ added in v1.3.0
func NewPodAffinityPredicate(info NodeInfo, podLister algorithm.PodLister) algorithm.FitPredicate
func NewPredicateMetadataFactory ¶ added in v1.5.0
func NewPredicateMetadataFactory(podLister algorithm.PodLister) algorithm.PredicateMetadataProducer
func NewVolumeBindingPredicate ¶ added in v1.9.0
func NewVolumeBindingPredicate(binder *volumebinder.VolumeBinder) algorithm.FitPredicate
NewVolumeBindingPredicate evaluates if a pod can fit due to the volumes it requests, for both bound and unbound PVCs.
For PVCs that are bound, then it checks that the corresponding PV's node affinity is satisfied by the given node.
For PVCs that are unbound, it tries to find available PVs that can satisfy the PVC requirements and that the PV node affinity is satisfied by the given node.
The predicate returns true if all bound PVCs have compatible PVs with the node, and if all unbound PVCs can be matched with an available and node-compatible PV.
func NewVolumeZonePredicate ¶ added in v1.2.0
func NewVolumeZonePredicate(pvInfo PersistentVolumeInfo, pvcInfo PersistentVolumeClaimInfo, classInfo StorageClassInfo) algorithm.FitPredicate
NewVolumeZonePredicate evaluates if a pod can fit due to the volumes it requests, given that some volumes may have zone scheduling constraints. The requirement is that any volume zone-labels must match the equivalent zone-labels on the node. It is OK for the node to have more zone-label constraints (for example, a hypothetical replicated volume might allow region-wide access)
Currently this is only supported with PersistentVolumeClaims, and looks to the labels only on the bound PersistentVolume.
Working with volumes declared inline in the pod specification (i.e. not using a PersistentVolume) is likely to be harder, as it would require determining the zone of a volume during scheduling, and that is likely to require calling out to the cloud provider. It seems that we are moving away from inline volume declarations anyway.
func NoDiskConflict ¶
func NoDiskConflict(pod *v1.Pod, meta algorithm.PredicateMetadata, nodeInfo *schedulercache.NodeInfo) (bool, []algorithm.PredicateFailureReason, error)
NoDiskConflict evaluates if a pod can fit due to the volumes it requests, and those that are already mounted. If there is already a volume mounted on that node, another pod that uses the same volume can't be scheduled there. This is GCE, Amazon EBS, and Ceph RBD specific for now: - GCE PD allows multiple mounts as long as they're all read-only - AWS EBS forbids any two pods mounting the same volume ID - Ceph RBD forbids if any two pods share at least same monitor, and match pool and image. - ISCSI forbids if any two pods share at least same IQN, LUN and Target TODO: migrate this into some per-volume specific code?
func PodFitsHost ¶
func PodFitsHost(pod *v1.Pod, meta algorithm.PredicateMetadata, nodeInfo *schedulercache.NodeInfo) (bool, []algorithm.PredicateFailureReason, error)
PodFitsHost checks if a pod spec node name matches the current node.
func PodFitsHostPorts ¶ added in v1.2.0
func PodFitsHostPorts(pod *v1.Pod, meta algorithm.PredicateMetadata, nodeInfo *schedulercache.NodeInfo) (bool, []algorithm.PredicateFailureReason, error)
PodFitsHostPorts checks if a node has free ports for the requested pod ports.
func PodFitsResources ¶ added in v1.3.0
func PodFitsResources(pod *v1.Pod, meta algorithm.PredicateMetadata, nodeInfo *schedulercache.NodeInfo) (bool, []algorithm.PredicateFailureReason, error)
PodFitsResources checks if a node has sufficient resources, such as cpu, memory, gpu, opaque int resources etc to run a pod. First return value indicates whether a node has sufficient resources to run a pod while the second return value indicates the predicate failure reasons if the node has insufficient resources to run the pod.
func PodMatchNodeSelector ¶ added in v1.7.0
func PodMatchNodeSelector(pod *v1.Pod, meta algorithm.PredicateMetadata, nodeInfo *schedulercache.NodeInfo) (bool, []algorithm.PredicateFailureReason, error)
PodMatchNodeSelector checks if a pod node selector matches the node label.
func PodToleratesNodeNoExecuteTaints ¶ added in v1.7.1
func PodToleratesNodeNoExecuteTaints(pod *v1.Pod, meta algorithm.PredicateMetadata, nodeInfo *schedulercache.NodeInfo) (bool, []algorithm.PredicateFailureReason, error)
PodToleratesNodeNoExecuteTaints checks if a pod tolerations can tolerate the node's NoExecute taints
func PodToleratesNodeTaints ¶ added in v1.4.0
func PodToleratesNodeTaints(pod *v1.Pod, meta algorithm.PredicateMetadata, nodeInfo *schedulercache.NodeInfo) (bool, []algorithm.PredicateFailureReason, error)
PodToleratesNodeTaints checks if a pod tolerations can tolerate the node taints
func RegisterPredicateMetadataProducer ¶ added in v1.8.0
func RegisterPredicateMetadataProducer(predicateName string, precomp PredicateMetadataProducer)
Types ¶
type CachedNodeInfo ¶ added in v1.2.0
type CachedNodeInfo struct {
corelisters.NodeLister
}
func (*CachedNodeInfo) GetNodeInfo ¶ added in v1.2.0
func (c *CachedNodeInfo) GetNodeInfo(id string) (*v1.Node, error)
GetNodeInfo returns cached data for the node 'id'.
type CachedPersistentVolumeClaimInfo ¶ added in v1.5.0
type CachedPersistentVolumeClaimInfo struct {
corelisters.PersistentVolumeClaimLister
}
CachedPersistentVolumeClaimInfo implements PersistentVolumeClaimInfo
func (*CachedPersistentVolumeClaimInfo) GetPersistentVolumeClaimInfo ¶ added in v1.5.0
func (c *CachedPersistentVolumeClaimInfo) GetPersistentVolumeClaimInfo(namespace string, name string) (*v1.PersistentVolumeClaim, error)
GetPersistentVolumeClaimInfo fetches the claim in specified namespace with specified name
type CachedPersistentVolumeInfo ¶ added in v1.6.0
type CachedPersistentVolumeInfo struct {
corelisters.PersistentVolumeLister
}
CachedPersistentVolumeInfo implements PersistentVolumeInfo
func (*CachedPersistentVolumeInfo) GetPersistentVolumeInfo ¶ added in v1.6.0
func (c *CachedPersistentVolumeInfo) GetPersistentVolumeInfo(pvID string) (*v1.PersistentVolume, error)
type CachedStorageClassInfo ¶ added in v1.9.0
type CachedStorageClassInfo struct {
storagelisters.StorageClassLister
}
CachedStorageClassInfo implements StorageClassInfo
func (*CachedStorageClassInfo) GetStorageClassInfo ¶ added in v1.9.0
func (c *CachedStorageClassInfo) GetStorageClassInfo(className string) (*storagev1.StorageClass, error)
type EquivalencePod ¶ added in v1.8.0
type EquivalencePod struct { ControllerRef metav1.OwnerReference PVCSet sets.String }
EquivalencePod is a group of pod attributes which can be reused as equivalence to schedule other pods.
type EquivalencePodGenerator ¶ added in v1.8.6
type EquivalencePodGenerator struct {
// contains filtered or unexported fields
}
EquivalencePodGenerator is a generator of equivalence class for pod with consideration of PVC info.
type FailureReason ¶ added in v1.4.0
type FailureReason struct {
// contains filtered or unexported fields
}
func NewFailureReason ¶ added in v1.4.0
func NewFailureReason(msg string) *FailureReason
func (*FailureReason) GetReason ¶ added in v1.4.0
func (e *FailureReason) GetReason() string
type FakeNodeInfo ¶ added in v1.8.6
func (FakeNodeInfo) GetNodeInfo ¶ added in v1.8.6
func (n FakeNodeInfo) GetNodeInfo(nodeName string) (*v1.Node, error)
type FakeNodeListInfo ¶ added in v1.8.6
func (FakeNodeListInfo) GetNodeInfo ¶ added in v1.8.6
func (nodes FakeNodeListInfo) GetNodeInfo(nodeName string) (*v1.Node, error)
type FakePersistentVolumeClaimInfo ¶ added in v1.8.6
type FakePersistentVolumeClaimInfo []v1.PersistentVolumeClaim
func (FakePersistentVolumeClaimInfo) GetPersistentVolumeClaimInfo ¶ added in v1.8.6
func (pvcs FakePersistentVolumeClaimInfo) GetPersistentVolumeClaimInfo(namespace string, pvcID string) (*v1.PersistentVolumeClaim, error)
type FakePersistentVolumeInfo ¶ added in v1.8.6
type FakePersistentVolumeInfo []v1.PersistentVolume
func (FakePersistentVolumeInfo) GetPersistentVolumeInfo ¶ added in v1.8.6
func (pvs FakePersistentVolumeInfo) GetPersistentVolumeInfo(pvID string) (*v1.PersistentVolume, error)
type FakeStorageClassInfo ¶ added in v1.9.0
type FakeStorageClassInfo []storagev1.StorageClass
func (FakeStorageClassInfo) GetStorageClassInfo ¶ added in v1.9.0
func (classes FakeStorageClassInfo) GetStorageClassInfo(name string) (*storagev1.StorageClass, error)
type InsufficientResourceError ¶ added in v1.2.0
type InsufficientResourceError struct { // resourceName is the name of the resource that is insufficient ResourceName v1.ResourceName // contains filtered or unexported fields }
InsufficientResourceError is an error type that indicates what kind of resource limit is hit and caused the unfitting failure.
func NewInsufficientResourceError ¶ added in v1.4.0
func NewInsufficientResourceError(resourceName v1.ResourceName, requested, used, capacity int64) *InsufficientResourceError
func (*InsufficientResourceError) Error ¶ added in v1.2.0
func (e *InsufficientResourceError) Error() string
func (*InsufficientResourceError) GetInsufficientAmount ¶ added in v1.6.0
func (e *InsufficientResourceError) GetInsufficientAmount() int64
func (*InsufficientResourceError) GetReason ¶ added in v1.4.0
func (e *InsufficientResourceError) GetReason() string
type MaxPDVolumeCountChecker ¶ added in v1.2.0
type MaxPDVolumeCountChecker struct {
// contains filtered or unexported fields
}
type NodeLabelChecker ¶
type NodeLabelChecker struct {
// contains filtered or unexported fields
}
func (*NodeLabelChecker) CheckNodeLabelPresence ¶
func (n *NodeLabelChecker) CheckNodeLabelPresence(pod *v1.Pod, meta algorithm.PredicateMetadata, nodeInfo *schedulercache.NodeInfo) (bool, []algorithm.PredicateFailureReason, error)
CheckNodeLabelPresence checks whether all of the specified labels exists on a node or not, regardless of their value If "presence" is false, then returns false if any of the requested labels matches any of the node's labels, otherwise returns true. If "presence" is true, then returns false if any of the requested labels does not match any of the node's labels, otherwise returns true.
Consider the cases where the nodes are placed in regions/zones/racks and these are identified by labels In some cases, it is required that only nodes that are part of ANY of the defined regions/zones/racks be selected
Alternately, eliminating nodes that have a certain label, regardless of value, is also useful A node may have a label with "retiring" as key and the date as the value and it may be desirable to avoid scheduling new pods on this node
type PersistentVolumeClaimInfo ¶ added in v1.2.0
type PersistentVolumeClaimInfo interface {
GetPersistentVolumeClaimInfo(namespace string, name string) (*v1.PersistentVolumeClaim, error)
}
type PersistentVolumeInfo ¶ added in v1.2.0
type PersistentVolumeInfo interface {
GetPersistentVolumeInfo(pvID string) (*v1.PersistentVolume, error)
}
type PodAffinityChecker ¶ added in v1.3.0
type PodAffinityChecker struct {
// contains filtered or unexported fields
}
func (*PodAffinityChecker) InterPodAffinityMatches ¶ added in v1.3.0
func (c *PodAffinityChecker) InterPodAffinityMatches(pod *v1.Pod, meta algorithm.PredicateMetadata, nodeInfo *schedulercache.NodeInfo) (bool, []algorithm.PredicateFailureReason, error)
InterPodAffinityMatches checks if a pod can be scheduled on the specified node with pod affinity/anti-affinity configuration. First return value indicates whether a pod can be scheduled on the specified node while the second return value indicates the predicate failure reasons if the pod cannot be scheduled on the specified node.
type PredicateFailureError ¶ added in v1.3.0
type PredicateFailureError struct {
PredicateName string
}
func (*PredicateFailureError) Error ¶ added in v1.3.0
func (e *PredicateFailureError) Error() string
func (*PredicateFailureError) GetReason ¶ added in v1.4.0
func (e *PredicateFailureError) GetReason() string
type PredicateMetadataFactory ¶ added in v1.5.0
type PredicateMetadataFactory struct {
// contains filtered or unexported fields
}
func (*PredicateMetadataFactory) GetMetadata ¶ added in v1.5.0
func (pfactory *PredicateMetadataFactory) GetMetadata(pod *v1.Pod, nodeNameToInfoMap map[string]*schedulercache.NodeInfo) algorithm.PredicateMetadata
GetMetadata returns the predicateMetadata used which will be used by various predicates.
type PredicateMetadataProducer ¶ added in v1.8.0
type PredicateMetadataProducer func(pm *predicateMetadata)
PredicateMetadataProducer: Helper types/variables...
func NewServiceAffinityPredicate ¶
func NewServiceAffinityPredicate(podLister algorithm.PodLister, serviceLister algorithm.ServiceLister, nodeInfo NodeInfo, labels []string) (algorithm.FitPredicate, PredicateMetadataProducer)
type ServiceAffinity ¶
type ServiceAffinity struct {
// contains filtered or unexported fields
}
type StorageClassInfo ¶ added in v1.9.0
type StorageClassInfo interface {
GetStorageClassInfo(className string) (*storagev1.StorageClass, error)
}
type VolumeBindingChecker ¶ added in v1.9.0
type VolumeBindingChecker struct {
// contains filtered or unexported fields
}
type VolumeFilter ¶ added in v1.2.0
type VolumeFilter struct { // Filter normal volumes FilterVolume func(vol *v1.Volume) (id string, relevant bool) FilterPersistentVolume func(pv *v1.PersistentVolume) (id string, relevant bool) }
VolumeFilter contains information on how to filter PD Volumes when checking PD Volume caps
var AzureDiskVolumeFilter VolumeFilter = VolumeFilter{ FilterVolume: func(vol *v1.Volume) (string, bool) { if vol.AzureDisk != nil { return vol.AzureDisk.DiskName, true } return "", false }, FilterPersistentVolume: func(pv *v1.PersistentVolume) (string, bool) { if pv.Spec.AzureDisk != nil { return pv.Spec.AzureDisk.DiskName, true } return "", false }, }
AzureDiskVolumeFilter is a VolumeFilter for filtering Azure Disk Volumes
var EBSVolumeFilter VolumeFilter = VolumeFilter{ FilterVolume: func(vol *v1.Volume) (string, bool) { if vol.AWSElasticBlockStore != nil { return vol.AWSElasticBlockStore.VolumeID, true } return "", false }, FilterPersistentVolume: func(pv *v1.PersistentVolume) (string, bool) { if pv.Spec.AWSElasticBlockStore != nil { return pv.Spec.AWSElasticBlockStore.VolumeID, true } return "", false }, }
EBSVolumeFilter is a VolumeFilter for filtering AWS ElasticBlockStore Volumes
var GCEPDVolumeFilter VolumeFilter = VolumeFilter{ FilterVolume: func(vol *v1.Volume) (string, bool) { if vol.GCEPersistentDisk != nil { return vol.GCEPersistentDisk.PDName, true } return "", false }, FilterPersistentVolume: func(pv *v1.PersistentVolume) (string, bool) { if pv.Spec.GCEPersistentDisk != nil { return pv.Spec.GCEPersistentDisk.PDName, true } return "", false }, }
GCEPDVolumeFilter is a VolumeFilter for filtering GCE PersistentDisk Volumes
type VolumeZoneChecker ¶ added in v1.2.0
type VolumeZoneChecker struct {
// contains filtered or unexported fields
}