v1beta1

package
v0.1.1-0...-abb91c8 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

+k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/rgolangh/cluster-api/cluster-api-provider-ovirt/pkg/apis/ovirtprovider +k8s:openapi-gen=true +k8s:defaulter-gen=TypeMeta +groupName=ovirtproviderconfig.machine.openshift.io

Copyright 2018 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package v1beta1 contains API Schema definitions for the ovirtprovider v1beta1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider +k8s:defaulter-gen=TypeMeta +groupName=ovirtproviderconfig.machine.openshift.io

Index

Constants

View Source
const GroupName = "ovirtproviderconfig"

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: fmt.Sprintf("%s.machine.openshift.io", GroupName), Version: "v1beta1"}

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

Functions

func RawExtensionFromProviderSpec

func RawExtensionFromProviderSpec(spec *OvirtMachineProviderSpec) (*runtime.RawExtension, error)

RawExtensionFromProviderSpec marshals the machine provider spec.

func RawExtensionFromProviderStatus

func RawExtensionFromProviderStatus(status *OvirtMachineProviderStatus) (*runtime.RawExtension, error)

RawExtensionFromProviderStatus marshals the provider status

Types

type CPU

type CPU struct {
	// Sockets is the number of sockets for a VM.
	// Total CPUs is (Sockets * Cores * Threads)
	Sockets int32 `json:"sockets"`

	// Cores is the number of cores per socket.
	// Total CPUs is (Sockets * Cores * Threads)
	Cores int32 `json:"cores"`

	// Thread is the number of thread per core.
	// Total CPUs is (Sockets * Cores * Threads)
	Threads int32 `json:"threads"`
}

CPU defines the VM cpu, made of (Sockets * Cores * Threads)

func (*CPU) DeepCopy

func (in *CPU) DeepCopy() *CPU

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

func (*CPU) DeepCopyInto

func (in *CPU) DeepCopyInto(out *CPU)

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

type Disk

type Disk struct {
	// SizeGB size of the bootable disk in GiB.
	SizeGB int64 `json:"size_gb"`
}

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 NetworkInterface

type NetworkInterface struct {
	// VNICProfileID the id of the vNic profile
	VNICProfileID string `json:"vnic_profile_id"`
}

NetworkInterface defines a VM network interface

func (*NetworkInterface) DeepCopy

func (in *NetworkInterface) DeepCopy() *NetworkInterface

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

func (*NetworkInterface) DeepCopyInto

func (in *NetworkInterface) DeepCopyInto(out *NetworkInterface)

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

type OvirtClusterProviderSpec

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

OvirtClusterProviderSpec of an oVirt cluster +k8s:openapi-gen=true

func (*OvirtClusterProviderSpec) DeepCopy

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

func (*OvirtClusterProviderSpec) DeepCopyInto

func (in *OvirtClusterProviderSpec) DeepCopyInto(out *OvirtClusterProviderSpec)

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

func (*OvirtClusterProviderSpec) DeepCopyObject

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

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

type OvirtClusterProviderStatus

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

	// CACertificate is a PEM encoded CA Certificate for the control plane nodes.
	CACertificate []byte `json:"cacertificate"`

	// CAPrivateKey is a PEM encoded PKCS1 CA PrivateKey for the control plane nodes.
	CAPrivateKey []byte `json:"caprivatekey"`
}

OvirtClusterProviderStatus +k8s:openapi-gen=true

func (*OvirtClusterProviderStatus) DeepCopy

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

func (*OvirtClusterProviderStatus) DeepCopyInto

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

func (*OvirtClusterProviderStatus) DeepCopyObject

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

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

