v1alpha1

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the infrastructure v1alpha1 API group +kubebuilder:object:generate=true +groupName=infrastructure.cluster.x-k8s.io

Index

Constants

View Source
const (
	// VMProvisionedCondition documents the status of the provisioning of a ProxmoxMachine and its underlying ProxmoxVM.
	VMProvisionedCondition clusterv1.ConditionType = "VMProvisioned"

	// VMProvisionFailedReason used for failures during instance provisioning.
	VMProvisionFailedReason = "VMProvisionFailed"

	// VMTerminatedReason used when vm is being terminated.
	VMTerminatedReason = "VMTerminated"

	// WaitingForClusterInfrastructureReason (Severity=Info) documents a ProxmoxMachine waiting for the cluster
	// infrastructure to be ready before starting the provisioning process.
	//
	// NOTE: This reason does not apply to ProxmoxVM (this state happens before the ProxmoxVM is actually created).
	WaitingForClusterInfrastructureReason = "WaitingForClusterInfrastructure"

	// WaitingForBootstrapDataReason (Severity=Info) documents a ProxmoxMachine waiting for the bootstrap
	// script to be ready before starting the provisioning process.
	//
	// NOTE: This reason does not apply to ProxmoxVM (this state happens before the ProxmoxVM is actually created).
	WaitingForBootstrapDataReason = "WaitingForBootstrapData"

	// WaitingForStaticIPAllocationReason (Severity=Info) documents a ProxmoxVM waiting for the allocation of
	// a static IP address.
	WaitingForStaticIPAllocationReason = "WaitingForStaticIPAllocation"

	// CloningReason documents (Severity=Info) a ProxmoxMachine/ProxmoxVM currently executing the clone operation.
	CloningReason = "Cloning"

	// CloningFailedReason (Severity=Warning) documents a ProxmoxMachine/ProxmoxVM controller detecting
	// an error while provisioning; those kind of errors are usually transient and failed provisioning
	// are automatically re-tried by the controller.
	CloningFailedReason = "CloningFailed"

	// PoweringOnReason documents (Severity=Info) a ProxmoxMachine/ProxmoxVM currently executing the power on sequence.
	PoweringOnReason = "PoweringOn"

	// PoweringOnFailedReason (Severity=Warning) documents a ProxmoxMachine/ProxmoxVM controller detecting
	// an error while powering on; those kind of errors are usually transient and failed provisioning
	// are automatically re-tried by the controller.
	PoweringOnFailedReason = "PoweringOnFailed"

	// VMProvisionStarted used for starting vm provisioning.
	VMProvisionStarted = "VMProvisionStarted"

	// TaskFailure (Severity=Warning) documents a ProxmoxMachine/Proxmox task failure; the reconcile look will automatically
	// retry the operation, but a user intervention might be required to fix the problem.
	TaskFailure = "TaskFailure"

	// WaitingForNetworkAddressesReason (Severity=Info) documents a ProxmoxMachine waiting for the the machine network
	// settings to be reported after machine being powered on.
	//
	// NOTE: This reason does not apply to ProxmoxVM (this state happens after the ProxmoxVM is in ready state).
	WaitingForNetworkAddressesReason = "WaitingForNetworkAddresses"

	// NotFoundReason (Severity=Warning) documents the ProxmoxVM not found.
	NotFoundReason = "NotFound"

	// UnknownReason (Severity=Warning) documents the ProxmoxVM Unknown.
	UnknownReason = "Unknown"
)
View Source
const (
	// ProxmoxClusterKind the ProxmoxCluster kind.
	ProxmoxClusterKind = "ProxmoxCluster"
	// ClusterFinalizer allows cleaning up resources associated with
	// ProxmoxCluster before removing it from the apiserver.
	ClusterFinalizer = "proxmoxcluster.infrastructure.cluster.x-k8s.io"
)
View Source
const (
	// ProxmoxMachineKind is the ProxmoxMachine kind.
	ProxmoxMachineKind = "ProxmoxMachine"

	// MachineFinalizer allows cleaning up resources associated with
	// ProxmoxMachine before removing it from the API Server.
	MachineFinalizer = "proxmoxmachine.infrastructure.cluster.x-k8s.io"

	// DefaultReconcilerRequeue is the default value for the reconcile retry.
	DefaultReconcilerRequeue = 10 * time.Second

	// DefaultNetworkDevice is the default network device name.
	DefaultNetworkDevice = "net0"

	// DefaultSuffix is the default suffix for the network device.
	DefaultSuffix = "inet"

	// IPV4Format is the IP v4 format.
	IPV4Format = "v4"

	// IPV6Format is the IP v6 format.
	IPV6Format = "v6"
)
View Source
const (
	// ProxmoxClusterReady documents the status of ProxmoxCluster and its underlying resources.
	ProxmoxClusterReady clusterv1.ConditionType = "ClusterReady"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1alpha1"}

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

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

Functions

This section is empty.

Types

type AdditionalNetworkDevice

type AdditionalNetworkDevice struct {
	NetworkDevice `json:",inline"`

	// Name is the network device name.
	// must be unique within the virtual machine and different from the primary device 'net0'.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:XValidation:rule="self != 'net0'",message="additional network devices doesn't allow net0"
	Name string `json:"name"`

	// IPv4PoolRef is a reference to an IPAM Pool resource, which exposes IPv4 addresses.
	// The network device will use an available IP address from the referenced pool.
	// This can be combined with `IPv6PoolRef` in order to enable dual stack.
	// +optional
	// +kubebuilder:validation:XValidation:rule="self.apiGroup == 'ipam.cluster.x-k8s.io'",message="ipv4PoolRef allows only IPAM apiGroup ipam.cluster.x-k8s.io"
	// +kubebuilder:validation:XValidation:rule="self.kind == 'InClusterIPPool' || self.kind == 'GlobalInClusterIPPool'",message="ipv4PoolRef allows either InClusterIPPool or GlobalInClusterIPPool"
	IPv4PoolRef *corev1.TypedLocalObjectReference `json:"ipv4PoolRef,omitempty"`

	// IPv6PoolRef is a reference to an IPAM pool resource, which exposes IPv6 addresses.
	// The network device will use an available IP address from the referenced pool.
	// this can be combined with `IPv4PoolRef` in order to enable dual stack.
	// +optional
	// +kubebuilder:validation:XValidation:rule="self.apiGroup == 'ipam.cluster.x-k8s.io'",message="ipv6PoolRef allows only IPAM apiGroup ipam.cluster.x-k8s.io"
	// +kubebuilder:validation:XValidation:rule="self.kind == 'InClusterIPPool' || self.kind == 'GlobalInClusterIPPool'",message="ipv6PoolRef allows either InClusterIPPool or GlobalInClusterIPPool"
	IPv6PoolRef *corev1.TypedLocalObjectReference `json:"ipv6PoolRef,omitempty"`

	// DNSServers contains information about nameservers to be used for this interface.
	// If this field is not set, it will use the default dns servers from the ProxmoxCluster.
	// +optional
	// +kubebuilder:validation:MinItems=1
	DNSServers []string `json:"dnsServers,omitempty"`
}

AdditionalNetworkDevice the definition of a Proxmox network device. +kubebuilder:validation:XValidation:rule="self.ipv4PoolRef != null || self.ipv6PoolRef != null",message="at least one pool reference must be set, either ipv4PoolRef or ipv6PoolRef"

func (*AdditionalNetworkDevice) DeepCopy

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

func (*AdditionalNetworkDevice) DeepCopyInto

func (in *AdditionalNetworkDevice) DeepCopyInto(out *AdditionalNetworkDevice)

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

type DiskSize

type DiskSize struct {
	// Disk is the name of the disk device, that should be resized.
	// Example values are: ide[0-3], scsi[0-30], sata[0-5].
	Disk string `json:"disk"`

	// Size defines the size in gigabyte.
	//
	// As Proxmox does not support shrinking, the size
	// must be bigger than the already configured size in the
	// template.
	//
	// +kubebuilder:validation:Minimum=5
	SizeGB int32 `json:"sizeGb"`
}

DiskSize is contains values for the disk device and size.

func (*DiskSize) DeepCopy

func (in *DiskSize) DeepCopy() *DiskSize

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

func (*DiskSize) DeepCopyInto

func (in *DiskSize) DeepCopyInto(out *DiskSize)

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

func (*DiskSize) FormatSize

func (d *DiskSize) FormatSize() string

FormatSize returns the format required for the Proxmox API.

type IPAddress

type IPAddress struct {
	// IPV4 is the IP v4 address.
	// +optional
	IPV4 string `json:"ipv4,omitempty"`

	// IPV6 is the IP v6 address.
	// +optional
	IPV6 string `json:"ipv6,omitempty"`
}

IPAddress defines the IP addresses of a network interface.

func (*IPAddress) DeepCopy

func (in *IPAddress) DeepCopy() *IPAddress

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

func (*IPAddress) DeepCopyInto

func (in *IPAddress) DeepCopyInto(out *IPAddress)

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

type NetworkDevice

type NetworkDevice struct {
	// Bridge is the network bridge to attach to the machine.
	// +kubebuilder:validation:MinLength=1
	Bridge string `json:"bridge"`

	// Model is the network device model.
	// +optional
	// +kubebuilder:validation:Enum=e1000;virtio;rtl8139;vmxnet3
	// +kubebuilder:default=virtio
	Model *string `json:"model,omitempty"`
}

NetworkDevice defines the required details of a virtual machine network device.

func (*NetworkDevice) DeepCopy

func (in *NetworkDevice) DeepCopy() *NetworkDevice

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

func (*NetworkDevice) DeepCopyInto

func (in *NetworkDevice) DeepCopyInto(out *NetworkDevice)

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

type NetworkSpec

type NetworkSpec struct {
	// Default is the default network device,
	// which will be used for the primary network interface.
	// net0 is always the default network device.
	// +optional
	Default *NetworkDevice `json:"default,omitempty"`

	// AdditionalDevices defines additional network devices bound to the virtual machine.
	// +optional
	// +listType=map
	// +listMapKey=name
	AdditionalDevices []AdditionalNetworkDevice `json:"additionalDevices,omitempty"`
}

NetworkSpec defines the virtual machine's network configuration.

func (*NetworkSpec) DeepCopy

func (in *NetworkSpec) DeepCopy() *NetworkSpec

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

func (*NetworkSpec) DeepCopyInto

func (in *NetworkSpec) DeepCopyInto(out *NetworkSpec)

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

type NetworkStatus

type NetworkStatus struct {
	// Connected is a flag that indicates whether this network is currently
	// connected to the VM.
	Connected bool `json:"connected,omitempty"`

	// IPAddrs is one or more IP addresses reported by vm-tools.
	// +optional
	IPAddrs []string `json:"ipAddrs,omitempty"`

	// MACAddr is the MAC address of the network device.
	MACAddr string `json:"macAddr"`

	// NetworkName is the name of the network.
	// +optional
	NetworkName string `json:"networkName,omitempty"`
}

NetworkStatus provides information about one of a VM's networks.

func (*NetworkStatus) DeepCopy

func (in *NetworkStatus) DeepCopy() *NetworkStatus

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

func (*NetworkStatus) DeepCopyInto

func (in *NetworkStatus) DeepCopyInto(out *NetworkStatus)

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

type NodeLocation

type NodeLocation struct {
	// Machine is the reference of the proxmoxmachine
	Machine corev1.LocalObjectReference `json:"machine"`

	// Node is the Proxmox node
	Node string `json:"node"`
}

NodeLocation holds information about a single VM in Proxmox.

func (*NodeLocation) DeepCopy

func (in *NodeLocation) DeepCopy() *NodeLocation

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

func (*NodeLocation) DeepCopyInto

func (in *NodeLocation) DeepCopyInto(out *NodeLocation)

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

type NodeLocations

type NodeLocations struct {
	// ControlPlane contains all deployed control plane nodes
	// +optional
	ControlPlane []NodeLocation `json:"controlPlane,omitempty"`

	// Workers contains all deployed worker nodes
	// +optional
	Workers []NodeLocation `json:"workers,omitempty"`
}

NodeLocations holds information about the deployment state of control plane and worker nodes in Proxmox.

func (*NodeLocations) DeepCopy

func (in *NodeLocations) DeepCopy() *NodeLocations

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

func (*NodeLocations) DeepCopyInto

func (in *NodeLocations) DeepCopyInto(out *NodeLocations)

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

type ProxmoxCluster

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

	// +kubebuilder:validation:XValidation:rule="self.ipv4Config != null || self.ipv6Config != null",message="at least one ip config must be set, either ipv4Config or ipv6Config"
	Spec   ProxmoxClusterSpec   `json:"spec,omitempty"`
	Status ProxmoxClusterStatus `json:"status,omitempty"`
}

