cloudprovider

package
v0.32.9 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IgnoreInsufficientCapacityError added in v0.25.0

func IgnoreInsufficientCapacityError(err error) error

func IgnoreNodeClaimNotFoundError added in v0.31.0

func IgnoreNodeClaimNotFoundError(err error) error

func IgnoreNodeClassNotReadyError added in v0.31.0

func IgnoreNodeClassNotReadyError(err error) error

func IsInsufficientCapacityError added in v0.25.0

func IsInsufficientCapacityError(err error) bool

func IsNodeClaimNotFoundError added in v0.31.0

func IsNodeClaimNotFoundError(err error) bool

func IsNodeClassNotReadyError added in v0.31.0

func IsNodeClassNotReadyError(err error) bool

Types

type CloudProvider

type CloudProvider interface {
	// Create launches a NodeClaim with the given resource requests and requirements and returns a hydrated
	// NodeClaim back with resolved NodeClaim labels for the launched NodeClaim
	Create(context.Context, *v1beta1.NodeClaim) (*v1beta1.NodeClaim, error)
	// Delete removes a NodeClaim from the cloudprovider by its provider id
	Delete(context.Context, *v1beta1.NodeClaim) error
	// Get retrieves a NodeClaim from the cloudprovider by its provider id
	Get(context.Context, string) (*v1beta1.NodeClaim, error)
	// List retrieves all NodeClaims from the cloudprovider
	List(context.Context) ([]*v1beta1.NodeClaim, error)
	// GetInstanceTypes returns instance types supported by the cloudprovider.
	// Availability of types or zone may vary by provisioner or over time.  Regardless of
	// availability, the GetInstanceTypes method should always return all instance types,
	// even those with no offerings available.
	GetInstanceTypes(context.Context, *v1beta1.NodePool) ([]*InstanceType, error)
	// IsDrifted returns whether a NodeClaim has drifted from the provisioning requirements
	// it is tied to.
	IsDrifted(context.Context, *v1beta1.NodeClaim) (DriftReason, error)
	// Name returns the CloudProvider implementation name.
	Name() string
}

CloudProvider interface is implemented by cloud providers to support provisioning.

type DriftReason added in v0.30.0

type DriftReason string

type InstanceType

type InstanceType struct {
	// Name of the instance type, must correspond to v1.LabelInstanceTypeStable
	Name string
	// Requirements returns a flexible set of properties that may be selected
	// for scheduling. Must be defined for every well known label, even if empty.
	Requirements scheduling.Requirements
	// Note that though this is an array it is expected that all the Offerings are unique from one another
	Offerings Offerings
	// Resources are the full resource capacities for this instance type
	Capacity v1.ResourceList
	// Overhead is the amount of resource overhead expected to be used by kubelet and any other system daemons outside
	// of Kubernetes.
	Overhead *InstanceTypeOverhead
	// contains filtered or unexported fields
}

InstanceType describes the properties of a potential node (either concrete attributes of an instance of this type or supported options in the case of arrays)

func (*InstanceType) Allocatable added in v0.22.0

func (i *InstanceType) Allocatable() v1.ResourceList

type InstanceTypeOverhead

type InstanceTypeOverhead struct {
	// KubeReserved returns the default resources allocated to kubernetes system daemons by default
	KubeReserved v1.ResourceList
	// SystemReserved returns the default resources allocated to the OS system daemons by default
	SystemReserved v1.ResourceList
	// EvictionThreshold returns the resources used to maintain a hard eviction threshold
	EvictionThreshold v1.ResourceList
}

func (InstanceTypeOverhead) Total

type InstanceTypes added in v0.25.0

type InstanceTypes []*InstanceType

func (InstanceTypes) OrderByPrice added in v0.25.0

func (its InstanceTypes) OrderByPrice(reqs scheduling.Requirements) InstanceTypes

type InsufficientCapacityError added in v0.25.0

type InsufficientCapacityError struct {
	// contains filtered or unexported fields
}

InsufficientCapacityError is an error type returned by CloudProviders when a launch fails due to a lack of capacity from NodeClaim requirements

func NewInsufficientCapacityError added in v0.25.0

func NewInsufficientCapacityError(err error) *InsufficientCapacityError

func (*InsufficientCapacityError) Error added in v0.25.0

func (e *InsufficientCapacityError) Error() string

type NodeClaimNotFoundError added in v0.31.0

type NodeClaimNotFoundError struct {
	// contains filtered or unexported fields
}

NodeClaimNotFoundError is an error type returned by CloudProviders when the reason for failure is NotFound

func NewNodeClaimNotFoundError added in v0.31.0

func NewNodeClaimNotFoundError(err error) *NodeClaimNotFoundError

func (*NodeClaimNotFoundError) Error added in v0.31.0

func (e *NodeClaimNotFoundError) Error() string

type NodeClassNotReadyError added in v0.31.0

type NodeClassNotReadyError struct {
	// contains filtered or unexported fields
}

NodeClassNotReadyError is an error type returned by CloudProviders when a NodeClass that is used by the launch process doesn't have all its resolved fields

func NewNodeClassNotReadyError added in v0.31.0

func NewNodeClassNotReadyError(err error) *NodeClassNotReadyError

func (*NodeClassNotReadyError) Error added in v0.31.0

func (e *NodeClassNotReadyError) Error() string

type Offering

type Offering struct {
	CapacityType string
	Zone         string
	Price        float64
	// Available is added so that Offerings can return all offerings that have ever existed for an instance type,
	// so we can get historical pricing data for calculating savings in consolidation
	Available bool
}

An Offering describes where an InstanceType is available to be used, with the expectation that its properties may be tightly coupled (e.g. the availability of an instance type in some zone is scoped to a capacity type)

type Offerings

type Offerings []Offering

func (Offerings) Available

func (ofs Offerings) Available() Offerings

Available filters the available offerings from the returned offerings

func (Offerings) Cheapest

func (ofs Offerings) Cheapest() Offering

Cheapest returns the cheapest offering from the returned offerings

func (Offerings) Get

func (ofs Offerings) Get(ct, zone string) (Offering, bool)

Get gets the offering from an offering slice that matches the passed zone and capacity type

func (Offerings) Requirements

func (ofs Offerings) Requirements(reqs scheduling.Requirements) Offerings

Requirements filters the offerings based on the passed requirements

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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