type OvirtMachineProviderSpec

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

	// UserDataSecret contains a local reference to a secret that contains the
	// UserData to apply to the instance
	UserDataSecret *corev1.LocalObjectReference `json:"userDataSecret,omitempty"`

	// CredentialsSecret is a reference to the secret with oVirt credentials.
	CredentialsSecret *corev1.LocalObjectReference `json:"credentialsSecret,omitempty"`

	// Id is the UUID of the VM
	Id string `json:"id"`

	// Name is the VM name
	Name string `json:"name"`

	// The VM template this instance will be created from.
	TemplateName string `json:"template_name"`

	// the oVirt cluster this VM instance belongs too.
	ClusterId string `json:"cluster_id"`

	// InstanceTypeId defines the VM instance type and overrides
	// the hardware parameters of the created VM, including cpu and memory.
	// If InstanceTypeId is passed, all memory and cpu variables will be ignored.
	InstanceTypeId string `json:"instance_type_id,omitempty"`

	// CPU defines the VM CPU.
	CPU *CPU `json:"cpu,omitempty"`

	// MemoryMB is the size of a VM's memory in MiBs.
	MemoryMB int32 `json:"memory_mb,omitempty"`

	// OSDisk is the the root disk of the node.
	OSDisk *Disk `json:"os_disk,omitempty"`

	// VMType defines the workload type the instance will
	// be used for and this effects the instance parameters.
	// One of "desktop, server, high_performance"
	VMType string `json:"type,omitempty"`

	// NetworkInterfaces defines the list of the network interfaces of the VM.
	// All network interfaces from the template are discarded and new ones will
	// be created, unless the list is empty or nil
	NetworkInterfaces []*NetworkInterface `json:"network_interfaces,omitempty"`

	// VMAffinityGroup contains the name of the OpenShift cluster affinity groups
	// It will be used to add the newly created machine to the affinity groups
	AffinityGroupsNames []string `json:"affinity_groups_names,omitempty"`

	// AutoPinningPolicy defines the policy to automatically set the CPU
	// and NUMA including pinning to the host for the instance.
	// One of "none, resize_and_pin"
	AutoPinningPolicy string `json:"auto_pinning_policy,omitempty"`

	// Hugepages is the size of a VM's hugepages to use in KiBs.
	// Only 2048 and 1048576 supported.
	Hugepages int32 `json:"hugepages,omitempty"`

	// GuaranteedMemoryMB is the size of a VM's guaranteed memory in MiBs.
	GuaranteedMemoryMB int32 `json:"guaranteed_memory_mb,omitempty"`

	// Clone makes sure that the disks are cloned from the template and are not linked.
	// Defaults to true for high performance and server VM types, false for desktop types.
	//
	// Note: this option is not documented in the OpenShift documentation. This is intentional as it has sane defaults
	// that shouldn't be changed unless needed for debugging or resolving issues in cooperation with Red Hat support.
	//
	// +optional
	Clone *bool `json:"clone,omitempty"`

	// Sparse indicates that sparse provisioning should not be used and disks should be preallocated.
	// Defaults to true.
	// +optional
	Sparse *bool `json:"sparse,omitempty"`

	// Format is the disk format that the disks are in. Can be "cow" or "raw". "raw" disables several features that
	// may be needed, such as incremental backups. Defaults to "cow".
	// +kubebuilder:validation:Enum="";raw;cow
	// +optional
	Format string `json:"format,omitempty"`

	// StorageDomainId defines the VM disk Storage Domain ID type and overrides the template Disk storage Domain ID.
	// if StorageDomainId is different then template Storage ID the disk will be copied between Domains.
	//
	// Note: this option supported only work when Clone is set to true (default)
	//
	// +optional
	StorageDomainId string `json:"storage_domain_id,omitempty"`
}

OvirtMachineProviderSpec is the type that will be embedded in a Machine.Spec.ProviderSpec field for an Ovirt VM. It is used by the Ovirt machine actuator to create a single machine instance.

func MachineSpecFromProviderSpec

func MachineSpecFromProviderSpec(providerSpec machinev1.ProviderSpec) (*OvirtMachineProviderSpec, error)

MachineSpecFromProviderSpec

func ProviderSpecFromRawExtension

func ProviderSpecFromRawExtension(rawExtension *runtime.RawExtension) (*OvirtMachineProviderSpec, error)

ProviderSpecFromRawExtension unmarshals the JSON-encoded spec

func (*OvirtMachineProviderSpec) DeepCopy

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

func (*OvirtMachineProviderSpec) DeepCopyInto

func (in *OvirtMachineProviderSpec) DeepCopyInto(out *OvirtMachineProviderSpec)

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

func (*OvirtMachineProviderSpec) DeepCopyObject

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

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

type OvirtMachineProviderStatus

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

	// InstanceID is the ID of the instance in oVirt
	// +optional
	InstanceID *string `json:"instanceId,omitempty"`

	// InstanceState is the provisioning state of the oVirt Instance.
	// +optional
	InstanceState *string `json:"instanceState,omitempty"`
}

OvirtMachineProviderStatus

func ProviderStatusFromRawExtension

func ProviderStatusFromRawExtension(rawExtension *runtime.RawExtension) (*OvirtMachineProviderStatus, error)

ProviderStatusFromRawExtension unmarshals a raw extension into a OvirtMachineProviderStatus type

func (*OvirtMachineProviderStatus) DeepCopy

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

func (*OvirtMachineProviderStatus) DeepCopyInto

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

func (*OvirtMachineProviderStatus) DeepCopyObject

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

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

Jump to

Keyboard shortcuts

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