builder

package
v1.4.0-dev-20240819 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: Apache-2.0 Imports: 9 Imported by: 6

Documentation

Index

Constants

View Source
const (
	CloudInitTypeNoCloud     = "noCloud"
	CloudInitTypeConfigDrive = "configDrive"
	CloudInitDiskName        = "cloudinitdisk"
)
View Source
const (
	InputTypeTablet = "tablet"
	InputBusUSB     = "usb"
	InputBusVirtio  = "virtio"
)
View Source
const (
	StorageClassNamePrefix = "longhorn"

	DiskTypeDisk  = "disk"
	DiskTypeCDRom = "cd-rom"

	DiskBusVirtio = "virtio"
	DiskBusScsi   = "scsi"
	DiskBusSata   = "sata"

	PersistentVolumeModeBlock      = "Block"
	PersistentVolumeModeFilesystem = "Filesystem"

	PersistentVolumeAccessModeReadWriteOnce = "ReadWriteOnce"
	PersistentVolumeAccessModeReadOnlyMany  = "ReadOnlyMany"
	PersistentVolumeAccessModeReadWriteMany = "ReadWriteMany"

	DefaultDiskSize        = "10Gi"
	DefaultImagePullPolicy = "IfNotPresent"
)
View Source
const (
	NetworkInterfaceTypeBridge     = "bridge"
	NetworkInterfaceTypeMasquerade = "masquerade"

	LabelKeyNetworkType = "network.harvesterhci.io/type"

	NetworkTypeVLAN   = "L2VlanNetwork"
	NetworkTypeCustom = "Custom"

	NetworkVLANConfigTemplate = `{"cniVersion":"0.3.1","name":"%s","type":"bridge","bridge":"%s-br","promiscMode":true,"vlan":%d,"ipam":{}}`
)
View Source
const (
	HarvesterAPIGroup                                     = "harvesterhci.io"
	LabelAnnotationPrefixHarvester                        = HarvesterAPIGroup + "/"
	LabelKeyVirtualMachineCreator                         = LabelAnnotationPrefixHarvester + "creator"
	LabelKeyVirtualMachineName                            = LabelAnnotationPrefixHarvester + "vmName"
	AnnotationKeyVirtualMachineSSHNames                   = LabelAnnotationPrefixHarvester + "sshNames"
	AnnotationKeyVirtualMachineWaitForLeaseInterfaceNames = LabelAnnotationPrefixHarvester + "waitForLeaseInterfaceNames"
	AnnotationKeyVirtualMachineDiskNames                  = LabelAnnotationPrefixHarvester + "diskNames"
	AnnotationKeyImageID                                  = LabelAnnotationPrefixHarvester + "imageId"

	AnnotationPrefixCattleField = "field.cattle.io/"
	LabelPrefixHarvesterTag     = "tag.harvesterhci.io/"
	AnnotationKeyDescription    = AnnotationPrefixCattleField + "description"
)

Variables

This section is empty.

Functions

func BuildImageStorageClassName

func BuildImageStorageClassName(namespace, name string) string

Types

type CloudInitSource

type CloudInitSource struct {
	CloudInitType         string
	UserDataSecretName    string
	UserDataBase64        string
	UserData              string
	NetworkDataSecretName string
	NetworkDataBase64     string
	NetworkData           string
}

type PersistentVolumeClaimOption

type PersistentVolumeClaimOption struct {
	ImageID          string
	VolumeMode       corev1.PersistentVolumeMode
	AccessMode       corev1.PersistentVolumeAccessMode
	StorageClassName *string
	Annotations      map[string]string
}

type VMBuilder

type VMBuilder struct {
	VirtualMachine             *kubevirtv1.VirtualMachine
	SSHNames                   []string
	WaitForLeaseInterfaceNames []string
}

func NewVMBuilder

func NewVMBuilder(creator string) *VMBuilder

func (*VMBuilder) Affinity added in v1.1.0

func (v *VMBuilder) Affinity(affinity *corev1.Affinity) *VMBuilder

func (*VMBuilder) Annotations

func (v *VMBuilder) Annotations(annotations map[string]string) *VMBuilder

func (*VMBuilder) CPU

func (v *VMBuilder) CPU(cores int) *VMBuilder

func (*VMBuilder) CloudInit

func (v *VMBuilder) CloudInit(diskName string, cloudInitSource CloudInitSource) *VMBuilder

func (*VMBuilder) CloudInitDisk

func (v *VMBuilder) CloudInitDisk(diskName, diskBus string, isCDRom bool, bootOrder uint, cloudInitSource CloudInitSource) *VMBuilder

func (*VMBuilder) ContainerDisk

