provider

package module
v0.8.1 Latest Latest
Warning

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

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

README

Introduction

This repository contains the implementation of Kata remote hypervisor. Kata remote hypervisor enables creation of Kata VMs on any environment without requiring baremetal servers or nested virtualization support.

In an effort to resolve circular dependencies within the repository located at https://github.com/confidential-containers/cloud-api-adaptor/tree/main/pkg/adaptor/cloud, we have relocated the cloud providers' code to a new Go module.

Goals

  • Manage VM instances in the cloud to run pods using cloud (virtualization) provider APIs

Architecture

The background and description of the components involved in 'peer pods' can be found in the architecture documentation.

Supported Providers

  • aws
  • azure
  • ibmcloud
  • libvirt
  • vsphere
Adding a new provider

Please refer to the instructions mentioned in the following doc.

Contribution

This project uses the Apache 2.0 license. Contribution to this project requires the DCO 1.1 process to be followed.

Collaborations

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCloudProvider

func AddCloudProvider(name string, cloud CloudProvider)

func DefaultToEnv

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

func GetBestFitInstanceType

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 List

func List() []string

func SelectInstanceTypeToUse

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

func VerifyCloudInstanceType

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

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

Types

type CloudProvider

type CloudProvider interface {
	ParseCmd(flags *flag.FlagSet)
	LoadEnv()
	NewProvider() (Provider, error)
}

func Get

func Get(name string) CloudProvider

type Instance

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

type InstanceTypeSpec

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

func SortInstanceTypesOnMemory

func SortInstanceTypesOnMemory(instanceTypeSpecList []InstanceTypeSpec) []InstanceTypeSpec

Method to sort InstanceTypeSpec into ascending order based on memory

type KeyValueFlag

type KeyValueFlag map[string]string

keyValueFlag represents a flag of key-value pairs

func (*KeyValueFlag) Set

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

Set parses the input string and sets the keyValueFlag value

func (*KeyValueFlag) String

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
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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