Documentation ¶
Index ¶
- Constants
- Variables
- func AntiAffinityFromVMNode(vm *VM) *k8sv1.Affinity
- type Address
- type Alias
- type BIOS
- type Ballooning
- type BandWidth
- type Boot
- type BootMenu
- type BootOrder
- type Channel
- type ChannelSource
- type ChannelTarget
- type Clock
- type Console
- type ConsoleTarget
- type Devices
- type Disk
- type DiskAuth
- type DiskDriver
- type DiskSecret
- type DiskSource
- type DiskSourceHost
- type DiskTarget
- type DomainSpec
- type Entry
- type FilterRef
- type Graphics
- type Interface
- type InterfaceSource
- type InterfaceTarget
- type LinkState
- type Listen
- type Loader
- type MAC
- type Memory
- type Migration
- type MigrationList
- type MigrationPhase
- type MigrationSpec
- type MigrationStatus
- type Model
- type NVRam
- type OS
- type OSType
- type RandomGenerator
- type ReadOnly
- type SMBios
- type Serial
- type SerialTarget
- type Spice
- type SpiceInfo
- type SyncEvent
- type SysInfo
- type Timer
- type VM
- type VMCondition
- type VMConditionType
- type VMGraphics
- type VMList
- type VMPhase
- type VMSelector
- type VMSpec
- type VMStatus
- type Video
Constants ¶
const ( AppLabel string = "kubevirt.io/app" DomainLabel string = "kubevirt.io/domain" VMUIDLabel string = "kubevirt.io/vmUID" NodeNameLabel string = "kubevirt.io/nodeName" MigrationUIDLabel string = "kubevirt.io/migrationUID" MigrationLabel string = "kubevirt.io/migration" )
const GroupName = "kubevirt.io"
GroupName is the group name use in this package
Variables ¶
var GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}
GroupVersion is group version used to register these objects
var MigrationGroupVersionKind = schema.GroupVersionKind{Group: GroupName, Version: GroupVersion.Version, Kind: "Migration"}
var VMGroupVersionKind = schema.GroupVersionKind{Group: GroupName, Version: GroupVersion.Version, Kind: "VM"}
GroupVersionKind
Functions ¶
func AntiAffinityFromVMNode ¶
Given a VM, create a NodeSelectorTerm with anti-affinity for that VM's node. This is useful for the case when a migration away from a node must occur.
Types ¶
type Address ¶
type Address struct { Type string `json:"type"` Domain string `json:"domain"` Bus string `json:"bus"` Slot string `json:"slot"` Function string `json:"function"` }
func (Address) SwaggerDoc ¶
type BIOS ¶
type BIOS struct { }
TODO <loader readonly='yes' secure='no' type='rom'>/usr/lib/xen/boot/hvmloader</loader>
func (BIOS) SwaggerDoc ¶
type Ballooning ¶
type Ballooning struct {
Model string `json:"model"`
}
func (Ballooning) SwaggerDoc ¶
func (Ballooning) SwaggerDoc() map[string]string
type BootMenu ¶
type BootMenu struct { Enabled bool `json:"enabled,omitempty"` Timeout *uint `json:"timeout,omitempty"` }
func (BootMenu) SwaggerDoc ¶
type Channel ¶
type Channel struct { Type string `json:"type"` Source ChannelSource `json:"source,omitempty"` Target *ChannelTarget `json:"target,omitempty"` }
func (Channel) SwaggerDoc ¶
type ChannelSource ¶
func (ChannelSource) SwaggerDoc ¶
func (ChannelSource) SwaggerDoc() map[string]string
type ChannelTarget ¶
type ChannelTarget struct { Name string `json:"name,omitempty"` Type string `json:"type"` Address string `json:"address,omitempty"` Port uint `json:"port,omitempty"` }
func (ChannelTarget) SwaggerDoc ¶
func (ChannelTarget) SwaggerDoc() map[string]string
type Console ¶
type Console struct { Type string `json:"type"` Target *ConsoleTarget `json:"target,omitempty"` }
func (Console) SwaggerDoc ¶
type ConsoleTarget ¶
type ConsoleTarget struct { Type *string `json:"type,omitempty"` Port *uint `json:"port,omitempty"` }
func (ConsoleTarget) SwaggerDoc ¶
func (ConsoleTarget) SwaggerDoc() map[string]string
type Devices ¶
type Devices struct { Emulator string `json:"emulator,omitempty"` Interfaces []Interface `json:"interfaces,omitempty"` Channels []Channel `json:"channels,omitempty"` Video []Video `json:"video,omitempty"` Graphics []Graphics `json:"graphics,omitempty"` Ballooning *Ballooning `json:"memballoon,omitempty"` Disks []Disk `json:"disks,omitempty"` Serials []Serial `json:"serials,omitempty"` Consoles []Console `json:"consoles,omitempty"` }
func (Devices) SwaggerDoc ¶
type Disk ¶
type Disk struct { Device string `json:"device"` Snapshot string `json:"snapshot,omitempty"` Type string `json:"type"` Source DiskSource `json:"source"` Target DiskTarget `json:"target"` Serial string `json:"serial,omitempty"` Driver *DiskDriver `json:"driver,omitempty"` ReadOnly *ReadOnly `json:"readOnly,omitempty"` Auth *DiskAuth `json:"auth,omitempty"` }
func (Disk) SwaggerDoc ¶
type DiskAuth ¶
type DiskAuth struct { Username string `json:"username"` Secret *DiskSecret `json:"secret,omitempty"` }
func (DiskAuth) SwaggerDoc ¶
type DiskDriver ¶
type DiskDriver struct { Cache string `json:"cache,omitempty"` ErrorPolicy string `json:"errorPolicy,omitempty"` IO string `json:"io,omitempty"` Name string `json:"name,omitempty"` Type string `json:"type,omitempty"` }
func (DiskDriver) SwaggerDoc ¶
func (DiskDriver) SwaggerDoc() map[string]string
type DiskSecret ¶
func (DiskSecret) SwaggerDoc ¶
func (DiskSecret) SwaggerDoc() map[string]string
type DiskSource ¶
type DiskSource struct { File string `json:"file,omitempty"` StartupPolicy string `json:"startupPolicy,omitempty"` Protocol string `json:"protocol,omitempty"` Name string `json:"name,omitempty"` Host *DiskSourceHost `json:"host,omitempty"` }
func (DiskSource) SwaggerDoc ¶
func (DiskSource) SwaggerDoc() map[string]string
type DiskSourceHost ¶
func (DiskSourceHost) SwaggerDoc ¶
func (DiskSourceHost) SwaggerDoc() map[string]string
type DiskTarget ¶
func (DiskTarget) SwaggerDoc ¶
func (DiskTarget) SwaggerDoc() map[string]string
type DomainSpec ¶
type DomainSpec struct { Memory Memory `json:"memory"` Type string `json:"type"` OS OS `json:"os"` SysInfo *SysInfo `json:"sysInfo,omitempty"` Devices Devices `json:"devices"` Clock *Clock `json:"clock,omitempty"` }
func NewMinimalDomainSpec ¶
func NewMinimalDomainSpec() *DomainSpec
func (DomainSpec) SwaggerDoc ¶
func (DomainSpec) SwaggerDoc() map[string]string
type Entry ¶
func (Entry) SwaggerDoc ¶
type FilterRef ¶
type FilterRef struct {
Filter string `json:"filter"`
}
func (FilterRef) SwaggerDoc ¶
type Graphics ¶
type Graphics struct { AutoPort string `json:"autoPort,omitempty"` DefaultMode string `json:"defaultMode,omitempty"` Listen Listen `json:"listen,omitempty"` PasswdValidTo string `json:"passwdValidTo,omitempty"` Port int32 `json:"port,omitempty"` TLSPort int `json:"tlsPort,omitempty"` Type string `json:"type"` }
func (Graphics) SwaggerDoc ¶
type Interface ¶
type Interface struct { Address *Address `json:"address,omitempty"` Type string `json:"type"` Source InterfaceSource `json:"source"` Target *InterfaceTarget `json:"target,omitempty"` Model *Model `json:"model,omitempty"` MAC *MAC `json:"mac,omitempty"` BandWidth *BandWidth `json:"bandwidth,omitempty"` BootOrder *BootOrder `json:"boot,omitempty"` LinkState *LinkState `json:"link,omitempty"` FilterRef *FilterRef `json:"filterRef,omitempty"` Alias *Alias `json:"alias,omitempty"` }
func (Interface) SwaggerDoc ¶
type InterfaceSource ¶
type InterfaceSource struct { Network string `json:"network,omitempty"` Device string `json:"device,omitempty"` Bridge string `json:"bridge,omitempty"` }
func (InterfaceSource) SwaggerDoc ¶
func (InterfaceSource) SwaggerDoc() map[string]string
type InterfaceTarget ¶
type InterfaceTarget struct {
Device string `json:"dev"`
}
func (InterfaceTarget) SwaggerDoc ¶
func (InterfaceTarget) SwaggerDoc() map[string]string
type LinkState ¶
type LinkState struct {
State string `json:"state"`
}
func (LinkState) SwaggerDoc ¶
type Listen ¶
type Listen struct { Type string `json:"type"` Address string `json:"address,omitempty"` Network string `json:"network,omitempty"` }
func (Listen) SwaggerDoc ¶
type Loader ¶
type Loader struct { }
TODO <bios useserial='yes' rebootTimeout='0'/>
func (Loader) SwaggerDoc ¶
type Memory ¶
func (Memory) SwaggerDoc ¶
type Migration ¶
type Migration struct { metav1.TypeMeta `json:",inline"` ObjectMeta metav1.ObjectMeta `json:"metadata,omitempty"` Spec MigrationSpec `json:"spec,omitempty" valid:"required"` Status MigrationStatus `json:"status,omitempty"` }
A Migration is a job that moves a Virtual Machine from one node to another
func NewMinimalMigration ¶
TODO validate that this is correct
func (*Migration) GetObjectMeta ¶
Required to satisfy ObjectMetaAccessor interface
func (Migration) SwaggerDoc ¶
func (*Migration) UnmarshalJSON ¶
type MigrationList ¶
type MigrationList struct { metav1.TypeMeta `json:",inline"` ListMeta metav1.ListMeta `json:"metadata,omitempty"` Items []Migration `json:"items"` }
A list of Migrations
func (*MigrationList) GetListMeta ¶
func (ml *MigrationList) GetListMeta() metav1.List
Required to satisfy ListMetaAccessor interface
func (*MigrationList) GetObjectKind ¶
func (ml *MigrationList) GetObjectKind() schema.ObjectKind
Required to satisfy Object interface
func (MigrationList) SwaggerDoc ¶
func (MigrationList) SwaggerDoc() map[string]string
func (*MigrationList) UnmarshalJSON ¶
func (ml *MigrationList) UnmarshalJSON(data []byte) error
type MigrationPhase ¶
type MigrationPhase string
const ( // Create Migration has been called but nothing has been done with it MigrationUnknown MigrationPhase = "" // Migration has been scheduled but no update on the status has been recorded MigrationRunning MigrationPhase = "Running" // Migration has completed successfully MigrationSucceeded MigrationPhase = "Succeeded" // Migration has failed. The Status structure of the associated Virtual Machine // Will indicate whether if the error was fatal. MigrationFailed MigrationPhase = "Failed" )
type MigrationSpec ¶
type MigrationSpec struct { // Criterias for selecting the VM to migrate. // For example // selector: // name: testvm // will select the VM `testvm` for migration Selector VMSelector `json:"selector"` // Criteria to use when selecting the destination for the migration // for example, to select by the hostname, specify `kubernetes.io/hostname: master` // other possible choices include the hardware required to run the vm or // or lableing of the nodes to indicate their roles in larger applications. // examples: // disktype: ssd, // randomGenerator: /dev/random, // randomGenerator: superfastdevice, // app: mysql, // licensedForServiceX: true // Note that these selectors are additions to the node selectors on the VM itself and they must not exist on the VM. // If they are conflicting with the VM, no migration will be started. NodeSelector map[string]string `json:"nodeSelector,omitempty"` }
MigrationSpec is a description of a VM Migration For example "destinationNodeName": "testvm" will migrate a VM called "testvm" in the namespace "default"
func (MigrationSpec) SwaggerDoc ¶
func (MigrationSpec) SwaggerDoc() map[string]string
type MigrationStatus ¶
type MigrationStatus struct { Phase MigrationPhase `json:"phase,omitempty"` Instance *types.UID `json:"instance,omitempty"` }
MigrationStatus is the last reported status of a VM Migratrion. Status may trail the actual state of a migration.
func (MigrationStatus) SwaggerDoc ¶
func (MigrationStatus) SwaggerDoc() map[string]string
type NVRam ¶
type NVRam struct { NVRam string `json:"nvRam,omitempty"` Template string `json:"template,omitempty"` }
func (NVRam) SwaggerDoc ¶
type OS ¶
type OS struct { Type OSType `json:"type"` SMBios *SMBios `json:"smBIOS,omitempty"` BootOrder []Boot `json:"bootOrder"` BootMenu *BootMenu `json:"bootMenu,omitempty"` BIOS *BIOS `json:"bios,omitempty"` }
func (OS) SwaggerDoc ¶
type OSType ¶
type OSType struct { OS string `json:"os"` Arch string `json:"arch,omitempty"` Machine string `json:"machine,omitempty"` }
func (OSType) SwaggerDoc ¶
type RandomGenerator ¶
type RandomGenerator struct { }
func (RandomGenerator) SwaggerDoc ¶
func (RandomGenerator) SwaggerDoc() map[string]string
type Serial ¶
type Serial struct { Type string `json:"type"` Target *SerialTarget `json:"target,omitempty"` }
func (Serial) SwaggerDoc ¶
type SerialTarget ¶
type SerialTarget struct {
Port *uint `json:"port,omitempty"`
}
func (SerialTarget) SwaggerDoc ¶
func (SerialTarget) SwaggerDoc() map[string]string
type Spice ¶
type Spice struct { metav1.TypeMeta `json:",inline" ini:"-"` ObjectMeta metav1.ObjectMeta `json:"metadata,omitempty" ini:"-"` Info SpiceInfo `json:"info,omitempty" valid:"required" ini:"virt-viewer"` }
func (Spice) SwaggerDoc ¶
type SpiceInfo ¶
type SpiceInfo struct { Type string `json:"type" ini:"type"` Host string `json:"host" ini:"host"` Port int32 `json:"port" ini:"port"` Proxy string `json:"proxy,omitempty" ini:"proxy,omitempty"` }
func (SpiceInfo) SwaggerDoc ¶
type SysInfo ¶
type SysInfo struct { Type string `json:"type"` System []Entry `json:"system"` BIOS []Entry `json:"bios"` BaseBoard []Entry `json:"baseBoard"` }
func (SysInfo) SwaggerDoc ¶
type Timer ¶
type Timer struct { Name string `json:"name"` TickPolicy string `json:"tickPolicy,omitempty"` Present string `json:"present,omitempty"` }
func (Timer) SwaggerDoc ¶
type VM ¶
type VM struct { metav1.TypeMeta `json:",inline"` ObjectMeta metav1.ObjectMeta `json:"metadata,omitempty"` // VM Spec contains the VM specification. Spec VMSpec `json:"spec,omitempty" valid:"required"` // Status is the high level overview of how the VM is doing. It contains information available to controllers and users. Status VMStatus `json:"status"` }
VM is *the* VM Definition. It represents a virtual machine in the runtime environment of kubernetes.
func NewMinimalVM ¶
func NewMinimalVMWithNS ¶
func NewVMReferenceFromName ¶
TODO Namespace could be different, also store it somewhere in the domain, so that we can report deletes on handler startup properly
func (*VM) GetObjectKind ¶
func (v *VM) GetObjectKind() schema.ObjectKind
Required to satisfy Object interface
func (*VM) GetObjectMeta ¶
Required to satisfy ObjectMetaAccessor interface
func (VM) SwaggerDoc ¶
func (*VM) UnmarshalJSON ¶
type VMCondition ¶
type VMCondition struct { Type VMConditionType `json:"type"` Status k8sv1.ConditionStatus `json:"status"` LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"` LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` Reason string `json:"reason,omitempty"` Message string `json:"message,omitempty"` }
func (VMCondition) SwaggerDoc ¶
func (VMCondition) SwaggerDoc() map[string]string
type VMConditionType ¶
type VMConditionType string
const ( // PodCreated means that the VM request was translated into a Pod which can be scheduled and started by // Kubernetes. PodCreated VMConditionType = "PodCreated" // VMReady means the pod is able to service requests and should be added to the // load balancing pools of all matching services. VMReady VMConditionType = "Ready" )
These are valid conditions of VMs.
type VMGraphics ¶
type VMGraphics struct { Type string `json:"type"` Host string `json:"host"` Port int32 `json:"port"` }
func (VMGraphics) SwaggerDoc ¶
func (VMGraphics) SwaggerDoc() map[string]string
type VMList ¶
type VMList struct { metav1.TypeMeta `json:",inline"` ListMeta metav1.ListMeta `json:"metadata,omitempty"` Items []VM `json:"items"` }
VMList is a list of VMs
func (*VMList) GetListMeta ¶
Required to satisfy ListMetaAccessor interface
func (*VMList) GetObjectKind ¶
func (vl *VMList) GetObjectKind() schema.ObjectKind
Required to satisfy Object interface
func (VMList) SwaggerDoc ¶
func (*VMList) UnmarshalJSON ¶
type VMPhase ¶
type VMPhase string
VMPhase is a label for the condition of a VM at the current time.
const ( //When a VM Object is first initialized and no phase, or Pending is present. VmPhaseUnset VMPhase = "" Pending VMPhase = "Pending" // VMPending means the VM has been accepted by the system. // Either a target pod does not yet exist or a target Pod exists but is not yet scheduled and in running state. Scheduling VMPhase = "Scheduling" // A target pod was scheduled and the system saw that Pod in runnig state. // Here is where the responsibility of virt-controller ends and virt-handler takes over. Scheduled VMPhase = "Scheduled" // VMRunning means the pod has been bound to a node and the VM is started. Running VMPhase = "Running" // VMMigrating means the VM is currently migrated by a controller. Migrating VMPhase = "Migrating" // VMSucceeded means that the VM stopped voluntarily, e.g. reacted to SIGTERM or shutdown was invoked from // inside the VM. Succeeded VMPhase = "Succeeded" // VMFailed means that associated Pod is in failure state (exited with a non-zero exit code or was stopped by // the system). Failed VMPhase = "Failed" // VMUnknown means that for some reason the state of the VM could not be obtained, typically due // to an error in communicating with the host of the VM. Unknown VMPhase = "Unknown" )
These are the valid statuses of pods.
type VMSelector ¶
type VMSelector struct { // Name of the VM to migrate Name string `json:"name" valid:"required"` }
func (VMSelector) SwaggerDoc ¶
func (VMSelector) SwaggerDoc() map[string]string
type VMSpec ¶
type VMSpec struct { // Domain is the actual libvirt domain. Domain *DomainSpec `json:"domain,omitempty"` // If labels are specified, only nodes marked with all of these labels are considered when scheduling the VM. NodeSelector map[string]string `json:"nodeSelector,omitempty"` }
VMSpec is a description of a VM. Not to be confused with api.DomainSpec in virt-handler. It is expected that v1.DomainSpec will be merged into this structure.
func (VMSpec) SwaggerDoc ¶
type VMStatus ¶
type VMStatus struct { // NodeName is the name where the VM is currently running. NodeName string `json:"nodeName,omitempty"` // MigrationNodeName is the node where the VM is live migrating to. MigrationNodeName string `json:"migrationNodeName,omitempty"` // Conditions are specific points in VM's pod runtime. Conditions []VMCondition `json:"conditions,omitempty"` // Phase is the status of the VM in kubernetes world. It is not the VM status, but partially correlates to it. Phase VMPhase `json:"phase"` // Graphics represent the details of available graphical consoles. Graphics []VMGraphics `json:"graphics"` }
VMStatus represents information about the status of a VM. Status may trail the actual state of a system.