ProxmoxCluster is the Schema for the proxmoxclusters API.

func (*ProxmoxCluster) AddNodeLocation

func (c *ProxmoxCluster) AddNodeLocation(loc NodeLocation, isControlPlane bool)

AddNodeLocation will add a node location to either the control plane or worker node locations based on the `isControlPlane` parameter.

func (*ProxmoxCluster) DeepCopy

func (in *ProxmoxCluster) DeepCopy() *ProxmoxCluster

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

func (*ProxmoxCluster) DeepCopyInto

func (in *ProxmoxCluster) DeepCopyInto(out *ProxmoxCluster)

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

func (*ProxmoxCluster) DeepCopyObject

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

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

func (*ProxmoxCluster) GetConditions

func (c *ProxmoxCluster) GetConditions() clusterv1.Conditions

GetConditions returns the observations of the operational state of the ProxmoxCluster resource.

func (*ProxmoxCluster) GetNode

func (c *ProxmoxCluster) GetNode(machineName string, isControlPlane bool) string

GetNode tries to return the Proxmox node for the provided machine name.

func (*ProxmoxCluster) HasMachine

func (c *ProxmoxCluster) HasMachine(machineName string, isControlPlane bool) bool

HasMachine returns if true if a machine was found on any node.

func (*ProxmoxCluster) RemoveNodeLocation

