v1

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: Apache-2.0 Imports: 13 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 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"`
}

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.
	// +kubebuilder:default:=neonvm-system/neonvm-overlay-net
	// +optional
	MultusNetwork string `json:"multusNetwork"`
}

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
	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"`
}

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 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) 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 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=integer,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="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) 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) 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:=true
	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 VirtualMachineSpec

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

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

	// +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"`
	PodResources  corev1.ResourceRequirements `json:"podResources,omitempty"`

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

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

	Guest Guest `json:"guest"`

	// 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"`
}

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.

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"`
	// +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"`
}

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.

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"
	// VmMigrating means that VM in migration to another node
	VmMigrating VmPhase = "Migrating"
)

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