Documentation
¶
Index ¶
- Constants
- func GenerateSSHKeyPair() ([]byte, []byte, error)
- func GetAnnotations(resource metav1.Object) map[string]string
- type ExternalNetwork
- type ExternalNetworks
- type Flavor
- type FlavorList
- type GPU
- type GPUVendor
- type Image
- type ImageGPU
- type ImageList
- type ImageOS
- type ImagePackages
- type ImageVirtualization
- type OsDistro
- type OsFamily
- type OsKernel
- type Provider
Constants ¶
const (
MetdataDomain = "provider.unikorn-cloud.org"
)
Variables ¶
This section is empty.
Functions ¶
func GenerateSSHKeyPair ¶ added in v0.1.37
GenerateSSHKeyPair creates an ephemeral SSH keypair, returning the public and private keys in SSH fingerprint and PEM formats respectively.
Types ¶
type ExternalNetwork ¶ added in v0.1.3
type ExternalNetwork struct {
// ID is the provider specific network ID.
ID string
// Name is the network name.
Name string
}
ExternalNetwork represents an external network.
type ExternalNetworks ¶ added in v0.1.3
type ExternalNetworks []ExternalNetwork
ExternalNetworks is a list of provider networks.
type Flavor ¶
type Flavor struct {
// ID must be an immutable ID, preferably a UUID.
// If the provider doesn't have the concept of an ID, and the name
// is immutable you can make one out of that.
ID string
// Name of the flavor.
Name string
// CPU count.
CPUs int
// CPUFamily tells you the CPU type.
CPUFamily *string
// Memory available.
Memory *resource.Quantity
// Disk available.
Disk *resource.Quantity
// GPU describes the GPU(s) if any are available to the flavor.
GPU *GPU
// 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.
type GPU ¶ added in v0.1.17
type GPU struct {
// Vendor is who makes the GPU, used to determine the drivers etc.
Vendor GPUVendor
// Model is the type of GPU.
Model string
// Memory is the amount of memory each GPU has.
Memory *resource.Quantity
// PhysicalCount is the number of physical cards in the flavor.
// This is primarily for end users, so it's not confusing.
PhysicalCount int
// LogicalCount is the number of logical GPUs e.g. an AMD MI250 is 2 MI200s.
// This is primarily for scheduling e.g. autoscaling.
LogicalCount int
}
type Image ¶
type Image struct {
// ID must be an immutable ID, preferably a UUID.
// If the provider doesn't have the concept of an ID, and the name
// is immutable you can make one out of that.
ID string
// 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
// SizeGiB is the minimum disk size for the image in GiB.
SizeGiB int
// ImageVirtualization defines how the image can be used.
Virtualization ImageVirtualization
// GPU is any GPU specific configuration for scheduling on a specific flavor type.
GPU *ImageGPU
// OS is the operating system specification.
OS ImageOS
// Packages is a list of pre-installed packages and its versions. Versions must be a semver (starts with a vN.N.N)
Packages *ImagePackages
}
Image represents an operating system image.
type ImageGPU ¶ added in v0.1.26
type ImageGPU struct {
// Vendor is the vendor a GPU is compatible with.
Vendor GPUVendor
// Driver is the driver version string.
Driver string
// Models is a list of GPU models a driver is certified with.
Models []string
}
ImageGPU defines image specific GPU compatibility information.
type ImageOS ¶ added in v0.1.47
type ImageOS struct {
// Kernel is the kernel type of the OS.
Kernel OsKernel
// Family is the family of the OS.
Family OsFamily
// Distro is the distribution of the OS.
Distro OsDistro
// Variant is the variant of the OS.
Variant *string
// Codename is the codename of the OS.
Codename *string
// Version is the version of the OS.
Version string
}
ImageOS defines the operating system of an image.
type ImagePackages ¶ added in v0.1.47
ImagePackages is a map of pre-installed package names to versions. Versions must be a semver (starts with a vN.N.N).
type ImageVirtualization ¶ added in v0.1.26
type ImageVirtualization string
const ( Virtualized ImageVirtualization = "virtualized" Baremetal ImageVirtualization = "baremetal" Any ImageVirtualization = "any" )
type OsFamily ¶ added in v0.1.47
type OsFamily string
OsFamily A family of operating systems. This typically defines the package format.
type OsKernel ¶ added in v0.1.47
type OsKernel string
OsKernel represents the kernel type.
const (
Linux OsKernel = "linux"
)
type Provider ¶
type Provider interface {
// Region returns the provider's region.
Region(ctx context.Context) (*unikornv1.Region, error)
// Flavors list all available flavors.
Flavors(ctx context.Context) (FlavorList, error)
// Images lists all available images.
Images(ctx context.Context) (ImageList, error)
// CreateIdentity creates a new identity for cloud infrastructure.
CreateIdentity(ctx context.Context, identity *unikornv1.Identity) error
// DeleteIdentity cleans up an identity for cloud infrastructure.
DeleteIdentity(ctx context.Context, identity *unikornv1.Identity) error
// CreateNetwork creates a new physical network.
CreateNetwork(ctx context.Context, identity *unikornv1.Identity, network *unikornv1.Network) error
// DeleteNetwork deletes a physical network.
DeleteNetwork(ctx context.Context, identity *unikornv1.Identity, network *unikornv1.Network) error
// ListExternalNetworks returns a list of external networks if the platform
// supports such a concept.
ListExternalNetworks(ctx context.Context) (ExternalNetworks, error)
// CreateSecurityGroup creates a new security group.
CreateSecurityGroup(ctx context.Context, identity *unikornv1.Identity, securityGroup *unikornv1.SecurityGroup) error
// DeleteSecurityGroup deletes a security group.
DeleteSecurityGroup(ctx context.Context, identity *unikornv1.Identity, securityGroup *unikornv1.SecurityGroup) error
// CreateSecurityGroupRule creates a new security group rule.
CreateSecurityGroupRule(ctx context.Context, identity *unikornv1.Identity, securityGroup *unikornv1.SecurityGroup, rule *unikornv1.SecurityGroupRule) error
// DeleteSecurityGroupRule deletes a security group rule.
DeleteSecurityGroupRule(ctx context.Context, identity *unikornv1.Identity, securityGroup *unikornv1.SecurityGroup, rule *unikornv1.SecurityGroupRule) error
// CreateServer creates a new server.
CreateServer(ctx context.Context, identity *unikornv1.Identity, server *unikornv1.Server) error
// DeleteServer deletes a server.
DeleteServer(ctx context.Context, identity *unikornv1.Identity, server *unikornv1.Server) 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.