func (c *ProxmoxCluster) RemoveNodeLocation(machineName string, isControlPlane bool)

RemoveNodeLocation removes a node location from the status.

func (*ProxmoxCluster) SetConditions

func (c *ProxmoxCluster) SetConditions(conditions clusterv1.Conditions)

SetConditions sets the underlying service state of the ProxmoxCluster to the predescribed clusterv1.Conditions.

func (*ProxmoxCluster) SetInClusterIPPoolRef

func (c *ProxmoxCluster) SetInClusterIPPoolRef(pool *ipamicv1.InClusterIPPool)

SetInClusterIPPoolRef will set the reference to the provided InClusterIPPool. If nil was provided, the status field will be cleared.

func (*ProxmoxCluster) UpdateNodeLocation

func (c *ProxmoxCluster) UpdateNodeLocation(machineName, node string, isControlPlane bool) bool

UpdateNodeLocation will update the node location based on the provided machine name. If the node location does not exist, it will be added.

The function returns true if the value was added or updated, otherwise false.

type ProxmoxClusterList

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

ProxmoxClusterList contains a list of ProxmoxCluster.

func (*ProxmoxClusterList) DeepCopy

func (in *ProxmoxClusterList) DeepCopy() *ProxmoxClusterList

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

func (*ProxmoxClusterList) DeepCopyInto

