Documentation ¶
Index ¶
- Constants
- func CalculateNodesTotalCapacityAndAllocatable(nodes []v1.Node) (map[v1.ResourceName]resource.Quantity, map[v1.ResourceName]resource.Quantity)
- func CalculatePodsTotalRequestsAndLimits(pods []v1.Pod) (map[v1.ResourceName]resource.Quantity, map[v1.ResourceName]resource.Quantity)
- func GetNodeStatus(node v1.Node) string
- func NodeCapacityAndAllocatable(node v1.Node) (map[v1.ResourceName]resource.Quantity, map[v1.ResourceName]resource.Quantity)
- type NodeSummary
- type Resource
- type Summary
Constants ¶
const ( StatusReady = "Ready" StatusNotReady = "Not ready" StatusUnknown = "Unknown" )
Variables ¶
This section is empty.
Functions ¶
func CalculateNodesTotalCapacityAndAllocatable ¶
func CalculateNodesTotalCapacityAndAllocatable(nodes []v1.Node) (map[v1.ResourceName]resource.Quantity, map[v1.ResourceName]resource.Quantity)
CalculateNodesTotalCapacityAndAllocatable calculates capacity and allocatable resources of the given nodes.
func CalculatePodsTotalRequestsAndLimits ¶
func CalculatePodsTotalRequestsAndLimits(pods []v1.Pod) (map[v1.ResourceName]resource.Quantity, map[v1.ResourceName]resource.Quantity)
CalculatePodsTotalRequestsAndLimits calculates resource requests and limits of the given pods.
func GetNodeStatus ¶
GetNodeStatus returns the node's actual status.
func NodeCapacityAndAllocatable ¶
func NodeCapacityAndAllocatable(node v1.Node) (map[v1.ResourceName]resource.Quantity, map[v1.ResourceName]resource.Quantity)
NodeCapacityAndAllocatable calculates capacity and allocatable resources for a node.
Types ¶
type NodeSummary ¶
NodeSummary describes a node's resource summary with CPU and Memory capacity/request/limit/allocatable.
func CalculateNodeSummary ¶
func CalculateNodeSummary(node v1.Node, requests, limits map[v1.ResourceName]resource.Quantity) NodeSummary
CalculateNodeSummary returns NodeSummary type with the given data.
func GetNodeSummary ¶
func GetNodeSummary(ctx context.Context, client kubernetes.Interface, node v1.Node) (*NodeSummary, error)
GetNodeSummary returns resource summary for the given node.
type Summary ¶
Summary describes a resource summary with CPU and Memory capacity/request/limit/allocatable.
func GetSummary ¶
func GetSummary(capacity, allocatable, requests, limits map[v1.ResourceName]resource.Quantity) Summary
GetSummary returns Summary type with the given data.
func GetTotalSummary ¶
GetTotalSummary calculates all resource summary for a cluster.
func NewSummary ¶
func NewSummary() Summary
NewSummary creates a new Summary with default zero values.