providers

package
v1.31.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	AwsCloudProviderName          = "aws"
	VSphereCloudProviderName      = "vsphere"
	VMWareWorkstationProviderName = "desktop"
	MultipassProviderName         = "multipass"
	OpenStackProviderName         = "openstack"
	CloudStackProviderName        = "cloudstack"
	LxdProviderName               = "lxd"
)

Variables

View Source
var FALSE bool = false
View Source
var TRUE bool = true

Functions

func StringAfter added in v1.30.5

func StringAfter(str string, char string) string

func StringBefore added in v1.30.5

func StringBefore(str string, char string) string

Types

type CallbackWaitSSHReady

type CallbackWaitSSHReady interface {
	WaitSSHReady(name, address string) error
}

CallbackWaitSSHReady callback to test if ssh become ready or return timeout error

type InstanceCreateInput

type InstanceCreateInput struct {
	ControlPlane bool
	AllowUpgrade bool
	NodeGroup    string
	UserName     string
	AuthKey      string
	CloudInit    cloudinit.CloudInit
	Machine      *MachineCharacteristic
}

type InstanceStatus

type InstanceStatus interface {
	Address() string
	Powered() bool
}

type MacAddress

type MacAddress struct {
	sync.Mutex

	Addresses map[string]string `json:"mac-addresses,omitempty"`
}

type MachineCharacteristic

type MachineCharacteristic struct {
	Price    float64 `json:"price"`              // VM price in usd
	Memory   int     `json:"memsize"`            // VM Memory size in megabytes
	Vcpu     int     `json:"vcpus"`              // VM number of cpus
	DiskSize *int    `json:"disksize,omitempty"` // VM disk size in megabytes
}

MachineCharacteristic defines VM kind

func (*MachineCharacteristic) GetDiskSize

func (m *MachineCharacteristic) GetDiskSize() int

type MachineCharacteristics

type MachineCharacteristics map[string]*MachineCharacteristic

type Network

type Network struct {
	Domain     string                   `json:"domain,omitempty" yaml:"domain,omitempty"`
	Interfaces []*NetworkInterface      `json:"interfaces,omitempty" yaml:"interfaces,omitempty"`
	DNS        *cloudinit.NetworkResolv `json:"dns,omitempty" yaml:"dns,omitempty"`
	// contains filtered or unexported fields
}

func (*Network) Clone

func (vnet *Network) Clone(controlPlane bool, nodeIndex int) *Network

func (*Network) ConfigurationDidLoad

func (vnet *Network) ConfigurationDidLoad()

func (*Network) ConfigureManagedNetwork added in v1.30.5

func (vnet *Network) ConfigureManagedNetwork(managed []v1alpha2.ManagedNetworkInterface)

func (*Network) GetCloudInitNetwork

func (vnet *Network) GetCloudInitNetwork(useMacAddress bool) *cloudinit.NetworkDeclare

GetCloudInitNetwork create cloud-init object

func (*Network) GetDeclaredExistingInterfaces

func (vnet *Network) GetDeclaredExistingInterfaces() []*NetworkInterface

GetDeclaredExistingInterfaces return the declared existing interfaces

func (*Network) InterfaceByName

func (vnet *Network) InterfaceByName(networkName string) *NetworkInterface

func (*Network) PrimaryAddressIP

func (vnet *Network) PrimaryAddressIP() (address string)

func (*Network) PrimaryInterface

func (vnet *Network) PrimaryInterface() *NetworkInterface

func (*Network) UpdateMacAddressTable

func (vnet *Network) UpdateMacAddressTable() error

type NetworkInterface

type NetworkInterface struct {
	Enabled        *bool                    `json:"enabled,omitempty" yaml:"primary,omitempty"`
	Primary        bool                     `json:"primary,omitempty" yaml:"primary,omitempty"`
	Existing       *bool                    `json:"exists,omitempty" yaml:"exists,omitempty"`
	ConnectionType string                   `default:"nat" json:"type,omitempty" yaml:"type,omitempty"`
	BsdName        string                   `json:"bsd-name,omitempty" yaml:"bsd-name,omitempty"`
	DisplayName    string                   `json:"display-name,omitempty" yaml:"display-name,omitempty"`
	NetworkName    string                   `json:"network,omitempty" yaml:"network,omitempty"`
	Adapter        string                   `json:"adapter,omitempty" yaml:"adapter,omitempty"`
	MacAddress     string                   `json:"mac-address,omitempty" yaml:"mac-address,omitempty"`
	NicName        string                   `json:"nic,omitempty" yaml:"nic,omitempty"`
	DHCP           bool                     `json:"dhcp,omitempty" yaml:"dhcp,omitempty"`
	UseDhcpRoutes  *bool                    `json:"use-dhcp-routes,omitempty" yaml:"use-dhcp-routes,omitempty"`
	IPAddress      string                   `json:"address,omitempty" yaml:"address,omitempty"`
	Netmask        string                   `json:"netmask,omitempty" yaml:"netmask,omitempty"`
	Routes         []v1alpha2.NetworkRoutes `json:"routes,omitempty" yaml:"routes,omitempty"`
	// contains filtered or unexported fields
}

func (*NetworkInterface) AttachMacAddress

func (inet *NetworkInterface) AttachMacAddress(address string)

func (*NetworkInterface) CreateIt

func (inet *NetworkInterface) CreateIt() bool

func (*NetworkInterface) GetMacAddress

func (inet *NetworkInterface) GetMacAddress() string

GetMacAddress return a macaddress

func (*NetworkInterface) IsEnabled

func (inet *NetworkInterface) IsEnabled() bool

func (*NetworkInterface) IsExisting

func (inet *NetworkInterface) IsExisting() bool

func (*NetworkInterface) IsUseRoutes

func (inet *NetworkInterface) IsUseRoutes() bool

func (*NetworkInterface) Usable

func (inet *NetworkInterface) Usable() bool

type ProviderConfiguration

type ProviderConfiguration interface {
	AttachInstance(instanceName string, controlPlane bool, nodeIndex int) (ProviderHandler, error)
	CreateInstance(instanceName, instanceType string, controlPlane bool, nodeIndex int) (ProviderHandler, error)
	GetAvailableGpuTypes() map[string]string
	InstanceExists(name string) bool
	UUID(name string) (string, error)
	SetMode(test bool)
}

type ProviderHandler

type ProviderHandler interface {
	GetTimeout() time.Duration
	ConfigureNetwork(network v1alpha2.ManagedNetworkConfig)
	RetrieveNetworkInfos() error
	UpdateMacAddressTable() error
	GenerateProviderID() string
	GetTopologyLabels() map[string]string
	InstanceCreate(input *InstanceCreateInput) (string, error)
	InstanceWaitReady(callback CallbackWaitSSHReady) (string, error)
	InstancePrimaryAddressIP() string
	InstanceID() (string, error)
	InstanceAutoStart() error
	InstancePowerOn() error
	InstancePowerOff() error
	InstanceShutdownGuest() error
	InstanceDelete() error
	InstanceCreated() bool
	InstanceStatus() (InstanceStatus, error)
	InstanceWaitForPowered() error
	InstanceWaitForToolsRunning() (bool, error)
	InstanceMaxPods(desiredMaxPods int) (int, error)
	PrivateDNSName() (string, error)
	RegisterDNS(address string) error
	UnregisterDNS(address string) error
	UUID(name string) (string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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