func (in *ProxmoxClusterList) DeepCopyInto(out *ProxmoxClusterList)

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

func (*ProxmoxClusterList) DeepCopyObject

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

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

type ProxmoxClusterSpec

type ProxmoxClusterSpec struct {
	// ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
	// +optional
	ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"`

	// AllowedNodes specifies all Proxmox nodes which will be considered
	// for operations. This implies that VMs can be cloned on different nodes from
	// the node which holds the VM template.
	// +optional
	AllowedNodes []string `json:"allowedNodes,omitempty"`

	// IPv4Config contains information about available IPV4 address pools and the gateway.
	// this can be combined with ipv6Config in order to enable dual stack.
	// either IPv4Config or IPv6Config must be provided.
	// +optional
	// +kubebuilder:validation:XValidation:rule="self.addresses.size() > 0",message="IPv4Config addresses must be provided"
	IPv4Config *ipamicv1.InClusterIPPoolSpec `json:"ipv4Config,omitempty"`

	// IPv6Config contains information about available IPV6 address pools and the gateway.
	// this can be combined with ipv4Config in order to enable dual stack.
	// either IPv4Config or IPv6Config must be provided.
	// +optional
	// +kubebuilder:validation:XValidation:rule="self.addresses.size() > 0",message="IPv6Config addresses must be provided"
	IPv6Config *ipamicv1.InClusterIPPoolSpec `json:"ipv6Config,omitempty"`

	// DNSServers contains information about nameservers used by machines network-config.
	// +kubebuilder:validation:MinItems=1
	DNSServers []string `json:"dnsServers"`
}

