builder

package
v0.3.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2021 License: Apache-2.0 Imports: 10 Imported by: 6

Documentation

Index

Constants

View Source
const (
	CloudInitTypeNoCloud     = "noCloud"
	CloudInitTypeConfigDrive = "configDrive"
	CloudInitDiskName        = "cloudinitdisk"
)
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 = "networks.harvesterhci.io/type"

	NetworkTypeVLAN   = "L2VlanNetwork"
	NetworkTypeCustom = "Custom"

	NetworkVLANConfigTemplate = `{"cniVersion":"0.3.1","name":"%s","type":"bridge","bridge":"harvester-br0","promiscMode":true,"vlan":%d,"ipam":{}}`
)
View Source
const (
	HarvesterAPIGroup                    = "harvesterhci.io"
	LabelAnnotationPrefixHarvester       = HarvesterAPIGroup + "/"
	LabelKeyVirtualMachineCreator        = LabelAnnotationPrefixHarvester + "creator"
	LabelKeyVirtualMachineName           = LabelAnnotationPrefixHarvester + "vmName"
	AnnotationKeyVirtualMachineSSHNames  = LabelAnnotationPrefixHarvester + "sshNames"
	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

func UintPtr

func UintPtr(in int) *uint

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
	InterfaceNames []string
}

func NewVMBuilder

func NewVMBuilder(creator string) *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 int, cloudInitSource CloudInitSource) *VMBuilder

func (*VMBuilder) ContainerDisk

func (v *VMBuilder) ContainerDisk(diskName, diskBus string, isCDRom bool, bootOrder int, 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 int) *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 int, pvcName string) *VMBuilder

func (*VMBuilder) HostName

func (v *VMBuilder) HostName(hostname string) *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 int, 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) SSHKey

func (v *VMBuilder) SSHKey(sshKeyName string) *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

Jump to

Keyboard shortcuts

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