cloud

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Version = "0.0.0"
)

Variables

This section is empty.

Functions

func DefaultToEnv

func DefaultToEnv(field *string, env, fallback string)

func GetBestFitInstanceType added in v0.7.0

func GetBestFitInstanceType(sortedInstanceTypeSpecList []InstanceTypeSpec, vcpus int64, memory int64) (string, error)

Method to find the best fit instance type for the given memory and vcpus The sortedInstanceTypeSpecList slice is a sorted list of instance types based on ascending order of supported memory

func SelectInstanceTypeToUse added in v0.7.0

func SelectInstanceTypeToUse(spec InstanceTypeSpec, specList []InstanceTypeSpec, validInstanceTypes []string, defaultInstanceType string) (string, error)

func VerifyCloudInstanceType added in v0.7.0

func VerifyCloudInstanceType(instanceType string, validInstanceTypes []string, defaultInstanceType string) (string, error)

Method to verify the correct instanceType to be used for Pod VM

Types

type Instance

type Instance struct {
	ID   string
	Name string
	IPs  []netip.Addr
}

type InstanceTypeSpec added in v0.7.0

type InstanceTypeSpec struct {
	InstanceType string
	VCPUs        int64
	Memory       int64
	Arch         string
	GPUs         int64
}

func SortInstanceTypesOnMemory added in v0.7.0

func SortInstanceTypesOnMemory(instanceTypeSpecList []InstanceTypeSpec) []InstanceTypeSpec

Method to sort InstanceTypeSpec into ascending order based on memory

type KeyValueFlag added in v0.8.0

type KeyValueFlag map[string]string

keyValueFlag represents a flag of key-value pairs

func (*KeyValueFlag) Set added in v0.8.0

func (k *KeyValueFlag) Set(value string) error

Set parses the input string and sets the keyValueFlag value

func (*KeyValueFlag) String added in v0.8.0

func (k *KeyValueFlag) String() string

String returns the string representation of the keyValueFlag

type Provider

type Provider interface {
	CreateInstance(ctx context.Context, podName, sandboxID string, cloudConfig cloudinit.CloudConfigGenerator, spec InstanceTypeSpec) (instance *Instance, err error)
	DeleteInstance(ctx context.Context, instanceID string) error
	Teardown() error
	ConfigVerifier() error
}

type Service

type Service interface {
	pb.HypervisorService
	GetInstanceID(ctx context.Context, podNamespace, podName string, wait bool) (string, error)
	ConfigVerifier() error
	Teardown() error
}

func NewService

func NewService(provider Provider, proxyFactory proxy.Factory, workerNode podnetwork.WorkerNode,
	podsDir, daemonPort, aaKBCParams string) Service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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