ProxmoxClusterSpec defines the desired state of ProxmoxCluster.

func (*ProxmoxClusterSpec) DeepCopy

func (in *ProxmoxClusterSpec) DeepCopy() *ProxmoxClusterSpec

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

func (*ProxmoxClusterSpec) DeepCopyInto

func (in *ProxmoxClusterSpec) DeepCopyInto(out *ProxmoxClusterSpec)

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

type ProxmoxClusterStatus

type ProxmoxClusterStatus struct {
	// Ready indicates that the cluster is ready.
	// +optional
	// +kubebuilder:default=false
	Ready bool `json:"ready"`

	// InClusterIPPoolRef is the reference to the created in cluster ip pool
	// +optional
	InClusterIPPoolRef []corev1.LocalObjectReference `json:"inClusterIpPoolRef,omitempty"`

	// NodeLocations keeps track of which nodes have been selected
	// for different machines.
	// +optional
	NodeLocations *NodeLocations `json:"nodeLocations,omitempty"`

	// Conditions defines current service state of the ProxmoxCluster.
	// +optional
	Conditions clusterv1.Conditions `json:"conditions,omitempty"`
}

ProxmoxClusterStatus defines the observed state of ProxmoxCluster.

func (*ProxmoxClusterStatus) DeepCopy

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

func (*ProxmoxClusterStatus) DeepCopyInto

func (in *ProxmoxClusterStatus) DeepCopyInto(out *ProxmoxClusterStatus)

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

type ProxmoxMachine

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

	// +kubebuilder:validation:XValidation:rule="self.full && self.format != ”",message="Must set full=true when specifying format"
	Spec   ProxmoxMachineSpec   `json:"spec,omitempty"`
	Status ProxmoxMachineStatus `json:"status,omitempty"`
}

ProxmoxMachine is the Schema for the proxmoxmachines API.

func (*ProxmoxMachine) DeepCopy

func (in *ProxmoxMachine) DeepCopy() *ProxmoxMachine

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

func (*ProxmoxMachine) DeepCopyInto

func (in *ProxmoxMachine) DeepCopyInto(out *ProxmoxMachine)

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

func (*ProxmoxMachine) DeepCopyObject

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

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

func (*ProxmoxMachine) GetConditions

func (r *ProxmoxMachine) GetConditions() clusterv1.Conditions

GetConditions returns the observations of the operational state of the ProxmoxMachine resource.

func (*ProxmoxMachine) GetNode

func (r *ProxmoxMachine) GetNode() string

GetNode get the Proxmox node used to provision this machine.

func (*ProxmoxMachine) GetTemplateID

func (r *ProxmoxMachine) GetTemplateID() int32

GetTemplateID get the Proxmox template "vmid" used to provision this machine.

func (*ProxmoxMachine) GetVirtualMachineID

func (r *ProxmoxMachine) GetVirtualMachineID() int64

GetVirtualMachineID get the Proxmox "vmid".

func (*ProxmoxMachine) SetConditions

func (r *ProxmoxMachine) SetConditions(conditions clusterv1.Conditions)

SetConditions sets the underlying service state of the ProxmoxMachine to the predescribed clusterv1.Conditions.

