{"modulePath":"github.com/bfallik/kubernetes","version":"v1.0.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package predicates\n\n## Functions\n\n```go\nfunc CheckPodsExceedingCapacity(pods []*api.Pod, capacity api.ResourceList) (fitting []*api.Pod, notFitting []*api.Pod)\n```\n\n```go\nfunc MapPodsToMachines(lister algorithm.PodLister) (map[string][]*api.Pod, error)\n```\nMapPodsToMachines obtains a list of pods and pivots that list into a map where the keys are host names and the values are the list of pods running on that host.\n\n```go\nfunc NewNodeLabelPredicate(info NodeInfo, labels []string, presence bool) algorithm.FitPredicate\n```\n\n```go\nfunc NewResourceFitPredicate(info NodeInfo) algorithm.FitPredicate\n```\n\n```go\nfunc NewSelectorMatchPredicate(info NodeInfo) algorithm.FitPredicate\n```\n\n```go\nfunc NewServiceAffinityPredicate(podLister algorithm.PodLister, serviceLister algorithm.ServiceLister, nodeInfo NodeInfo, labels []string) algorithm.FitPredicate\n```\n\n```go\nfunc NoDiskConflict(pod *api.Pod, existingPods []*api.Pod, node string) (bool, error)\n```\nNoDiskConflict evaluates if a pod can fit due to the volumes it requests, and those that are already mounted. Some times of volumes are mounted onto node machines.  For now, these mounts are exclusive so if there is already a volume mounted on that node, another pod can't schedule there. This is GCE specific for now. TODO: migrate this into some per-volume specific code?\n\n```go\nfunc PodFitsHost(pod *api.Pod, existingPods []*api.Pod, node string) (bool, error)\n```\n\n```go\nfunc PodFitsPorts(pod *api.Pod, existingPods []*api.Pod, node string) (bool, error)\n```\n\n```go\nfunc PodMatchesNodeLabels(pod *api.Pod, node *api.Node) bool\n```\n\n## Types\n\n```go\ntype ClientNodeInfo struct {\n\t*client.Client\n}\n```\n\n```go\nfunc (nodes ClientNodeInfo) GetNodeInfo(nodeID string) (*api.Node, error)\n```\n\n```go\ntype NodeInfo interface {\n\tGetNodeInfo(nodeID string) (*api.Node, error)\n}\n```\n\n```go\ntype NodeLabelChecker struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (n *NodeLabelChecker) CheckNodeLabelPresence(pod *api.Pod, existingPods []*api.Pod, node string) (bool, error)\n```\nCheckNodeLabelPresence checks whether all of the specified labels exists on a minion or not, regardless of their value If \"presence\" is false, then returns false if any of the requested labels matches any of the minion's labels, otherwise returns true. If \"presence\" is true, then returns false if any of the requested labels does not match any of the minion's labels, otherwise returns true.\n\nConsider the cases where the minions are placed in regions/zones/racks and these are identified by labels In some cases, it is required that only minions that are part of ANY of the defined regions/zones/racks be selected\n\nAlternately, eliminating minions that have a certain label, regardless of value, is also useful A minion 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 minion\n\n```go\ntype NodeSelector struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (n *NodeSelector) PodSelectorMatches(pod *api.Pod, existingPods []*api.Pod, node string) (bool, error)\n```\n\n```go\ntype ResourceFit struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (r *ResourceFit) PodFitsResources(pod *api.Pod, existingPods []*api.Pod, node string) (bool, error)\n```\nPodFitsResources calculates fit based on requested, rather than used resources\n\n```go\ntype ServiceAffinity struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (s *ServiceAffinity) CheckServiceAffinity(pod *api.Pod, existingPods []*api.Pod, node string) (bool, error)\n```\nCheckServiceAffinity ensures that only the minions that match the specified labels are considered for scheduling. The set of labels to be considered are provided to the struct (ServiceAffinity). The pod is checked for the labels and any missing labels are then checked in the minion that hosts the service pods (peers) for the given pod.\n\nWe add an implicit selector requiring some particular value V for label L to a pod, if: - L is listed in the ServiceAffinity object that is passed into the function - the pod does not have any NodeSelector for L - some other pod from the same service is already scheduled onto a minion that has value V for label L\n\n```go\ntype StaticNodeInfo struct {\n\t*api.NodeList\n}\n```\n\n```go\nfunc (nodes StaticNodeInfo) GetNodeInfo(nodeID string) (*api.Node, error)\n```\n\n","path":"github.com/bfallik/kubernetes/plugin/pkg/scheduler/algorithm/predicates","name":"predicates","synopsis":"","isRedistributable":true}
