providers

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetdataDomain = "provider.unikorn-cloud.org"
)

Variables

This section is empty.

Functions

func GetAnnotations added in v0.2.8

func GetAnnotations(resource metav1.Object) map[string]string

Types

type Flavor

type Flavor struct {
	// Name of the flavor.
	Name string
	// CPU count.
	CPUs int
	// Memory available.
	Memory *resource.Quantity
	// Disk available.
	Disk *resource.Quantity
	// GPU count.
	GPUs int
	// GPUVendor is who makes the GPU, used to determine the drivers etc.
	GPUVendor GPUVendor
	// BareMetal is a bare-metal flavor.
	BareMetal bool
}

Flavor represents a machine type.

type FlavorList

type FlavorList []Flavor

FlavorList allows us to attach sort functions and the like.

func (FlavorList) Len

func (l FlavorList) Len() int

func (FlavorList) Less

func (l FlavorList) Less(i, j int) bool

func (FlavorList) Swap

func (l FlavorList) Swap(i, j int)

type GPUVendor

type GPUVendor string

GPUVendor defines the GPU vendor.

const (
	Nvidia GPUVendor = "nvidia"
	AMD    GPUVendor = "amd"
)

type Image

type Image struct {
	// Name of the image.
	Name string
	// Created is when the image was created.
	Created time.Time
	// Modified is when the image was modified.
	Modified time.Time
	// KubernetesVersion is only populated if the image contains a pre-installed
	// version of Kubernetes, this acts as a cache and improves provisioning performance.
	// This is pretty much the only source of truth about Kubernetes versions at
	// present, so should be populated.
	KubernetesVersion string
}

Image represents an operating system image.

type ImageList

type ImageList []Image

ImageList allows us to attach sort functions and the like.

func (ImageList) Len

func (l ImageList) Len() int

func (ImageList) Less

func (l ImageList) Less(i, j int) bool

func (ImageList) Swap

func (l ImageList) Swap(i, j int)

type Provider

type Provider interface {
	// Flavors list all available flavors.
	Flavors(ctx context.Context) (FlavorList, error)
	// Images lists all available images.
	Images(ctx context.Context) (ImageList, error)
	// ConfigureCluster does any provider specific configuration for a cluster.
	ConfigureCluster(ctx context.Context, cluster *unikornv1.KubernetesCluster) error
	// DeconfigureCluster does any provider specific cluster cleanup.
	DeconfigureCluster(ctx context.Context, annotations map[string]string) error
}

Providers are expected to provide a provider agnostic manner. They are also expected to provide any caching or memoization required to provide high performance and a decent UX.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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