Documentation
¶
Overview ¶
Package driverlima implements a kutti driver for lima. It uses the limactl CLI to talk to lima.
For cluster networking, it uses the lima user-v2 network.
For nodes, it creates virtual machines from pre-built "cloud" images, maintained by the companion driver-lima-images project. These images are directly passed to lima for caching/VM disk creation.
Thus, the driver itself only downloads the list of available images from the URL pointed to by the ImagesSourceURL variable.
Index ¶
- Constants
- Variables
- type Driver
- func (vd *Driver) DeleteMachine(machinename string, clustername string) error
- func (vd *Driver) DeleteNetwork(clustername string) error
- func (vd *Driver) Description() string
- func (vd *Driver) Error() string
- func (vd *Driver) GetImage(k8sversion string) (drivercore.Image, error)
- func (vd *Driver) GetMachine(machinename string, clustername string) (drivercore.Machine, error)
- func (vd *Driver) K8sVersions() []string
- func (vd *Driver) ListImages() ([]drivercore.Image, error)
- func (vd *Driver) Name() string
- func (vd *Driver) NewMachine(machinename string, clustername string, k8sversion string) (drivercore.Machine, error)
- func (vd *Driver) NewNetwork(clustername string) (drivercore.Network, error)
- func (vd *Driver) QualifiedMachineName(machinename string, clustername string) string
- func (vd *Driver) QualifiedNetworkName(clustername string) string
- func (vd *Driver) Status() string
- func (vd *Driver) UpdateImageList() error
- func (vd *Driver) UsesNATNetworking() bool
- func (vd *Driver) UsesPerClusterNetworking() bool
- func (vd *Driver) ValidK8sVersion(k8sversion string) bool
- type Image
- func (i *Image) Deprecated() bool
- func (i *Image) Fetch() error
- func (i *Image) FetchWithProgress(progress func(current int64, total int64)) error
- func (i *Image) FromFile(filepath string) error
- func (i *Image) K8sVersion() string
- func (i *Image) PurgeLocal() error
- func (i *Image) Status() drivercore.ImageStatus
- type Machine
- func (m *Machine) Error() string
- func (m *Machine) ExecuteCommand(command drivercore.PredefinedCommand, params ...string) error
- func (m *Machine) ForceStop() error
- func (m *Machine) ForwardPort(hostport int, machineport int) error
- func (m *Machine) ForwardSSHPort(hostport int) error
- func (m *Machine) IPAddress() string
- func (m *Machine) ImplementsCommand(command drivercore.PredefinedCommand) bool
- func (m *Machine) Name() string
- func (m *Machine) SSHAddress() string
- func (m *Machine) Start() error
- func (m *Machine) Status() drivercore.MachineStatus
- func (m *Machine) Stop() error
- func (m *Machine) UnforwardPort(machineport int) error
- func (m *Machine) WaitForStateChange(timeoutinseconds int)
Constants ¶
const ImagesVersion = "0.1"
ImagesVersion defines the image repository version for the current version of the driver.
Variables ¶
var ImagesSourceURL = "https://github.com/kuttiproject/driver-lima-images/releases/download/v" + ImagesVersion + "/" + imagesConfigFile
ImagesSourceURL is the location where the master list of images can be found
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver implements the drivercore.Driver interface for Lima.
func (*Driver) DeleteMachine ¶
DeleteMachine deletes a Machine in a cluster.
func (*Driver) DeleteNetwork ¶
DeleteNetwork deletes the Network for a cluster.
func (*Driver) Description ¶
Description returns "Kutti driver for Lima"
func (*Driver) GetImage ¶
func (vd *Driver) GetImage(k8sversion string) (drivercore.Image, error)
GetImage returns an image corresponding to a Kubernetes version, or an error.
func (*Driver) GetMachine ¶
GetMachine returns a Machine in a cluster.
func (*Driver) K8sVersions ¶
K8sVersions returns all Kubernetes versions currently supported by kutti.
func (*Driver) ListImages ¶
func (vd *Driver) ListImages() ([]drivercore.Image, error)
ListImages lists the currently available Images.
func (*Driver) NewMachine ¶
func (vd *Driver) NewMachine(machinename string, clustername string, k8sversion string) (drivercore.Machine, error)
NewMachine creates a new Machine in a cluster, usually using an Image for the supplied Kubernetes version.
func (*Driver) NewNetwork ¶
func (vd *Driver) NewNetwork(clustername string) (drivercore.Network, error)
NewNetwork creates a new Network for a cluster.
func (*Driver) QualifiedMachineName ¶
QualifiedMachineName returns a unique name for a Machine in a cluster. This name is usually used internally by a Driver.
func (*Driver) QualifiedNetworkName ¶
QualifiedNetworkName returns a unique Network name for a cluster.
func (*Driver) UpdateImageList ¶
UpdateImageList fetches the latest list of Images from a driver-defined source, and stores it locally.
func (*Driver) UsesNATNetworking ¶
UsesNATNetworking returns true. This driver uses port forwarding, though not user-defined.
func (*Driver) UsesPerClusterNetworking ¶
UsesPerClusterNetworking returns false. This driver uses the Lima "user-v2" network for all clusters.
func (*Driver) ValidK8sVersion ¶
ValidK8sVersion returns true if the specified Kubernetes version is available.
type Image ¶
type Image struct {
ImageK8sVersion string
// imageChecksum string
ImageSourceURL string
ImageStatus drivercore.ImageStatus
ImageDeprecated bool
}
func (*Image) Deprecated ¶
Deprecated returns true if the image is no longer supported.
func (*Image) Fetch ¶
Fetch downloads the image from the driver repository into the local cache. The lima driver does not download or cache the image; lima itself does that. So, Fetch silently continues if called.
func (*Image) FetchWithProgress ¶
FetchWithProgress downloads the image from the driver repository into the local cache, and reports progress via the supplied callback. The callback reports current and total in bytes. The lima driver does not download or cache the image; lima itself does that. So, FetchWithProgress silently continues if called.
func (*Image) FromFile ¶
FromFile imports the image from the local filesystem into the local cache. The lima driver does not download or cache the image; lima itself does that. So, FromFile silently continues if called.
func (*Image) K8sVersion ¶
K8sVersion returns the version of Kubernetes components in the image.
func (*Image) PurgeLocal ¶
PurgeLocal removes the image from the local cache. The lima driver does not download or cache the image; lima itself does that. So, PurgeLocal silently continues if called.
func (*Image) Status ¶
func (i *Image) Status() drivercore.ImageStatus
Status can be Notdownloaded, Downloaded or Unknown.
type Machine ¶
type Machine struct {
// contains filtered or unexported fields
}
func (*Machine) Error ¶
Error returns the last error caused when manipulating this machine. A valid value can be expected only when Status() returns drivercore.MachineStatusError.
func (*Machine) ExecuteCommand ¶
func (m *Machine) ExecuteCommand(command drivercore.PredefinedCommand, params ...string) error
ExecuteCommand executes the specified predefined operation.
func (*Machine) ForceStop ¶
ForceStop stops a Machine forcibly. This operation should set the status to drivercore.MachineStatusStopped.
func (*Machine) ForwardPort ¶
ForwardPort creates a rule to forward the specified Machine port to the specified physical host port.
func (*Machine) ForwardSSHPort ¶
ForwardSSHPort forwards the SSH port of this Machine to the specified physical host port.
func (*Machine) IPAddress ¶
IPAddress returns the current IP Address of this Machine. A valid value can be expected only when Status() returns drivercore.MachineStatusRunning.
func (*Machine) ImplementsCommand ¶
func (m *Machine) ImplementsCommand(command drivercore.PredefinedCommand) bool
ImplementsCommand returns true if the driver implements the specified predefined operation.
func (*Machine) Name ¶
Name is the name of the machine. The operating system hostname should match this.
func (*Machine) SSHAddress ¶
SSHAddress returns the host address and port number to SSH into this Machine. For drivers that use NAT netwoking, the host address will be 'localhost'.
func (*Machine) Start ¶
Start starts a Machine. Note that a Machine may not be ready for further operations at the end of this, and therefore its status may not change immediately. See WaitForStateChange().
func (*Machine) Status ¶
func (m *Machine) Status() drivercore.MachineStatus
Status can be drivercore.MachineStatusRunning, drivercore.MachineStatusStopped drivercore.MachineStatusUnknown or drivercore.MachineStatusError.
func (*Machine) Stop ¶
Stop stops a Machine. Note that a Machine may not be ready for further operations at the end of this, and therefore its status will not change immediately. See WaitForStateChange().
func (*Machine) UnforwardPort ¶
UnforwardPort removes the rule which forwarded the specified Machine port.
func (*Machine) WaitForStateChange ¶
WaitForStateChange waits the specified number of seconds, or until the Machine status changes. WaitForStateChange should be called after calls to Start() or Stop(), before any other operation. It should not be called _before_ Stop(). The lima driver silently ignores WaitForStateChanged.