grpalloc

package
v0.0.0-...-d4c0b77 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputePodGroupResources

func ComputePodGroupResources(n *types.NodeInfo, spec *types.PodInfo, bRemovePod bool) (
	podResources types.ResourceList, updatedUsedByNode types.ResourceList)

ComputePodGroupResources returns resources needed by pod & updated node resources

func PodClearAllocateFrom

func PodClearAllocateFrom(spec *types.PodInfo)

func PodFitsGroupConstraints

func PodFitsGroupConstraints(n *types.NodeInfo, spec *types.PodInfo, allocating bool) (bool, []sctypes.PredicateFailureReason, float64)

PodFitsGroupConstraints tells if pod fits constraints, score returned is score of running containers

func ReturnPodGroupResource

func ReturnPodGroupResource(n *types.NodeInfo, spec *types.PodInfo)

ReturnPodGroupResource returns pod resource to node, pod removed

func TakePodGroupResource

func TakePodGroupResource(n *types.NodeInfo, spec *types.PodInfo)

TakePodGroupResource takes pod resource from node, pod added

Types

type GrpAllocator

type GrpAllocator struct {
	// Global read info for all
	ContName      string
	InitContainer bool
	PreferUsed    bool
	// required resource and scorer
	RequiredResource map[string]int64
	ReqScorer        map[string]scorer.ResourceScoreFunc
	// allocatable resource and scorer
	AllocResource map[string]int64
	AllocScorer   map[string]scorer.ResourceScoreFunc

	// Global read/write info
	UsedGroups map[string]bool

	// Per group info, read only
	// Resource Info - required
	GrpRequiredResource map[string]string
	IsReqSubGrp         map[string]bool
	// Resource Info - allocatable
	GrpAllocResource map[string](map[string]string)
	IsAllocSubGrp    map[string]bool
	// other nodeinfo
	ReqBaseGroupName     string
	AllocBaseGroupPrefix string

	// Used Info, write as group is explored
	Score        float64
	PodResource  map[string]int64
	NodeResource map[string]int64
	AllocateFrom map[string]string
}

GrpAllocator is the type to perform group allocations

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL