v1

package
v0.28.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Overview

Package v1 contains API Schema definitions for the vm v1 API group +kubebuilder:object:generate=true +groupName=vm.neon.tech

Index

Constants

View Source
const MigrationPort int32 = 20187
View Source
const RunnerPodVersionLabel string = "vm.neon.tech/runner-version"

Label that determines the version of runner pod. May be missing on older runners

View Source
const VirtualMachineNameLabel string = "vm.neon.tech/name"

VirtualMachineNameLabel is the label assigned to each NeonVM Pod, providing the name of the VirtualMachine object for the VM running in it

This label can be used both to find which VM is running in a Pod (by getting the value of the label) or to find which Pod a VM is running in (by searching for Pods with the label equal to the VM's name).

View Source
const VirtualMachineResourcesAnnotation string = "vm.neon.tech/resources"

VirtualMachineResourcesAnnotation is the annotation added to each runner Pod, mirroring information about the resource allocations of the VM running in the pod.

The value of this annotation is always a JSON-encoded VirtualMachineResources object.

View Source
const VirtualMachineUsageAnnotation string = "vm.neon.tech/usage"

VirtualMachineUsageAnnotation is the annotation added to each runner Pod, mirroring information about the resource allocations of the VM running in the pod.

The value of this annotation is always a JSON-encoded VirtualMachineUsage object.

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: "vm.neon.tech", Version: "v1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type CPUs

type CPUs struct {
	// +optional
	// +kubebuilder:default:=1
	Min *MilliCPU `json:"min"`
	// +optional
	Max *MilliCPU `json:"max,omitempty"`
	// +optional
	Use *MilliCPU `json:"use,omitempty"`
}

func (*CPUs) DeepCopy

func (in *CPUs) DeepCopy() *CPUs

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CPUs.

func (*CPUs) DeepCopyInto

func (in *CPUs) DeepCopyInto(out *CPUs)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Disk

type Disk struct {
	// Disk's name.
	// Must be a DNS_LABEL and unique within the virtual machine.
	Name string `json:"name"`
	// Mounted read-only if true, read-write otherwise (false or unspecified).
	// Defaults to false.
	// +optional
	// +kubebuilder:default:=false
	ReadOnly *bool `json:"readOnly,omitempty"`
	// Path within the virtual machine at which the disk should be mounted.  Must
	// not contain ':'.
	MountPath string `json:"mountPath"`
	// DiskSource represents the location and type of the mounted disk.
	DiskSource `json:",inline"`
}

func (*Disk) DeepCopy

func (in *Disk) DeepCopy() *Disk

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Disk.

func (*Disk) DeepCopyInto

func (in *Disk) DeepCopyInto(out *Disk)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DiskSource

type DiskSource struct {
	// EmptyDisk represents a temporary empty qcow2 disk that shares a vm's lifetime.
	EmptyDisk *EmptyDiskSource `json:"emptyDisk,omitempty"`
	// configMap represents a configMap that should populate this disk
	// +optional
	ConfigMap *corev1.ConfigMapVolumeSource `json:"configMap,omitempty"`
	// Secret represents a secret that should populate this disk.
	// +optional
	Secret *corev1.SecretVolumeSource `json:"secret,omitempty"`
	// TmpfsDisk represents a tmpfs.
	// +optional
	Tmpfs *TmpfsDiskSource `json:"tmpfs,omitempty"`
}

func (*DiskSource) DeepCopy

func (in *DiskSource) DeepCopy() *DiskSource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiskSource.

func (*DiskSource) DeepCopyInto

func (in *DiskSource) DeepCopyInto(out *DiskSource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EmptyDiskSource

type EmptyDiskSource struct {
	Size resource.Quantity `json:"size"`
	// Discard enables the "discard" mount option for the filesystem
	Discard bool `json:"discard,omitempty"`
}

func (*EmptyDiskSource) DeepCopy

func (in *EmptyDiskSource) DeepCopy() *EmptyDiskSource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EmptyDiskSource.

func (*EmptyDiskSource) DeepCopyInto

func (in *EmptyDiskSource) DeepCopyInto(out *EmptyDiskSource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EnvVar

type EnvVar struct {
	// Name of the environment variable. Must be a C_IDENTIFIER.
	Name string `json:"name"`
	// +optional
	// +kubebuilder:default:=""
	Value string `json:"value,omitempty"`
}

func (*EnvVar) DeepCopy

func (in *EnvVar) DeepCopy() *EnvVar

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvVar.

func (*EnvVar) DeepCopyInto

func (in *EnvVar) DeepCopyInto(out *EnvVar)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ExtraNetwork

type ExtraNetwork struct {
	// Enable extra network interface
	// +kubebuilder:default:=false
	// +optional
	Enable bool `json:"enable"`
	// Interface name.
	// +kubebuilder:default:=net1
	// +optional
	Interface string `json:"interface"`
	// Multus Network name specified in network-attachments-definition.
	// +optional
	MultusNetwork string `json:"multusNetwork,omitempty"`
}

func (*ExtraNetwork) DeepCopy

func (in *ExtraNetwork) DeepCopy() *ExtraNetwork

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExtraNetwork.

func (*ExtraNetwork) DeepCopyInto

func (in *ExtraNetwork) DeepCopyInto(out *ExtraNetwork)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Guest

type Guest struct {
	// +optional
	KernelImage *string `json:"kernelImage,omitempty"`

	// +optional
	AppendKernelCmdline *string `json:"appendKernelCmdline,omitempty"`

	// +optional
	CPUs CPUs `json:"cpus"`
	// +optional
	// +kubebuilder:default:="1Gi"
	MemorySlotSize resource.Quantity `json:"memorySlotSize"`
	// +optional
	MemorySlots MemorySlots `json:"memorySlots"`
	// +optional
	RootDisk RootDisk `json:"rootDisk"`
	// Docker image Entrypoint array replacement.
	// +optional
	Command []string `json:"command,omitempty"`
	// Arguments to the entrypoint.
	// The docker image's cmd is used if this is not provided.
	// +optional
	Args []string `json:"args,omitempty"`
	// List of environment variables to set in the vmstart process.
	// +optional
	Env []EnvVar `json:"env,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
	// List of ports to expose from the container.
	// Cannot be updated.
	// +optional
	Ports []Port `json:"ports,omitempty"`

	// Additional settings for the VM.
	// Cannot be updated.
	// +optional
	Settings *GuestSettings `json:"settings,omitempty"`
}

func (*Guest) DeepCopy

func (in *Guest) DeepCopy() *Guest

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Guest.

func (*Guest) DeepCopyInto

func (in *Guest) DeepCopyInto(out *Guest)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GuestSettings added in v0.18.6

type GuestSettings struct {
	// Individual lines to add to a sysctl.conf file. See sysctl.conf(5) for more
	// +optional
	Sysctl []string `json:"sysctl,omitempty"`

	// Swap adds a swap disk with the provided size.
	//
	// If Swap is provided, SwapInfo MUST NOT be provided, and vice versa.
	//
	// +optional
	Swap *resource.Quantity `json:"swap,omitempty"`

	// SwapInfo controls settings for adding a swap disk to the VM.
	//
	// SwapInfo is a temporary newer version of the Swap field.
	//
	// Eventually, after all VMs have moved from Swap to SwapInfo, we can change the type of the Swap
	// field to SwapInfo, move VMs from SwapInfo back to Swap, and then remove SwapInfo.
	//
	// More information here: https://neondb.slack.com/archives/C06SW383C79/p1713298689471319
	//
	// +optional
	SwapInfo *SwapInfo `json:"swapInfo,omitempty"`
}

func (*GuestSettings) DeepCopy added in v0.18.6

func (in *GuestSettings) DeepCopy() *GuestSettings

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GuestSettings.

func (*GuestSettings) DeepCopyInto added in v0.18.6

func (in *GuestSettings) DeepCopyInto(out *GuestSettings)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*GuestSettings) GetSwapInfo added in v0.28.1

func (s *GuestSettings) GetSwapInfo() (*SwapInfo, error)

SwapInfo returns information about the swap requested, if there is any.

This is an abstraction over the Swap/SwapInfo fields, providing a unified internal interface.

SwapInfo returns error if both Swap and SwapInfo are provided. Typically the Kubernetes API guarantees that is not the case.

func (*GuestSettings) WithoutSwapFields added in v0.28.1

func (s *GuestSettings) WithoutSwapFields() *GuestSettings

type IPAllocation added in v0.11.0

type IPAllocation struct {
	ContainerID string `json:"id"`
	PodRef      string `json:"podref,omitempty"`
}

IPAllocation represents metadata about the pod/container owner of a specific IP coped from Whereabout CNI as their allocation functions used

func (*IPAllocation) DeepCopy added in v0.11.0

func (in *IPAllocation) DeepCopy() *IPAllocation

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAllocation.

func (*IPAllocation) DeepCopyInto added in v0.11.0

func (in *IPAllocation) DeepCopyInto(out *IPAllocation)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type IPPool added in v0.11.0

type IPPool struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec IPPoolSpec `json:"spec,omitempty"`
}

IPPool is the Schema for the ippools API

func (*IPPool) DeepCopy added in v0.11.0

func (in *IPPool) DeepCopy() *IPPool

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPPool.

func (*IPPool) DeepCopyInto added in v0.11.0

func (in *IPPool) DeepCopyInto(out *IPPool)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*IPPool) DeepCopyObject added in v0.11.0

func (in *IPPool) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type IPPoolList added in v0.11.0

type IPPoolList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []IPPool `json:"items"`
}

IPPoolList contains a list of IPPool

func (*IPPoolList) DeepCopy added in v0.11.0

func (in *IPPoolList) DeepCopy() *IPPoolList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPPoolList.

func (*IPPoolList) DeepCopyInto added in v0.11.0

func (in *IPPoolList) DeepCopyInto(out *IPPoolList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*IPPoolList) DeepCopyObject added in v0.11.0

func (in *IPPoolList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type IPPoolSpec added in v0.11.0

type IPPoolSpec struct {
	// Range is a RFC 4632/4291-style string that represents an IP address and prefix length in CIDR notation
	Range string `json:"range"`
	// Allocations is the set of allocated IPs for the given range. Its` indices are a direct mapping to the
	// IP with the same index/offset for the pool's range.
	Allocations map[string]IPAllocation `json:"allocations"`
}

IPPoolSpec defines the desired state of IPPool

func (*IPPoolSpec) DeepCopy added in v0.11.0

func (in *IPPoolSpec) DeepCopy() *IPPoolSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPPoolSpec.

func (*IPPoolSpec) DeepCopyInto added in v0.11.0

func (in *IPPoolSpec) DeepCopyInto(out *IPPoolSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MemorySlots

type MemorySlots struct {
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=128
	// +kubebuilder:validation:ExclusiveMaximum=false
	// +optional
	// +kubebuilder:default:=1
	Min *int32 `json:"min"`
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=128
	// +kubebuilder:validation:ExclusiveMaximum=false
	// +optional
	Max *int32 `json:"max,omitempty"`
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=128
	// +kubebuilder:validation:ExclusiveMaximum=false
	// +optional
	Use *int32 `json:"use,omitempty"`
}

func (*MemorySlots) DeepCopy

func (in *MemorySlots) DeepCopy() *MemorySlots

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemorySlots.

func (*MemorySlots) DeepCopyInto

func (in *MemorySlots) DeepCopyInto(out *MemorySlots)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MigrationInfo

type MigrationInfo struct {
	// +optional
	Status string `json:"status,omitempty"`
	// +optional
	TotalTimeMs int64 `json:"totalTimeMs,omitempty"`
	// +optional
	SetupTimeMs int64 `json:"setupTimeMs,omitempty"`
	// +optional
	DowntimeMs int64 `json:"downtimeMs,omitempty"`
	// +optional
	Ram MigrationInfoRam `json:"ram,omitempty"`
	// +optional
	Compression MigrationInfoCompression `json:"compression,omitempty"`
}

func (*MigrationInfo) DeepCopy

func (in *MigrationInfo) DeepCopy() *MigrationInfo

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MigrationInfo.

func (*MigrationInfo) DeepCopyInto

func (in *MigrationInfo) DeepCopyInto(out *MigrationInfo)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MigrationInfoCompression

type MigrationInfoCompression struct {
	// +optional
	CompressedSize int64 `json:"compressedSize,omitempty"`
	// +optional
	CompressionRate int64 `json:"compressionRate,omitempty"`
}

func (*MigrationInfoCompression) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MigrationInfoCompression.

func (*MigrationInfoCompression) DeepCopyInto

func (in *MigrationInfoCompression) DeepCopyInto(out *MigrationInfoCompression)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MigrationInfoRam

type MigrationInfoRam struct {
	// +optional
	Transferred int64 `json:"transferred,omitempty"`
	// +optional
	Remaining int64 `json:"remaining,omitempty"`
	// +optional
	Total int64 `json:"total,omitempty"`
}

func (*MigrationInfoRam) DeepCopy

func (in *MigrationInfoRam) DeepCopy() *MigrationInfoRam

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MigrationInfoRam.

func (*MigrationInfoRam) DeepCopyInto

func (in *MigrationInfoRam) DeepCopyInto(out *MigrationInfoRam)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MilliCPU added in v0.7.0

type MilliCPU uint32 // note: pattern is more restrictive than resource.Quantity, because we're just using it for CPU

MilliCPU is a special type to represent vCPUs * 1000 e.g. 2 vCPU is 2000, 0.25 is 250

+kubebuilder:validation:XIntOrString +kubebuilder:validation:Pattern=^[0-9]+((\.[0-9]*)?|m)

func MilliCPUFromResourceQuantity added in v0.7.0

func MilliCPUFromResourceQuantity(r resource.Quantity) MilliCPU

MilliCPUFromResourceQuantity converts resource.Quantity into MilliCPU

func (MilliCPU) AsFloat64 added in v0.8.0

func (m MilliCPU) AsFloat64() float64

AsFloat64 converts the MilliCPU value into a float64 of CPU

This should be preferred over calling m.ToResourceQuantity().AsApproximateFloat64(), because going through the resource.Quantity can produce less accurate floats.

func (MilliCPU) Format added in v0.7.0

func (m MilliCPU) Format(state fmt.State, verb rune)

func (MilliCPU) MarshalJSON added in v0.7.0

func (m MilliCPU) MarshalJSON() ([]byte, error)

func (MilliCPU) RoundedUp added in v0.7.0

func (m MilliCPU) RoundedUp() uint32

RoundedUp returns the smallest integer number of CPUs greater than or equal to the effective value of m.

func (MilliCPU) ToResourceQuantity added in v0.7.0

func (m MilliCPU) ToResourceQuantity() *resource.Quantity

ToResourceQuantity converts a MilliCPU to resource.Quantity this is useful for formatting/serialization

func (*MilliCPU) UnmarshalJSON added in v0.7.0

func (m *MilliCPU) UnmarshalJSON(data []byte) error

this is used to parse scheduler config and communication between components we used resource.Quantity as underlying transport format for MilliCPU

type Port

type Port struct {
	// If specified, this must be an IANA_SVC_NAME and unique within the pod. Each
	// named port in a pod must have a unique name. Name for the port that can be
	// referred to by services.
	Name string `json:"name,omitempty"`
	// Number of port to expose on the pod's IP address.
	// This must be a valid port number, 0 < x < 65536.
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=65535
	Port int `json:"port"`
	// Protocol for port. Must be UDP or TCP.
	// Defaults to "TCP".
	// +kubebuilder:default:=TCP
	Protocol Protocol `json:"protocol,omitempty"`
}

func (*Port) DeepCopy

func (in *Port) DeepCopy() *Port

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Port.

func (*Port) DeepCopyInto

func (in *Port) DeepCopyInto(out *Port)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Protocol

type Protocol string
const (
	// ProtocolTCP is the TCP protocol.
	ProtocolTCP Protocol = "TCP"
	// ProtocolUDP is the UDP protocol.
	ProtocolUDP Protocol = "UDP"
)

type RestartPolicy

type RestartPolicy string

+kubebuilder:validation:Enum=Always;OnFailure;Never

const (
	RestartPolicyAlways    RestartPolicy = "Always"
	RestartPolicyOnFailure RestartPolicy = "OnFailure"
	RestartPolicyNever     RestartPolicy = "Never"
)

type RootDisk

type RootDisk struct {
	Image string `json:"image"`
	// +optional
	Size resource.Quantity `json:"size,omitempty"`
	// +optional
	// +kubebuilder:default:="IfNotPresent"
	ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy"`
	// +optional
	Execute []string `json:"execute,omitempty"`
}

func (*RootDisk) DeepCopy

func (in *RootDisk) DeepCopy() *RootDisk

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RootDisk.

func (*RootDisk) DeepCopyInto

func (in *RootDisk) DeepCopyInto(out *RootDisk)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SwapInfo added in v0.28.0

type SwapInfo struct {
	// Size sets the size of the swap in the VM. The amount of space used on the host may be
	// slightly more (by a few MiBs). The information reported by `cat /proc/meminfo` may show
	// slightly less, due to a single page header (typically 4KiB).
	Size resource.Quantity `json:"size"`
	// SkipSwapon instructs the VM to *not* run swapon for the swap on startup.
	//
	// This is intended to be used in cases where you will *always* resize the swap post-startup,
	// and don't need it available before that resizing.
	//
	// +optional
	SkipSwapon *bool `json:"skipSwapon,omitempty"`
}

func (*SwapInfo) DeepCopy added in v0.28.0

func (in *SwapInfo) DeepCopy() *SwapInfo

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SwapInfo.

func (*SwapInfo) DeepCopyInto added in v0.28.0

func (in *SwapInfo) DeepCopyInto(out *SwapInfo)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TmpfsDiskSource

type TmpfsDiskSource struct {
	Size resource.Quantity `json:"size"`
}

func (*TmpfsDiskSource) DeepCopy

func (in *TmpfsDiskSource) DeepCopy() *TmpfsDiskSource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TmpfsDiskSource.

func (*TmpfsDiskSource) DeepCopyInto

func (in *TmpfsDiskSource) DeepCopyInto(out *TmpfsDiskSource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type VirtualMachine

type VirtualMachine struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   VirtualMachineSpec   `json:"spec,omitempty"`
	Status VirtualMachineStatus `json:"status,omitempty"`
}

VirtualMachine is the Schema for the virtualmachines API +kubebuilder:printcolumn:name="Cpus",type=string,JSONPath=`.status.cpus` +kubebuilder:printcolumn:name="Memory",type=string,JSONPath=`.status.memorySize` +kubebuilder:printcolumn:name="Pod",type=string,JSONPath=`.status.podName` +kubebuilder:printcolumn:name="ExtraIP",type=string,JSONPath=`.status.extraNetIP` +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.phase` +kubebuilder:printcolumn:name="Restarts",type=string,JSONPath=`.status.restarts` +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +kubebuilder:printcolumn:name="Node",type=string,priority=1,JSONPath=`.status.node` +kubebuilder:printcolumn:name="Image",type=string,priority=1,JSONPath=`.spec.guest.rootDisk.image`

func (*VirtualMachine) Cleanup added in v0.8.0

func (vm *VirtualMachine) Cleanup()

func (*VirtualMachine) DeepCopy

func (in *VirtualMachine) DeepCopy() *VirtualMachine

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachine.

func (*VirtualMachine) DeepCopyInto

func (in *VirtualMachine) DeepCopyInto(out *VirtualMachine)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*VirtualMachine) DeepCopyObject

func (in *VirtualMachine) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*VirtualMachine) Default

func (r *VirtualMachine) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (*VirtualMachine) HasRestarted added in v0.24.0

func (vm *VirtualMachine) HasRestarted() bool

func (*VirtualMachine) SetupWebhookWithManager

func (r *VirtualMachine) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*VirtualMachine) ValidateCreate

func (r *VirtualMachine) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*VirtualMachine) ValidateDelete

func (r *VirtualMachine) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*VirtualMachine) ValidateUpdate

func (r *VirtualMachine) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type VirtualMachineList

type VirtualMachineList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []VirtualMachine `json:"items"`
}

VirtualMachineList contains a list of VirtualMachine

func (*VirtualMachineList) DeepCopy

func (in *VirtualMachineList) DeepCopy() *VirtualMachineList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineList.

func (*VirtualMachineList) DeepCopyInto

func (in *VirtualMachineList) DeepCopyInto(out *VirtualMachineList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*VirtualMachineList) DeepCopyObject

func (in *VirtualMachineList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type VirtualMachineMigration

type VirtualMachineMigration struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   VirtualMachineMigrationSpec   `json:"spec,omitempty"`
	Status VirtualMachineMigrationStatus `json:"status,omitempty"`
}

VirtualMachineMigration is the Schema for the virtualmachinemigrations API +kubebuilder:printcolumn:name="VM",type=string,JSONPath=`.spec.vmName` +kubebuilder:printcolumn:name="Source",type=string,JSONPath=`.status.sourcePodName` +kubebuilder:printcolumn:name="SourceIP",type=string,priority=1,JSONPath=`.status.sourcePodIP` +kubebuilder:printcolumn:name="Target",type=string,JSONPath=`.status.targetPodName` +kubebuilder:printcolumn:name="TargetIP",type=string,priority=1,JSONPath=`.status.targetPodIP` +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.phase` +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

func (*VirtualMachineMigration) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineMigration.

func (*VirtualMachineMigration) DeepCopyInto

func (in *VirtualMachineMigration) DeepCopyInto(out *VirtualMachineMigration)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*VirtualMachineMigration) DeepCopyObject

func (in *VirtualMachineMigration) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*VirtualMachineMigration) Default

func (r *VirtualMachineMigration) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (*VirtualMachineMigration) SetupWebhookWithManager

func (r *VirtualMachineMigration) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*VirtualMachineMigration) ValidateCreate

func (r *VirtualMachineMigration) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*VirtualMachineMigration) ValidateDelete

func (r *VirtualMachineMigration) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*VirtualMachineMigration) ValidateUpdate

func (r *VirtualMachineMigration) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type VirtualMachineMigrationList

type VirtualMachineMigrationList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []VirtualMachineMigration `json:"items"`
}

VirtualMachineMigrationList contains a list of VirtualMachineMigration

func (*VirtualMachineMigrationList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineMigrationList.

func (*VirtualMachineMigrationList) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*VirtualMachineMigrationList) DeepCopyObject

func (in *VirtualMachineMigrationList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type VirtualMachineMigrationSpec

type VirtualMachineMigrationSpec struct {
	VmName string `json:"vmName"`

	// TODO: not implemented
	// +optional
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
	// TODO: not implemented
	// +optional
	NodeAffinity *corev1.NodeAffinity `json:"nodeAffinity,omitempty"`

	// +optional
	// +kubebuilder:default:=true
	PreventMigrationToSameHost bool `json:"preventMigrationToSameHost"`

	// TODO: not implemented
	// Set 1 hour as default timeout for migration
	// +optional
	// +kubebuilder:default:=3600
	CompletionTimeout int32 `json:"completionTimeout"`

	// Trigger incremental disk copy migration by default, otherwise full disk copy used in migration
	// +optional
	// +kubebuilder:default:=true
	Incremental bool `json:"incremental"`

	// Use PostCopy migration by default
	// +optional
	// +kubebuilder:default:=false
	AllowPostCopy bool `json:"allowPostCopy"`

	// Use Auto converge by default
	// +optional
	// +kubebuilder:default:=true
	AutoConverge bool `json:"autoConverge"`

	// Set 1 Gbyte/sec as default for migration bandwidth
	// +optional
	// +kubebuilder:default:="1Gi"
	MaxBandwidth resource.Quantity `json:"maxBandwidth"`
}

VirtualMachineMigrationSpec defines the desired state of VirtualMachineMigration

func (*VirtualMachineMigrationSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineMigrationSpec.

func (*VirtualMachineMigrationSpec) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type VirtualMachineMigrationStatus

type VirtualMachineMigrationStatus struct {
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`

	// The phase of a VM is a simple, high-level summary of where the VM is in its lifecycle.
	// +optional
	Phase VmmPhase `json:"phase,omitempty"`
	// +optional
	SourcePodName string `json:"sourcePodName,omitempty"`
	// +optional
	TargetPodName string `json:"targetPodName,omitempty"`
	// +optional
	SourcePodIP string `json:"sourcePodIP,omitempty"`
	// +optional
	TargetPodIP string `json:"targetPodIP,omitempty"`
	// +optional
	SourceNode string `json:"sourceNode,omitempty"`
	// +optional
	TargetNode string `json:"targetNode,omitempty"`
	// +optional
	Info MigrationInfo `json:"info,omitempty"`
}

VirtualMachineMigrationStatus defines the observed state of VirtualMachineMigration

func (*VirtualMachineMigrationStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineMigrationStatus.

func (*VirtualMachineMigrationStatus) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type VirtualMachineResources added in v0.27.0

type VirtualMachineResources struct {
	CPUs           CPUs              `json:"cpus"`
	MemorySlots    MemorySlots       `json:"memorySlots"`
	MemorySlotSize resource.Quantity `json:"memorySlotSize"`
}

VirtualMachineResources provides information about a VM's resource allocations.

func (*VirtualMachineResources) DeepCopy added in v0.27.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineResources.

func (*VirtualMachineResources) DeepCopyInto added in v0.27.0

func (in *VirtualMachineResources) DeepCopyInto(out *VirtualMachineResources)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type VirtualMachineSpec

type VirtualMachineSpec struct {
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=65535
	// +kubebuilder:default:=20183
	// +optional
	QMP int32 `json:"qmp,omitempty"`

	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=65535
	// +kubebuilder:default:=20184
	// +optional
	QMPManual int32 `json:"qmpManual,omitempty"`

	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=65535
	// +kubebuilder:default:=25183
	// +optional
	RunnerPort int32 `json:"runnerPort,omitempty"`

	// +kubebuilder:default:=5
	// +optional
	TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds"`

	NodeSelector       map[string]string           `json:"nodeSelector,omitempty"`
	Affinity           *corev1.Affinity            `json:"affinity,omitempty"`
	Tolerations        []corev1.Toleration         `json:"tolerations,omitempty"`
	SchedulerName      string                      `json:"schedulerName,omitempty"`
	ServiceAccountName string                      `json:"serviceAccountName,omitempty"`
	PodResources       corev1.ResourceRequirements `json:"podResources,omitempty"`

	// +kubebuilder:default:=Always
	// +optional
	RestartPolicy RestartPolicy `json:"restartPolicy"`

	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

	Guest Guest `json:"guest"`

	// Running init containers is costly, so InitScript field should be preferred over ExtraInitContainers
	ExtraInitContainers []corev1.Container `json:"extraInitContainers,omitempty"`

	// InitScript will be executed in the main container before VM is started.
	// +optional
	InitScript string `json:"initScript,omitempty"`

	// List of disk that can be mounted by virtual machine.
	// +optional
	Disks []Disk `json:"disks,omitempty"`

	// Extra network interface attached to network provided by Mutlus CNI.
	// +optional
	ExtraNetwork *ExtraNetwork `json:"extraNetwork,omitempty"`

	// +optional
	ServiceLinks *bool `json:"service_links,omitempty"`

	// Use KVM acceleation
	// +kubebuilder:default:=true
	// +optional
	EnableAcceleration *bool `json:"enableAcceleration,omitempty"`

	// Override for normal neonvm-runner image
	// +optional
	RunnerImage *string `json:"runnerImage,omitempty"`

	// Enable SSH on the VM. It works only if the VM image is built using VM Builder that
	// has SSH support (TODO: mention VM Builder version).
	// +kubebuilder:default:=true
	// +optional
	EnableSSH *bool `json:"enableSSH,omitempty"`
}

VirtualMachineSpec defines the desired state of VirtualMachine

func (*VirtualMachineSpec) DeepCopy

func (in *VirtualMachineSpec) DeepCopy() *VirtualMachineSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineSpec.

func (*VirtualMachineSpec) DeepCopyInto

func (in *VirtualMachineSpec) DeepCopyInto(out *VirtualMachineSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*VirtualMachineSpec) Resources added in v0.27.0

func (spec *VirtualMachineSpec) Resources() VirtualMachineResources

type VirtualMachineStatus

type VirtualMachineStatus struct {
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`

	// The phase of a VM is a simple, high-level summary of where the VM is in its lifecycle.
	// +optional
	Phase VmPhase `json:"phase,omitempty"`
	// Number of times the VM runner pod has been recreated
	// +optional
	RestartCount int32 `json:"restartCount"`
	// +optional
	PodName string `json:"podName,omitempty"`
	// +optional
	PodIP string `json:"podIP,omitempty"`
	// +optional
	ExtraNetIP string `json:"extraNetIP,omitempty"`
	// +optional
	ExtraNetMask string `json:"extraNetMask,omitempty"`
	// +optional
	Node string `json:"node,omitempty"`
	// +optional
	CPUs *MilliCPU `json:"cpus,omitempty"`
	// +optional
	MemorySize *resource.Quantity `json:"memorySize,omitempty"`
	// +optional
	SSHSecretName string `json:"sshSecretName,omitempty"`
}

VirtualMachineStatus defines the observed state of VirtualMachine

func (*VirtualMachineStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineStatus.

func (*VirtualMachineStatus) DeepCopyInto

func (in *VirtualMachineStatus) DeepCopyInto(out *VirtualMachineStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type VirtualMachineUsage added in v0.7.0

type VirtualMachineUsage struct {
	CPU    *resource.Quantity `json:"cpu"`
	Memory *resource.Quantity `json:"memory"`
}

VirtualMachineUsage provides information about a VM's current usage. This is the type of the JSON-encoded data in the VirtualMachineUsageAnnotation attached to each runner pod.

func (*VirtualMachineUsage) DeepCopy added in v0.8.0

func (in *VirtualMachineUsage) DeepCopy() *VirtualMachineUsage

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachineUsage.

func (*VirtualMachineUsage) DeepCopyInto added in v0.8.0

func (in *VirtualMachineUsage) DeepCopyInto(out *VirtualMachineUsage)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type VmPhase

type VmPhase string
const (
	// VmPending means the VM has been accepted by the system, but vm-runner pod
	// has not been started. This includes time before being bound to a node, as well as time spent
	// pulling images onto the host.
	VmPending VmPhase = "Pending"
	// VmRunning means the vm-runner pod has been bound to a node and have been started.
	VmRunning VmPhase = "Running"
	// VmSucceeded means that all containers in the vm-runner pod have voluntarily terminated
	// with a container exit code of 0, and the system is not going to restart any of these containers.
	VmSucceeded VmPhase = "Succeeded"
	// VmFailed means that all containers in the vm-runner pod have terminated, and at least one container has
	// terminated in a failure (exited with a non-zero exit code or was stopped by the system).
	VmFailed VmPhase = "Failed"
	// VmPreMigrating means that VM in preparation to start migration
	VmPreMigrating VmPhase = "PreMigrating"
	// VmMigrating means that VM in migration to another node
	VmMigrating VmPhase = "Migrating"
	// VmScaling means that devices are plugging/unplugging to/from the VM
	VmScaling VmPhase = "Scaling"
)

func (VmPhase) IsAlive added in v0.8.0

func (p VmPhase) IsAlive() bool

IsAlive returns whether the guest in the VM is expected to be running

type VmmPhase

type VmmPhase string
const (
	// VmmPending means the migration has been accepted by the system, but target vm-runner pod
	// has not been started. This includes time before being bound to a node, as well as time spent
	// pulling images onto the host.
	VmmPending VmmPhase = "Pending"
	// VmmRunning means the target vm-runner pod has been bound to a node and have been started.
	VmmRunning VmmPhase = "Running"
	// VmmSucceeded means that migration finisged with success
	VmmSucceeded VmmPhase = "Succeeded"
	// VmmFailed means that migration failed
	VmmFailed VmmPhase = "Failed"
)

Jump to

Keyboard shortcuts

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