Documentation
¶
Index ¶
- func NewNodeController(kubeClient client.Client, cluster *Cluster) corecontroller.Controller
- func NewPodController(kubeClient client.Client, cluster *Cluster) corecontroller.Controller
- func NewProvisionerController(kubeClient client.Client, cluster *Cluster) corecontroller.Controller
- type Cluster
- func (c *Cluster) AddNominatedNodeEvictionObserver(f observerFunc)
- func (c *Cluster) ClusterConsolidationState() int64
- func (c *Cluster) DeleteNode(nodeName string)
- func (c *Cluster) DeletePod(podKey types.NamespacedName)
- func (c *Cluster) ForEachNode(f func(n *Node) bool)
- func (c *Cluster) ForPodsWithAntiAffinity(fn func(p *v1.Pod, n *v1.Node) bool)
- func (c *Cluster) IsNodeNominated(nodeName string) bool
- func (c *Cluster) LastNodeCreationTime() time.Time
- func (c *Cluster) LastNodeDeletionTime() time.Time
- func (c *Cluster) MarkForDeletion(nodeNames ...string)
- func (c *Cluster) NominateNodeForPod(nodeName string)
- func (c *Cluster) Reset(ctx context.Context)
- func (c *Cluster) UnmarkForDeletion(nodeNames ...string)
- func (c *Cluster) UpdateNode(ctx context.Context, node *v1.Node) error
- func (c *Cluster) UpdatePod(ctx context.Context, pod *v1.Pod) error
- type Node
- type NodeController
- type PodController
- type ProvisionerController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNodeController ¶
func NewNodeController(kubeClient client.Client, cluster *Cluster) corecontroller.Controller
NewNodeController constructs a controller instance
func NewPodController ¶
func NewPodController(kubeClient client.Client, cluster *Cluster) corecontroller.Controller
func NewProvisionerController ¶
func NewProvisionerController(kubeClient client.Client, cluster *Cluster) corecontroller.Controller
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(ctx context.Context, clk clock.Clock, client client.Client, cp cloudprovider.CloudProvider) *Cluster
func (*Cluster) AddNominatedNodeEvictionObserver ¶
func (c *Cluster) AddNominatedNodeEvictionObserver(f observerFunc)
AddNominatedNodeEvictionObserver adds an observer function to be called when any cache entry from the nominatedNodes cache expires
func (*Cluster) ClusterConsolidationState ¶
ClusterConsolidationState returns a number representing the state of the cluster with respect to consolidation. If consolidation can't occur and this number hasn't changed, there is no point in re-attempting consolidation. This allows reducing overall CPU utilization by pausing consolidation when the cluster is in a static state.
func (*Cluster) DeleteNode ¶
func (*Cluster) DeletePod ¶
func (c *Cluster) DeletePod(podKey types.NamespacedName)
deletePod is called when the pod has been deleted
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 ¶
IsNodeNominated returns true if the given node was expected to have a pod bound to it during a recent scheduling batch
func (*Cluster) LastNodeCreationTime ¶
LastNodeCreationTime returns the last time that at a node was created.
func (*Cluster) LastNodeDeletionTime ¶
LastNodeDeletionTime returns the last time that at a node was marked for deletion.
func (*Cluster) MarkForDeletion ¶
MarkForDeletion marks the node as pending deletion in the internal cluster state
func (*Cluster) NominateNodeForPod ¶
NominateNodeForPod records that a node was the target of a pending pod during a scheduling batch
func (*Cluster) UnmarkForDeletion ¶
UnmarkForDeletion removes the marking on the node as a node the controller intends to delete
func (*Cluster) UpdateNode ¶
updateNode is called for every node reconciliation
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
// MarkedForDeletion marks this node to say that there is some controller that is
// planning to delete this node so consider pods that are present on it available for scheduling
MarkedForDeletion bool
// 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. +k8s:deepcopy-gen=true
func (*Node) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Node.
func (*Node) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
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 (*NodeController) Builder ¶
func (c *NodeController) Builder(_ context.Context, m manager.Manager) corecontroller.Builder
func (*NodeController) Name ¶
func (c *NodeController) Name() string
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 (*PodController) Builder ¶
func (c *PodController) Builder(_ context.Context, m manager.Manager) corecontroller.Builder
func (*PodController) Name ¶
func (c *PodController) Name() string
type ProvisionerController ¶
type ProvisionerController struct {
// contains filtered or unexported fields
}
ProvisionerController reconciles provisioners to re-trigger consolidation on change.
func (*ProvisionerController) Builder ¶
func (c *ProvisionerController) Builder(_ context.Context, m manager.Manager) corecontroller.Builder
func (*ProvisionerController) Name ¶
func (c *ProvisionerController) Name() string
func (*ProvisionerController) Reconcile ¶
func (c *ProvisionerController) Reconcile(_ context.Context, _ *v1alpha5.Provisioner) (reconcile.Result, error)