Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster maintains cluster state that is often needed but expensive to compute.
func NewCluster ¶
func NewCluster(cfg config.Config, client client.Client, cp cloudprovider.CloudProvider) *Cluster
func (*Cluster) ForEachNode ¶
ForEachNode calls the supplied function once per node object that is being tracked. It is not safe to store the state.Node object, it should be only accessed from within the function provided to this method.
func (*Cluster) ForPodsWithAntiAffinity ¶
ForPodsWithAntiAffinity calls the supplied function once for each pod with required anti affinity terms that is currently bound to a node. The pod returned may not be up-to-date with respect to status, however since the anti-affinity terms can't be modified, they will be correct.
func (*Cluster) IsNodeNominated ¶ added in v0.14.0
IsNodeNominated returns true if the given node was expected to have a pod bound to it during a recent scheduling batch
func (*Cluster) NominateNodeForPod ¶ added in v0.14.0
NominateNodeForPod records that a node was the target of a pending pod during a scheduling batch
func (*Cluster) Synchronized ¶ added in v0.14.0
clusterStateSynchronized ensures that our cluster state is aware of at least all of the nodes that our list cache has. Since we launch nodes in parallel, we can create many node objects which may not all be reconciled by the cluster state before we start trying to schedule again. In this case, we would over-provision as we weren't aware of the inflight nodes.
type Node ¶
type Node struct {
Node *v1.Node
// Capacity is the total resources on the node.
Capacity v1.ResourceList
// Allocatable is the total amount of resources on the node after os overhead.
Allocatable v1.ResourceList
// Available is allocatable minus anything allocated to pods.
Available v1.ResourceList
// Available is the total amount of resources that are available on the node. This is the Allocatable minus the
// resources requested by all pods bound to the node.
// DaemonSetRequested is the total amount of resources that have been requested by daemon sets. This allows users
// of the Node to identify the remaining resources that we expect future daemonsets to consume. This is already
// included in the calculation for Available.
DaemonSetRequested v1.ResourceList
DaemonSetLimits v1.ResourceList
// HostPort usage of all pods that are bound to the node
HostPortUsage *scheduling.HostPortUsage
VolumeUsage *scheduling.VolumeLimits
VolumeLimits scheduling.VolumeCount
// PodTotalRequests is the total resources on pods scheduled to this node
PodTotalRequests v1.ResourceList
// PodTotalLimits is the total resource limits scheduled to this node
PodTotalLimits v1.ResourceList
// contains filtered or unexported fields
}
Node is a cached version of a node in the cluster that maintains state which is expensive to compute every time it's needed. This currently contains node utilization across all the allocatable resources, but will soon be used to compute topology information.
type NodeController ¶
type NodeController struct {
// contains filtered or unexported fields
}
NodeController reconciles nodes for the purpose of maintaining state regarding nodes that is expensive to compute.
func NewNodeController ¶
func NewNodeController(kubeClient client.Client, cluster *Cluster) *NodeController
NewNodeController constructs a controller instance
type PodController ¶
type PodController struct {
// contains filtered or unexported fields
}
PodController reconciles pods for the purpose of maintaining state regarding pods that is expensive to compute.
func NewPodController ¶
func NewPodController(kubeClient client.Client, cluster *Cluster) *PodController