scheduler

package
Version: v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resource

type Resource struct {
	MilliCPU int64
	Memory   int64
}

Resource is a collection of compute resource.

func ComputePodResourceRequest

func ComputePodResourceRequest(pod *v1.Pod) *Resource

ComputePodResourceRequest returns a framework.Resource that covers the largest width in each resource dimension. Because init-containers run sequentially, we collect the max in each dimension iteratively. In contrast, we sum the resource vectors for regular containers since they run simultaneously.

If Pod Overhead is specified, the resources defined for Overhead are added to the calculated Resource request sum

Example:

Pod:

InitContainers
  IC1:
    CPU: 2
    Memory: 1G
  IC2:
    CPU: 2
    Memory: 3G
Containers
  C1:
    CPU: 2
    Memory: 1G
  C2:
    CPU: 1
    Memory: 1G

Result: CPU: 3, Memory: 3G

func (*Resource) Add

func (r *Resource) Add(rl v1.ResourceList)

Add adds ResourceList into Resource.

func (*Resource) SetMaxResource

func (r *Resource) SetMaxResource(rl v1.ResourceList)

SetMaxResource compares with ResourceList and takes max value for each Resource.

Source Files

Jump to

Keyboard shortcuts

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