Documentation ¶
Index ¶
- type Metrics
- type Node
- func (node *Node) BindPod(clock clock.Clock, v1Pod *v1.Pod) (*pod.Pod, error)
- func (node *Node) DeletePod(clock clock.Clock, podNamespace, podName string) bool
- func (node *Node) GCTerminatedPods(clock clock.Clock)
- func (node *Node) Metrics(clock clock.Clock) Metrics
- func (node *Node) Pod(namespace, name string) *pod.Pod
- func (node *Node) PodList() []*pod.Pod
- func (node *Node) PodsNum(clock clock.Clock) int64
- func (node *Node) ToNodeInfo(clock clock.Clock) (*nodeinfo.NodeInfo, error)
- func (node *Node) ToV1() *v1.Node
- func (node *Node) Unschedulable()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metrics ¶
type Metrics struct { Allocatable v1.ResourceList RunningPodsNum int64 TerminatingPodsNum int64 FailedPodsNum int64 TotalResourceRequest v1.ResourceList TotalResourceUsage v1.ResourceList }
Metrics is a metrics of a Node at one point of time.
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
Node represents a simulated computing node.
func (*Node) BindPod ¶
BindPod accepts the given pod and try to start it. The pod will fail to be started if there is not sufficient resources. Returns the bound pod in pod.Pod representation, or error if the pod has invalid name or failed to create a simulated pod.
func (*Node) DeletePod ¶
DeletePod start deleting the given pod from this Node. Returns true if the pod is found in this Node, or false otherwise.
func (*Node) GCTerminatedPods ¶
GCTerminatedPods deletes terminated or deleted pods at the given clock from this Node.
func (*Node) Pod ¶
Pod returns the *pod.Pod by name that was accepted on this node. The returned pod may have failed to be started. Returns nil if the pod is not found.
func (*Node) PodList ¶
PodList returns a list of all pods that were accepted on this Node and not terminated nor deleted. Each of the returned pods may have failed to be started.
func (*Node) PodsNum ¶
PodsNum returns the number of all running or terminating pods on this Node at the given clock.
func (*Node) ToNodeInfo ¶
ToNodeInfo creates *nodeinfo.NodeInfo object from this Node.
func (*Node) Unschedulable ¶
func (node *Node) Unschedulable()