type ProxmoxMachineList

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

ProxmoxMachineList contains a list of ProxmoxMachine.

func (*ProxmoxMachineList) DeepCopy

func (in *ProxmoxMachineList) DeepCopy() *ProxmoxMachineList

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

func (*ProxmoxMachineList) DeepCopyInto

func (in *ProxmoxMachineList) DeepCopyInto(out *ProxmoxMachineList)

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

func (*ProxmoxMachineList) DeepCopyObject

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

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

type ProxmoxMachineSpec

type ProxmoxMachineSpec struct {
	VirtualMachineCloneSpec `json:",inline"`

	// ProviderID is the virtual machine BIOS UUID formatted as
	// proxmox://6c3fa683-bef9-4425-b413-eaa45a9d6191
	// +optional
	ProviderID *string `json:"providerID,omitempty"`

	// VirtualMachineID is the Proxmox identifier for the ProxmoxMachine vm.
	// +optional
	VirtualMachineID *int64 `json:"virtualMachineID,omitempty"`

	// NumSockets is the number of CPU sockets in a virtual machine.
	// Defaults to the property value in the template from which the virtual machine is cloned.
	// +kubebuilder:validation:Minimum=1
	// +optional
	NumSockets int32 `json:"numSockets,omitempty"`

	// NumCores is the number of cores per CPU socket in a virtual machine.
	// Defaults to the property value in the template from which the virtual machine is cloned.
	// +kubebuilder:validation:Minimum=1
	// +optional
	NumCores int32 `json:"numCores,omitempty"`

	// MemoryMiB is the size of a virtual machine's memory, in MiB.
	// Defaults to the property value in the template from which the virtual machine is cloned.
	// +kubebuilder:validation:MultipleOf=8
	// +optional
	MemoryMiB int32 `json:"memoryMiB,omitempty"`

	// Disks contains a set of disk configuration options,
	// which will be applied before the first startup.
	//
	// +optional
	Disks *Storage `json:"disks,omitempty"`

	// Network is the network configuration for this machine's VM.
	// +optional
	Network *NetworkSpec `json:"network,omitempty"`
}

ProxmoxMachineSpec defines the desired state of ProxmoxMachine.

func (*ProxmoxMachineSpec) DeepCopy

func (in *ProxmoxMachineSpec) DeepCopy() *ProxmoxMachineSpec

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

func (*ProxmoxMachineSpec) DeepCopyInto

func (in *ProxmoxMachineSpec) DeepCopyInto(out *ProxmoxMachineSpec)

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

type ProxmoxMachineStatus

