Documentation
¶
Index ¶
- Constants
- Variables
- type Plugin
- func (p *Plugin) Calculate(strategy *configuration.ColocationStrategy, node *corev1.Node, ...) ([]framework.ResourceItem, error)
- func (p *Plugin) Name() string
- func (p *Plugin) NeedSync(strategy *configuration.ColocationStrategy, oldNode, newNode *corev1.Node) (bool, string)
- func (p *Plugin) Prepare(_ *configuration.ColocationStrategy, node *corev1.Node, ...) error
- func (p *Plugin) Reset(node *corev1.Node, message string) []framework.ResourceItem
Constants ¶
View Source
const PluginName = "MidResource"
Variables ¶
View Source
var ResourceNames = []corev1.ResourceName{extension.MidCPU, extension.MidMemory}
ResourceNames defines the Mid-tier extended resource names to update.
Functions ¶
This section is empty.
Types ¶
type Plugin ¶
type Plugin struct{}
func (*Plugin) Calculate ¶
func (p *Plugin) Calculate(strategy *configuration.ColocationStrategy, node *corev1.Node, podList *corev1.PodList, metrics *framework.ResourceMetrics) ([]framework.ResourceItem, error)
Calculate calculates Mid resources using the formula below: if midReclaimMode = "static": NodeReclaimable[Mid] = NodeCapacity * staticReservedRatio else: NodeReclaimable[Mid] = min(NodeMetricReclaimable[Mid], NodeUnused) + Unallocated[Mid] * midUnallocatedRatio Allocatable[Mid] = min(NodeReclaimable[Mid], NodeAllocatable * midThresholdRatio)
func (*Plugin) NeedSync ¶
func (p *Plugin) NeedSync(strategy *configuration.ColocationStrategy, oldNode, newNode *corev1.Node) (bool, string)
func (*Plugin) Prepare ¶ added in v1.4.0
func (p *Plugin) Prepare(_ *configuration.ColocationStrategy, node *corev1.Node, nr *framework.NodeResource) error
Click to show internal directories.
Click to hide internal directories.