machine

package
v1.33.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 74 Imported by: 111

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHostAlias added in v1.10.0

func AddHostAlias(c command.Runner, name string, ip net.IP) error

AddHostAlias makes fine adjustments to pod resources that aren't possible via kubeadm config.

func BuildImage added in v1.20.0

func BuildImage(path string, file string, tag string, push bool, env []string, opt []string, profiles []*config.Profile, allNodes bool, nodeName string) error

BuildImage builds image to all profiles

func CacheAndLoadImages added in v0.24.0

func CacheAndLoadImages(images []string, profiles []*config.Profile, overwrite bool) error

CacheAndLoadImages caches and loads images to all profiles

func CacheBinariesForBootstrapper added in v1.0.1

func CacheBinariesForBootstrapper(version string, excludeBinaries []string, binariesURL string) error

CacheBinariesForBootstrapper will cache binaries for a bootstrapper

func CacheImagesForBootstrapper added in v0.22.0

func CacheImagesForBootstrapper(imageRepository, version string) error

CacheImagesForBootstrapper will cache images for a bootstrapper

func CommandRunner added in v0.34.0

func CommandRunner(h *host.Host) (command.Runner, error)

CommandRunner returns best available command runner for this host

func CopyBinary added in v1.0.1

func CopyBinary(cr command.Runner, src string, dest string) error

CopyBinary copies a locally cached binary to the guest VM

func CreateSSHShell added in v1.7.3

func CreateSSHShell(api libmachine.API, cc config.ClusterConfig, n config.Node, args []string, native bool) error

CreateSSHShell creates a new SSH shell / client

func DeleteHost added in v1.7.3

func DeleteHost(api libmachine.API, machineName string, deleteAbandoned ...bool) error

DeleteHost deletes the host VM. deleteAbandoned will try to delete the machine even if there is no minikube config for it.

func DiskAvailable added in v1.26.0

func DiskAvailable(cr command.Runner, dir string) (int, error)

DiskAvailable returns the available capacity of dir in the VM/container in GiB

func DiskUsed added in v1.13.0

func DiskUsed(cr command.Runner, dir string) (int, error)

DiskUsed returns the capacity of dir in the VM/container as a percentage

func DoLoadImages added in v1.19.0

func DoLoadImages(images []string, profiles []*config.Profile, cacheDir string, overwrite bool) error

DoLoadImages loads images to all profiles

func DoSaveImages added in v1.23.0

func DoSaveImages(images []string, output string, profiles []*config.Profile, cacheDir string) error

DoSaveImages saves images from all profiles

func GetHost added in v1.21.0

func GetHost(api libmachine.API, cc config.ClusterConfig, n config.Node) (*host.Host, error)

GetHost find node's host information by name in the given cluster.

func GetSSHHostAddrPort added in v1.16.0

func GetSSHHostAddrPort(api libmachine.API, cc config.ClusterConfig, n config.Node) (string, int, error)

GetSSHHostAddrPort returns the host address and port for ssh

func IsRunning added in v1.9.0

func IsRunning(api libmachine.API, name string) bool

IsRunning asserts that a libmachine host is in state "Running"

func ListImages added in v1.19.0

func ListImages(profile *config.Profile, format string) error

ListImages lists images on all nodes in profile

func LoadCachedImages added in v1.19.0

func LoadCachedImages(cc *config.ClusterConfig, runner command.Runner, images []string, cacheDir string, overwrite bool) error

LoadCachedImages loads previously cached images into the container runtime

func LoadHost added in v1.9.0

func LoadHost(api libmachine.API, machineName string) (*host.Host, error)

LoadHost returns a libmachine host by name

func LoadLocalImages added in v1.19.0

func LoadLocalImages(cc *config.ClusterConfig, runner command.Runner, images []string) error

LoadLocalImages loads images into the container runtime

func MaybeDisplayAdvice added in v1.12.0

func MaybeDisplayAdvice(err error, driver string)

MaybeDisplayAdvice will provide advice without exiting, so minikube has a chance to try the failover

func NewAPIClient added in v0.17.0

func NewAPIClient(miniHome ...string) (libmachine.API, error)

NewAPIClient gets a new client.

func NewRPCClient added in v0.20.0

func NewRPCClient(storePath, certsDir string) libmachine.API

NewRPCClient gets a new client.