type ProxmoxMachineStatus struct {
	// Ready indicates the Docker infrastructure has been provisioned and is ready
	// +optional
	Ready bool `json:"ready"`

	// Addresses contains the Proxmox VM instance associated addresses.
	// +optional
	Addresses []clusterv1.MachineAddress `json:"addresses,omitempty"`

	// VMStatus is used to identify the virtual machine status.
	// +optional
	VMStatus VirtualMachineState `json:"vmStatus,omitempty"`

	// BootstrapDataProvided whether the virtual machine has an injected bootstrap data.
	// +optional
	BootstrapDataProvided *bool `json:"bootstrapDataProvided,omitempty"`

	// IPAddresses are the IP addresses used to access the virtual machine.
	// +optional
	IPAddresses map[string]IPAddress `json:"ipAddresses,omitempty"`

	// Network returns the network status for each of the machine's configured
	// network interfaces.
	// +optional
	Network []NetworkStatus `json:"network,omitempty"`

	// ProxmoxNode is the name of the proxmox node, which was chosen for this
	// machine to be deployed on
	// +optional
	ProxmoxNode *string `json:"proxmoxNode,omitempty"`

	// TaskRef is a managed object reference to a Task related to the ProxmoxMachine.
	// This value is set automatically at runtime and should not be set or
	// modified by users.
	// +optional
	TaskRef *string `json:"taskRef,omitempty"`

	// RetryAfter tracks the time we can retry queueing a task
	// +optional
	RetryAfter metav1.Time `json:"retryAfter,omitempty"`

	// FailureReason will be set in the event that there is a terminal problem
	// reconciling the Machine and will contain a succinct value suitable
	// for machine interpretation.
	//
	// This field should not be set for transitive errors that a controller
	// faces that are expected to be fixed automatically over
	// time (like service outages), but instead indicate that something is
	// fundamentally wrong with the Machine's spec or the configuration of
	// the controller, and that manual intervention is required. Examples
	// of terminal errors would be invalid combinations of settings in the
	// spec, values that are unsupported by the controller, or the
	// responsible controller itself being critically misconfigured.
	//
	// Any transient errors that occur during the reconciliation of ProxmoxMachines
	// can be added as events to the ProxmoxMachine object and/or logged in the
	// controller's output.
	// +optional
	FailureReason *errors.MachineStatusError `json:"failureReason,omitempty"`

	// FailureMessage will be set in the event that there is a terminal problem
	// reconciling the Machine and will contain a more verbose string suitable
	// for logging and human consumption.
	//
	// This field should not be set for transitive errors that a controller
	// faces that are expected to be fixed automatically over
	// time (like service outages), but instead indicate that something is
	// fundamentally wrong with the Machine's spec or the configuration of
	// the controller, and that manual intervention is required. Examples
	// of terminal errors would be invalid combinations of settings in the
	// spec, values that are unsupported by the controller, or the
	// responsible controller itself being critically misconfigured.
	//
	// Any transient errors that occur during the reconciliation of ProxmoxMachines
	// can be added as events to the ProxmoxMachine object and/or logged in the
	// controller's output.
	// +optional
	FailureMessage *string `json:"failureMessage,omitempty"`

	// Conditions defines current service state of the ProxmoxMachine.
	// +optional
	Conditions clusterv1.Conditions `json:"conditions,omitempty"`
}

ProxmoxMachineStatus defines the observed state of ProxmoxMachine.

func (*ProxmoxMachineStatus) DeepCopy

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

func (*ProxmoxMachineStatus) DeepCopyInto

func (in *ProxmoxMachineStatus) DeepCopyInto(out *ProxmoxMachineStatus)

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

type ProxmoxMachineTemplate

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

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

ProxmoxMachineTemplate is the Schema for the proxmoxmachinetemplates API.

func (*ProxmoxMachineTemplate) DeepCopy

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

func (*ProxmoxMachineTemplate) DeepCopyInto

func (in *ProxmoxMachineTemplate) DeepCopyInto(out *ProxmoxMachineTemplate)

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

func (*ProxmoxMachineTemplate) DeepCopyObject

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

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

type ProxmoxMachineTemplateList

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

ProxmoxMachineTemplateList contains a list of ProxmoxMachineTemplate.

func (*ProxmoxMachineTemplateList) DeepCopy

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

func (*ProxmoxMachineTemplateList) DeepCopyInto

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

func (*ProxmoxMachineTemplateList) DeepCopyObject

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

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

type ProxmoxMachineTemplateResource

type ProxmoxMachineTemplateResource struct {
	// Standard object's metadata.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
	// +optional
	ObjectMeta clusterv1.ObjectMeta `json:"metadata,omitempty"`
	Spec       ProxmoxMachineSpec   `json:"spec"`
}

ProxmoxMachineTemplateResource defines the spec and metadata for ProxmoxMachineTemplate supported by capi.

func (*ProxmoxMachineTemplateResource) DeepCopy

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

func (*ProxmoxMachineTemplateResource) DeepCopyInto

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

type ProxmoxMachineTemplateSpec

type ProxmoxMachineTemplateSpec struct {
	Template ProxmoxMachineTemplateResource `json:"template"`
}

ProxmoxMachineTemplateSpec defines the desired state of ProxmoxMachineTemplate.

func (*ProxmoxMachineTemplateSpec) DeepCopy

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

func (*ProxmoxMachineTemplateSpec) DeepCopyInto

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

type Storage

type Storage struct {
	// BootVolume defines the storage size for the boot volume.
	// This field is optional, and should only be set if you want
	// to change the size of the boot volume.
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="Value is immutable"
	// +optional
	BootVolume *DiskSize `json:"bootVolume,omitempty"`
}

