Documentation ¶
Index ¶
- Constants
- func New(_ runtime.Object, h framework.Handle) (framework.Plugin, error)
- type Idleness
- func (r *Idleness) Name() string
- func (r *Idleness) NormalizeScore(ctx context.Context, state *framework.CycleState, p *v1.Pod, ...) *framework.Status
- func (r *Idleness) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (score int64, status *framework.Status)
- func (r *Idleness) ScoreExtensions() framework.ScoreExtensions
- type IdlenessPolicy
- type Resource
- func (r *Resource) Add(rl v1.ResourceList)
- func (r *Resource) AddScalar(name v1.ResourceName, quantity int64)
- func (r *Resource) Clone() *Resource
- func (r *Resource) ResourceList() v1.ResourceList
- func (r *Resource) SetMaxResource(rl v1.ResourceList)
- func (r *Resource) SetScalar(name v1.ResourceName, quantity int64)
Constants ¶
View Source
const ( // Name is the name of the plugin used in Registry and configurations. Name = "Idleness" ScaledResourceName = "aliyun.com/gpu-mem" BinpackEnabled = "xxx.com/binpack-enabled" IdlenessPolicyAnnotation = "xxx.com/idleness-policy" ResourceTypeCpu = "cpu" ResourceTypeMem = "memory" ResourceTypeGpu = "gpu" True = "true" Binpack IdlenessPolicy = "binpack" // 极端聚集 Spread IdlenessPolicy = "spread" // 极端打散 Balanced IdlenessPolicy = "binpack2.0" // binpack 2.0 均衡 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Idleness ¶
type Idleness struct {
// contains filtered or unexported fields
}
func (*Idleness) NormalizeScore ¶
func (*Idleness) ScoreExtensions ¶
func (r *Idleness) ScoreExtensions() framework.ScoreExtensions
type IdlenessPolicy ¶
type IdlenessPolicy string
type Resource ¶
type Resource struct { MilliCPU int64 Memory int64 EphemeralStorage int64 // We store allowedPodNumber (which is Node.Status.Allocatable.Pods().Value()) // explicitly as int, to avoid conversions and improve performance. AllowedPodNumber int // ScalarResources ScalarResources map[v1.ResourceName]int64 }
Resource is a collection of compute resource.
func NewResource ¶
func NewResource(rl v1.ResourceList) *Resource
NewResource creates a Resource from ResourceList
func (*Resource) Add ¶
func (r *Resource) Add(rl v1.ResourceList)
Add adds ResourceList into Resource.
func (*Resource) AddScalar ¶
func (r *Resource) AddScalar(name v1.ResourceName, quantity int64)
AddScalar adds a resource by a scalar value of this resource.
func (*Resource) ResourceList ¶
func (r *Resource) ResourceList() v1.ResourceList
ResourceList returns a resource list of this resource.
func (*Resource) SetMaxResource ¶
func (r *Resource) SetMaxResource(rl v1.ResourceList)
SetMaxResource compares with ResourceList and takes max value for each Resource.
Click to show internal directories.
Click to hide internal directories.