func PullImages added in v1.20.0

func PullImages(images []string, profile *config.Profile) error

PullImages pulls images to all nodes in profile

func PushImages added in v1.23.0

func PushImages(images []string, profile *config.Profile) error

PushImages push images on all nodes in profile

func RemoveImages added in v1.19.0

func RemoveImages(images []string, profile *config.Profile) error

RemoveImages removes images from all nodes in profile

func RunSSHHostCommand added in v1.16.0

func RunSSHHostCommand(api libmachine.API, cc config.ClusterConfig, n config.Node, command string, args []string) (string, error)

RunSSHHostCommand runs a command to the SSH host

func SaveAndCacheImages added in v1.23.0

func SaveAndCacheImages(images []string, profiles []*config.Profile) error

SaveAndCacheImages saves images from all profiles into the cache

func SaveCachedImages added in v1.23.0

func SaveCachedImages(cc *config.ClusterConfig, runner command.Runner, images []string, cacheDir string) error

SaveCachedImages saves from the container runtime to the cache

func SaveLocalImages added in v1.23.0

func SaveLocalImages(cc *config.ClusterConfig, runner command.Runner, images []string, output string) error

SaveLocalImages saves images from the container runtime

func StartDriver

func StartDriver()

StartDriver starts the driver

func StartHost added in v1.7.3

func StartHost(api libmachine.API, cfg *config.ClusterConfig, n *config.Node) (*host.Host, bool, error)

StartHost starts a host VM.

func Status added in v1.9.0

func Status(api libmachine.API, machineName string) (string, error)

Status returns the status of a libmachine host

func StopHost added in v1.7.3

func StopHost(api libmachine.API, machineName string) error

StopHost stops the host VM, saving state to disk.

func TagImage added in v1.23.0

func TagImage(profile *config.Profile, source string, target string) error

TagImage tags image in all nodes in profile

Types

type CertGenerator added in v0.15.0

type CertGenerator struct {
	cert.X509CertGenerator
}

CertGenerator is used to override the default machine CertGenerator with a longer timeout.

func (*CertGenerator) ValidateCertificate added in v0.15.0

func (cg *CertGenerator) ValidateCertificate(addr string, authOptions *auth.Options) (bool, error)

ValidateCertificate is a reimplementation of the default generator with a longer timeout.

type ConnChecker added in v0.16.0

type ConnChecker struct {
}

ConnChecker can check the connection

func (*ConnChecker) Check added in v0.16.0

func (cc *ConnChecker) Check(h *host.Host, _ bool) (string, *auth.Options, error)

Check checks the connection

type HostInfo added in v1.12.2

type HostInfo struct {
	Memory   int64
	CPUs     int
	DiskSize int64
}

HostInfo holds information on the user's machine

func LocalHostInfo added in v1.17.0

func LocalHostInfo() (*HostInfo, error, error, error)

LocalHostInfo returns system information such as memory,CPU, DiskSize

func RemoteHostInfo added in v1.17.0

func RemoteHostInfo(r command.Runner) (*HostInfo, error, error, error)

RemoteHostInfo returns system information such as memory,CPU, DiskSize

type LocalClient added in v0.17.0

type LocalClient struct {
	*persist.Filestore
	// contains filtered or unexported fields
}

LocalClient is a non-RPC implementation of the libmachine API

func (*LocalClient) Close added in v0.17.0

func (api *LocalClient) Close() error

Close closes the client

func (*LocalClient) Create added in v0.17.0

func (api *LocalClient) Create(h *host.Host) error

Create creates the host

func (*LocalClient) Load added in v0.17.0

func (api *LocalClient) Load(name string) (*host.Host, error)

Load a new client, creating driver

func (*LocalClient) NewHost added in v0.17.0

func (api *LocalClient) NewHost(drvName string, rawDriver []byte) (*host.Host, error)

NewHost creates a new Host

type Machine added in v1.6.0

type Machine struct {
	*host.Host
}

Machine contains information about a machine

func LoadMachine added in v1.9.0

func LoadMachine(name string) (*Machine, error)

LoadMachine returns a Machine abstracting a libmachine.Host

func (*Machine) IsValid added in v1.6.0

func (h *Machine) IsValid() bool

IsValid checks if the machine has the essential info needed for a machine

Jump to

Keyboard shortcuts

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