kubevirt

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandExecutor

type CommandExecutor interface {
	ExecuteCommand(command string) (string, error)
}

type DefaultMachineFactory

type DefaultMachineFactory struct {
}

DefaultMachineFactory is the default implementation of MachineFactory

func (DefaultMachineFactory) NewMachine

func (defaultMachineFactory DefaultMachineFactory) NewMachine(ctx *context.MachineContext, client client.Client, namespace string, sshKeys *ssh.ClusterNodeSshKeys) (MachineInterface, error)

NewMachine creates a new kubevirt.machine

type Machine

type Machine struct {
	// contains filtered or unexported fields
}

Machine implement a service for managing the KubeVirt VM hosting a kubernetes node.

func NewMachine

func NewMachine(ctx *context.MachineContext, client client.Client, namespace string, sshKeys *ssh.ClusterNodeSshKeys) (*Machine, error)

NewMachine returns a new Machine service for the given context.

func (*Machine) Address

func (m *Machine) Address() string

Address returns the IP address of the VM.

func (*Machine) Create

func (m *Machine) Create(ctx gocontext.Context) error

Create creates a new VM for this machine.

func (*Machine) Delete

func (m *Machine) Delete() error

Delete deletes VM for this machine.

func (*Machine) DrainNodeIfNeeded added in v0.1.8

func (m *Machine) DrainNodeIfNeeded(wrkldClstr workloadcluster.WorkloadCluster) (time.Duration, error)

func (*Machine) Exists

func (m *Machine) Exists() bool

Exists checks if the VM has been provisioned already.

func (*Machine) GenerateProviderID

func (m *Machine) GenerateProviderID() (string, error)

GenerateProviderID generates the KubeVirt provider ID to be used for the NodeRef

func (*Machine) IsBootstrapped

func (m *Machine) IsBootstrapped() bool

IsBootstrapped checks if the VM is bootstrapped with Kubernetes.

func (*Machine) IsBootstrappedWithSSH added in v0.1.7

func (m *Machine) IsBootstrappedWithSSH() bool

IsBootstrappedWithSSH checks if the VM is bootstrapped with Kubernetes using SSH strategy.

func (*Machine) IsReady

func (m *Machine) IsReady() bool

IsReady checks if the VM is ready

func (*Machine) IsTerminal

func (m *Machine) IsTerminal() (bool, string, error)

IsTerminal Reports back if the VM is either being requested to terminate or is terminated in a way that it will never recover from.

func (*Machine) SupportsCheckingIsBootstrapped

func (m *Machine) SupportsCheckingIsBootstrapped() bool

SupportsCheckingIsBootstrapped checks if we have a method of checking that this bootstrapper has completed.

type MachineFactory

type MachineFactory interface {
	// NewMachine returns a new Machine service for the given context.
	NewMachine(ctx *context.MachineContext, client client.Client, namespace string, sshKeys *ssh.ClusterNodeSshKeys) (MachineInterface, error)
}

type MachineInterface

type MachineInterface interface {
	// Create creates a new VM for this machine.
	Create(ctx gocontext.Context) error
	// Delete deletes VM for this machine.
	Delete() error
	// Exists checks if the VM has been provisioned already.
	Exists() bool
	// IsReady checks if the VM is ready
	IsReady() bool
	// Address returns the IP address of the VM.
	Address() string
	// SupportsCheckingIsBootstrapped checks if we have a method of checking
	// that this bootstrapper has completed.
	SupportsCheckingIsBootstrapped() bool
	// IsBootstrapped checks if the VM is bootstrapped with Kubernetes.
	IsBootstrapped() bool
	// GenerateProviderID generates the KubeVirt provider ID to be used for the NodeRef
	GenerateProviderID() (string, error)
	// IsTerminal reports back if a VM is in a permanent terminal state
	IsTerminal() (bool, string, error)

	DrainNodeIfNeeded(workloadcluster.WorkloadCluster) (time.Duration, error)
}

Directories

Path Synopsis
Package mock_kubevirt is a generated GoMock package.
Package mock_kubevirt is a generated GoMock package.

Jump to

Keyboard shortcuts

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