capacity

package
v1.62.5 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidSpec = errors.New("Invalid InstanceClass spec")
	ErrNotFound    = errors.New("Instance Type not found")
)

Functions

func CalculateNodeTemplateCapacity

func CalculateNodeTemplateCapacity(instanceClassName string, instanceClassSpec interface{}, catalog *InstanceTypesCatalog) (*v1alpha1.InstanceType, error)

CalculateNodeTemplateCapacity calculates capacity of the node based on InstanceClass and it's spec

Types

type Capacity

type Capacity struct {
	CPU    resource.Quantity `json:"cpu,omitempty"`
	Memory resource.Quantity `json:"memory,omitempty"`
}

Capacity node capacity for autoscaler

func (*Capacity) ToInstanceType added in v1.46.0

func (c *Capacity) ToInstanceType() *v1alpha1.InstanceType

type InstanceTypesCatalog added in v1.46.0

type InstanceTypesCatalog struct {
	Types map[string]v1alpha1.InstanceType
}

func NewInstanceTypesCatalog added in v1.46.0

func NewInstanceTypesCatalog(types []v1alpha1.InstanceType) *InstanceTypesCatalog

func (*InstanceTypesCatalog) Get added in v1.46.0

func (c *InstanceTypesCatalog) Get(ic instanceClass) (*v1alpha1.InstanceType, error)

Jump to

Keyboard shortcuts

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