func (v *VMBuilder) ContainerDisk(diskName, diskBus string, isCDRom bool, bootOrder uint, imageName, ImagePullPolicy string) *VMBuilder

func (*VMBuilder) ContainerDiskVolume

func (v *VMBuilder) ContainerDiskVolume(diskName, imageName, ImagePullPolicy string) *VMBuilder

func (*VMBuilder) DefaultPodAntiAffinity

func (v *VMBuilder) DefaultPodAntiAffinity() *VMBuilder

func (*VMBuilder) Description

func (v *VMBuilder) Description(description string) *VMBuilder

func (*VMBuilder) Disk

func (v *VMBuilder) Disk(diskName, diskBus string, isCDRom bool, bootOrder uint) *VMBuilder

func (*VMBuilder) EvictionStrategy

func (v *VMBuilder) EvictionStrategy(liveMigrate bool) *VMBuilder

func (*VMBuilder) ExistingPVCVolume

func (v *VMBuilder) ExistingPVCVolume(diskName, pvcName string, hotpluggable bool) *VMBuilder

func (*VMBuilder) ExistingVolumeDisk

func (v *VMBuilder) ExistingVolumeDisk(diskName, diskBus string, isCDRom, hotpluggable bool, bootOrder uint, pvcName string) *VMBuilder

func (*VMBuilder) GPU added in v1.1.2

func (v *VMBuilder) GPU(name, hostDeviceName, tag string, virtualGPUOptions *kubevirtv1.VGPUOptions) *VMBuilder

func (*VMBuilder) HostDevice added in v1.1.2

func (v *VMBuilder) HostDevice(name, hostDeviceName, tag string) *VMBuilder

func (*VMBuilder) HostName

func (v *VMBuilder) HostName(hostname string) *VMBuilder

func (*VMBuilder) Input added in v1.1.2

func (v *VMBuilder) Input(inputName string, inputType kubevirtv1.InputType, inputBus kubevirtv1.InputBus) *VMBuilder

func (*VMBuilder) Interface

func (v *VMBuilder) Interface(interfaceName, interfaceModel, interfaceMACAddress string, interfaceType string) *VMBuilder

func (*VMBuilder) Labels

func (v *VMBuilder) Labels(labels map[string]string) *VMBuilder

func (*VMBuilder) MachineType

func (v *VMBuilder) MachineType(machineType string) *VMBuilder

func (*VMBuilder) Memory

func (v *VMBuilder) Memory(memory string) *VMBuilder

func (*VMBuilder) Name

func (v *VMBuilder) Name(name string) *VMBuilder

func (*VMBuilder) Namespace

func (v *VMBuilder) Namespace(namespace string) *VMBuilder

func (*VMBuilder) Network

func (v *VMBuilder) Network(interfaceName, networkName string) *VMBuilder

func (*VMBuilder) NetworkInterface

func (v *VMBuilder) NetworkInterface(interfaceName, interfaceModel, interfaceMACAddress, interfaceType, networkName string) *VMBuilder

func (*VMBuilder) PVCDisk

func (v *VMBuilder) PVCDisk(diskName, diskBus string, isCDRom, hotpluggable bool, bootOrder uint, diskSize, pvcName string, opt *PersistentVolumeClaimOption) *VMBuilder

func (*VMBuilder) PVCVolume

func (v *VMBuilder) PVCVolume(diskName, diskSize, pvcName string, hotpluggable bool, opt *PersistentVolumeClaimOption) *VMBuilder

func (*VMBuilder) PodAntiAffinity

func (v *VMBuilder) PodAntiAffinity(podAffinityTerm corev1.PodAffinityTerm, soft bool, weight int32) *VMBuilder

func (*VMBuilder) Run

func (v *VMBuilder) Run(start bool) *VMBuilder

func (*VMBuilder) RunStrategy added in v1.0.2

func (v *VMBuilder) RunStrategy(runStrategy kubevirtv1.VirtualMachineRunStrategy) *VMBuilder

func (*VMBuilder) SSHKey

func (v *VMBuilder) SSHKey(sshKeyName string) *VMBuilder

func (*VMBuilder) TPM added in v1.1.2

func (v *VMBuilder) TPM() *VMBuilder

func (*VMBuilder) Update

func (v *VMBuilder) Update(vm *kubevirtv1.VirtualMachine) *VMBuilder

func (*VMBuilder) VM

func (*VMBuilder) Volume

func (v *VMBuilder) Volume(diskName string, volume kubevirtv1.Volume) *VMBuilder

func (*VMBuilder) WaitForLease added in v1.0.3

func (v *VMBuilder) WaitForLease(interfaceName string) *VMBuilder

Jump to

Keyboard shortcuts

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