Storage is the physical storage on the node.

func (*Storage) DeepCopy

func (in *Storage) DeepCopy() *Storage

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

func (*Storage) DeepCopyInto

func (in *Storage) DeepCopyInto(out *Storage)

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

type TargetFileStorageFormat

type TargetFileStorageFormat string

TargetFileStorageFormat the target format of the cloned disk.

const (
	TargetStorageFormatRaw   TargetFileStorageFormat = "raw"
	TargetStorageFormatQcow2 TargetFileStorageFormat = "qcow2"
	TargetStorageFormatVmdk  TargetFileStorageFormat = "vmdk"
)

Supported disk formats.

type VirtualMachine

type VirtualMachine struct {
	// Node is the VM node.
	Node string `json:"node"`

	// Name is the VM's name.
	Name string `json:"name"`

	// VMID is the VM's ID.
	VMID uint64 `json:"vmID"`

	// State is the VM's state.
	State VirtualMachineState `json:"state"`

	// Network is the status of the VM's network devices.
	Network []NetworkStatus `json:"network"`
}

VirtualMachine represents data about a Proxmox virtual machine object.

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.

type VirtualMachineCloneSpec

type VirtualMachineCloneSpec struct {
	// SourceNode is the initially selected proxmox node.
	// This node will be used to locate the template VM, which will
	// be used for cloning operations.
	//
	// Cloning will be performed according to the configuration.
	// Setting the `Target` field will tell Proxmox to clone the
	// VM on that target node.
	//
	// When Target is not set and the ProxmoxCluster contains
	// a set of `AllowedNodes`, the algorithm will instead evenly
	// distribute the VMs across the nodes from that list.
	//
	// If neither a `Target` nor `AllowedNodes` was set, the VM
	// will be cloned onto the same node as SourceNode.
	//
	// +kubebuilder:validation:MinLength=1
	SourceNode string `json:"sourceNode"`

	// TemplateID the vm_template vmid used for cloning a new VM.
	// +optional
	TemplateID *int32 `json:"templateID,omitempty"`

	// Description for the new VM.
	// +optional
	Description *string `json:"description,omitempty"`

	// Format for file storage. Only valid for full clone.
	// +kubebuilder:validation:Enum=raw;qcow2;vmdk
	// +kubebuilder:default=raw
	// +optional
	Format *TargetFileStorageFormat `json:"format,omitempty"`

	// Full Create a full copy of all disks.
	// This is always done when you clone a normal VM.
	// Create a Full clone by default.
	// +kubebuilder:default=true
	// +optional
	Full *bool `json:"full,omitempty"`

	// Pool Add the new VM to the specified pool.
	// +optional
	Pool *string `json:"pool,omitempty"`

	// SnapName The name of the snapshot.
	// +optional
	SnapName *string `json:"snapName,omitempty"`

	// Storage for full clone.
	// +optional
	Storage *string `json:"storage,omitempty"`

	// Target node. Only allowed if the original VM is on shared storage.
	// +optional
	Target *string `json:"target,omitempty"`
}

VirtualMachineCloneSpec is information used to clone a virtual machine.

func (*VirtualMachineCloneSpec) DeepCopy

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

func (*VirtualMachineCloneSpec) DeepCopyInto

func (in *VirtualMachineCloneSpec) DeepCopyInto(out *VirtualMachineCloneSpec)

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

type VirtualMachineState

type VirtualMachineState string

VirtualMachineState describes the state of a VM.

const (
	// VirtualMachineStateNotFound is the string representing a VM that
	// cannot be located.
	VirtualMachineStateNotFound VirtualMachineState = "notfound"

	// VirtualMachineStatePending is the string representing a VM with an in-flight task.
	VirtualMachineStatePending VirtualMachineState = "pending"

	// VirtualMachineStateReady is the string representing a powered-on VM with reported IP addresses.
	VirtualMachineStateReady VirtualMachineState = "ready"
)

Jump to

Keyboard shortcuts

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