v1alpha1

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 7 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 (
	ClusterFinalizer = "harvester.infrastructure.cluster.x-k8s.io"
	DHCP             = "dhcp"
	POOL             = "pool"
)
View Source
const (
	// LoadBalancerReadyCondition documents the status of the load balancer in Harvester.
	LoadBalancerReadyCondition clusterv1.ConditionType = "LoadBalancerReady"
	// LoadBalancerNotReadyReason documents the reason why the load balancer is not ready.
	LoadBalancerNotReadyReason = "LoadBalancerNotReady"
	// LoadBalancerReadyMessage documents the message why the load balancer is not ready.
	LoadBalancerNoBackendMachineReason = "There are no machines matching the load balancer configuration"
	// LoadBalancerHealthcheckFailedReason documents the reason why the load balancer is not ready.
	LoadBalancerHealthcheckFailedReason = "The healthcheck for the load balancer failed"
)
View Source
const (
	// InitMachineCreatedCondition documents the status of the init machine in Harvester.
	InitMachineCreatedCondition clusterv1.ConditionType = "InitMachineCreated"
	// InitMachineNotCreatedReason documents the reason why the init machine is not ready.
	InitMachineNotYetCreatedReason = "InitMachineNotYetCreated"
)
View Source
const (
	// MachineFinalizer allows ReconcileHarvesterMachine to clean up resources associated with HarvesterMachine before.
	// removing it from the apiserver.
	MachineFinalizer = "harvestermachine.infrastructure.cluster.x-k8s.io"
)

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 HarvesterCluster

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

	Spec   HarvesterClusterSpec   `json:"spec"`
	Status HarvesterClusterStatus `json:"status,omitempty"`
}

HarvesterCluster is the Schema for the harvesterclusters API.

func (*HarvesterCluster) DeepCopy

func (in *HarvesterCluster) DeepCopy() *HarvesterCluster

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

func (*HarvesterCluster) DeepCopyInto

func (in *HarvesterCluster) DeepCopyInto(out *HarvesterCluster)

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

func (*HarvesterCluster) DeepCopyObject

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

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

func (*HarvesterCluster) GetConditions

func (m *HarvesterCluster) GetConditions() clusterv1.Conditions

GetConditions returns the set of conditions for this object.

func (*HarvesterCluster) SetConditions

func (m *HarvesterCluster) SetConditions(conditions clusterv1.Conditions)

SetConditions sets the conditions on this object.

type HarvesterClusterList

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

HarvesterClusterList contains a list of HarvesterCluster.

func (*HarvesterClusterList) DeepCopy

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

func (*HarvesterClusterList) DeepCopyInto

func (in *HarvesterClusterList) DeepCopyInto(out *HarvesterClusterList)

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

func (*HarvesterClusterList) DeepCopyObject

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

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

type HarvesterClusterSpec

type HarvesterClusterSpec struct {
	// Server is the url to connect to Harvester.
	// +optional
	Server string `json:"server,omitempty"`

	// IdentitySecret is the name of the Secret containing HarvesterKubeConfig file.
	IdentitySecret SecretKey `json:"identitySecret"`

	// LoadBalancerConfig describes how the load balancer should be created in Harvester.
	LoadBalancerConfig LoadBalancerConfig `json:"loadBalancerConfig"`

	// ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
	// +optional
	ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint,omitempty"`

	// TargetNamespace is the namespace on the Harvester cluster where VMs, Load Balancers, etc. should be created.
	TargetNamespace string `json:"targetNamespace"`
}

HarvesterClusterSpec defines the desired state of HarvesterCluster.

func (*HarvesterClusterSpec) DeepCopy

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

func (*HarvesterClusterSpec) DeepCopyInto

func (in *HarvesterClusterSpec) DeepCopyInto(out *HarvesterClusterSpec)

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

type HarvesterClusterStatus

type HarvesterClusterStatus struct {
	// Reddy describes if the Harvester Cluster can be considered ready for machine creation.
	Ready bool `json:"ready"`

	// FailureReason is the short name for the reason why a failure might be happening that makes the cluster not ready.
	// +optional
	FailureReason string `json:"failureReason,omitempty"`
	// FailureMessage is a full error message dump of the above failureReason.
	// +optional
	FailureMessage string `json:"failureMessage,omitempty"`

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

HarvesterClusterStatus defines the observed state of HarvesterCluster.

func (*HarvesterClusterStatus) DeepCopy

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

func (*HarvesterClusterStatus) DeepCopyInto

func (in *HarvesterClusterStatus) DeepCopyInto(out *HarvesterClusterStatus)

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

type HarvesterClusterTemplate

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

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

HarvesterClusterTemplate is the Schema for the infraclustertemplates API.

func (*HarvesterClusterTemplate) DeepCopy

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

func (*HarvesterClusterTemplate) DeepCopyInto

func (in *HarvesterClusterTemplate) DeepCopyInto(out *HarvesterClusterTemplate)

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

func (*HarvesterClusterTemplate) DeepCopyObject

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

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

type HarvesterClusterTemplateList

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

HarvesterClusterTemplateList contains a list of HarvesterClusterTemplates.

func (*HarvesterClusterTemplateList) DeepCopy

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

func (*HarvesterClusterTemplateList) DeepCopyInto

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

type HarvesterClusterTemplateResource

type HarvesterClusterTemplateResource 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       HarvesterClusterSpec `json:"spec"`
}

func (*HarvesterClusterTemplateResource) DeepCopy

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

func (*HarvesterClusterTemplateResource) DeepCopyInto

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

type HarvesterClusterTemplateSpec

type HarvesterClusterTemplateSpec struct {
	Template HarvesterClusterTemplateResource `json:"template"`
}

HarvesterClusterTemplateSpec defines the desired state of HarvesterClusterTemplate.

func (*HarvesterClusterTemplateSpec) DeepCopy

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

func (*HarvesterClusterTemplateSpec) DeepCopyInto

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

type HarvesterMachine

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

	Spec   HarvesterMachineSpec   `json:"spec,omitempty"`
	Status HarvesterMachineStatus `json:"status,omitempty"`
}

HarvesterMachine is the Schema for the harvestermachines API.

func (*HarvesterMachine) DeepCopy

func (in *HarvesterMachine) DeepCopy() *HarvesterMachine

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

func (*HarvesterMachine) DeepCopyInto

func (in *HarvesterMachine) DeepCopyInto(out *HarvesterMachine)

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

func (*HarvesterMachine) DeepCopyObject

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

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

type HarvesterMachineList

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

HarvesterMachineList contains a list of HarvesterMachine.

func (*HarvesterMachineList) DeepCopy

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

func (*HarvesterMachineList) DeepCopyInto

func (in *HarvesterMachineList) DeepCopyInto(out *HarvesterMachineList)

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

func (*HarvesterMachineList) DeepCopyObject

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

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

type HarvesterMachineSpec

type HarvesterMachineSpec struct {
	// ProviderID will be the ID of the VM in the provider (Harvester).
	// This is set by the Cloud provider on the Workload cluster node and replicated by CAPI.
	// +optional
	ProviderID string `json:"providerID,omitempty"`

	// FailureDomain defines the zone or failure domain where this VM should be.
	// +optional
	FailureDomain string `json:"failureDomain,omitempty"`

	// CPU is the number of CPU to assign to the VM.
	CPU int `json:"cpu"`

	// Memory is the memory size to assign to the VM (should be similar to pod.spec.containers.resources.limits).
	Memory string `json:"memory"`

	// SSHUser is the user that should be used to connect to the VMs using SSH.
	SSHUser string `json:"sshUser"`

	// SSHKeyPair is the name of the SSH key pair to use for SSH access to the VM (this keyPair should be created in Harvester).
	// The reference can be in the format "namespace/name" or just "name" if the object is in the same namespace as the HarvesterMachine.
	SSHKeyPair string `json:"sshKeyPair"`

	// Volumes is a list of Volumes to attach to the VM
	Volumes []Volume `json:"volumes"`

	// Networks is a list of Networks to attach to the VM.
	// Each item in the list can have the format "namespace/name" or just "name" if the object is in the same namespace as the HarvesterMachine.
	Networks []string `json:"networks"`

	// NodeAffinity gives the possibility to select preferred nodes for VM scheduling on Harvester. This works exactly like Pods.
	// +optional
	NodeAffinity *corev1.NodeAffinity `json:"nodeAffinity,omitempty"`

	// WorkloadAffinity gives the possibility to define affinity rules with other workloads running on Harvester.
	// +optional
	WorkloadAffinity *corev1.PodAffinity `json:"workloadAffinity,omitempty"`
}

HarvesterMachineSpec defines the desired state of HarvesterMachine.

func (*HarvesterMachineSpec) DeepCopy

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

func (*HarvesterMachineSpec) DeepCopyInto

func (in *HarvesterMachineSpec) DeepCopyInto(out *HarvesterMachineSpec)

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

type HarvesterMachineStatus

type HarvesterMachineStatus struct {
	// Ready is true when the provider resource is ready.
	Ready bool `json:"ready"`

	Conditions []capiv1beta1.Condition `json:"conditions,omitempty"`

	FailureReason  string                       `json:"failureReason,omitempty"`
	FailureMessage string                       `json:"failureMessage,omitempty"`
	Addresses      []capiv1beta1.MachineAddress `json:"addresses,omitempty"`
}

HarvesterMachineStatus defines the observed state of HarvesterMachine.

func (*HarvesterMachineStatus) DeepCopy

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

func (*HarvesterMachineStatus) DeepCopyInto

func (in *HarvesterMachineStatus) DeepCopyInto(out *HarvesterMachineStatus)

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

type HarvesterMachineTemplate

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

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

HarvesterMachineTemplate is the Schema for the harvestermachinetemplates API.

func (*HarvesterMachineTemplate) DeepCopy

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

func (*HarvesterMachineTemplate) DeepCopyInto

func (in *HarvesterMachineTemplate) DeepCopyInto(out *HarvesterMachineTemplate)

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

func (*HarvesterMachineTemplate) DeepCopyObject

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

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

type HarvesterMachineTemplateList

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

HarvesterMachineTemplateList contains a list of HarvesterMachineTemplate.

func (*HarvesterMachineTemplateList) DeepCopy

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

func (*HarvesterMachineTemplateList) DeepCopyInto

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

func (*HarvesterMachineTemplateList) DeepCopyObject

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

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

type HarvesterMachineTemplateResource

type HarvesterMachineTemplateResource struct {
	// Spec is the specification of the desired behavior of the machine.
	Spec HarvesterMachineSpec `json:"spec"`
}

HarvesterMachineTemplateResource describes the data needed to create a HarvesterMachine from a template.

func (*HarvesterMachineTemplateResource) DeepCopy

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

func (*HarvesterMachineTemplateResource) DeepCopyInto

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

type HarvesterMachineTemplateSpec

type HarvesterMachineTemplateSpec struct {
	// Template is the HarvesterMachineTemplate template
	Template HarvesterMachineTemplateResource `json:"template,omitempty"`
}

HarvesterMachineTemplateSpec defines the desired state of HarvesterMachineTemplate.

func (*HarvesterMachineTemplateSpec) DeepCopy

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

func (*HarvesterMachineTemplateSpec) DeepCopyInto

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

type IPAMType

type IPAMType string

IPPAMType describes the way the LoadBalancer IP should be created, using DHCP or using an IPPool defined in Harvester. +kubebuilder:validation:Enum:=dhcp;pool

type IpPool

type IpPool struct {
	// VMNetwork is the name of an existing VM Network in Harvester where the IPPool should exist.
	// The reference can have the format "namespace/name" or just "name" if the object is in the same namespace as the HarvesterCluster.
	VMNetwork string `json:"vmNetwork"`

	// Subnet is a string describing the subnet that should be used by the IP Pool, it should have the CIDR Format of an IPv4 Address.
	// e.g. 172.17.1.0/24.
	Subnet string `json:"subnet"`

	// Gateway is the IP Address that should be used by the Gateway on the Subnet. It should be a valid address inside the subnet.
	// e.g. 172.17.1.1.
	Gateway string `json:"gateway"`
}

IpPool is a description of a new IPPool to be created in Harvester.

func (*IpPool) DeepCopy

func (in *IpPool) DeepCopy() *IpPool

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

func (*IpPool) DeepCopyInto

func (in *IpPool) DeepCopyInto(out *IpPool)

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

type Listener

type Listener struct {
	// Name is the name of the listener.
	Name string `json:"name"`

	// Port is the port that the listener should listen on.
	Port int32 `json:"port"`

	// Protocol is the protocol that the listener should use, either TCP or UDP.
	// +kubebuilder:validation:Enum:=TCP;UDP
	Protocol corev1.Protocol `json:"protocol"`

	// TargetPort is the port that the listener should forward traffic to.
	BackendPort int32 `json:"backendPort"`
}

Listener is a description of a new Listener to be created on the Load Balancer.

func (*Listener) DeepCopy

func (in *Listener) DeepCopy() *Listener

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

func (*Listener) DeepCopyInto

func (in *Listener) DeepCopyInto(out *Listener)

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

type LoadBalancerConfig

type LoadBalancerConfig struct {
	// IPAMType is the configuration of IP addressing for the control plane load balancer.
	// This can take two values, either "dhcp" or "ippool".
	IPAMType IPAMType `json:"ipamType"`

	// IpPoolRef is a reference to an existing IpPool object in Harvester's cluster.
	// This field is mutually exclusive with "ipPool". //TODO: To be implemented
	IpPoolRef string `json:"ipPoolRef,omitempty"`

	// IpPool defines a new IpPool that will be added to Harvester.
	// This field is mutually exclusive with "IpPoolRef".
	IpPool IpPool `json:"ipPool,omitempty"`

	// Listeners is a list of listeners that should be created on the load balancer.
	// +optional
	Listeners []Listener `json:"listeners,omitempty"`

	// Description is a description of the load balancer that should be created.
	// +optional
	Description string `json:"description,omitempty"`
}

func (*LoadBalancerConfig) DeepCopy

func (in *LoadBalancerConfig) DeepCopy() *LoadBalancerConfig

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

func (*LoadBalancerConfig) DeepCopyInto

func (in *LoadBalancerConfig) DeepCopyInto(out *LoadBalancerConfig)

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

type SecretKey

type SecretKey struct {
	// Namespace is the namespace in which the required Identity Secret should be found.
	Namespace string `json:"namespace"`

	// Name is the name of the required Identity Secret.
	Name string `json:"name"`
}

func (*SecretKey) DeepCopy

func (in *SecretKey) DeepCopy() *SecretKey

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

func (*SecretKey) DeepCopyInto

func (in *SecretKey) DeepCopyInto(out *SecretKey)

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

type Volume

type Volume struct {
	// VolumeType is the type of volume to attach.
	// Choose between: "storageClass" or "image"
	VolumeType VolumeType `json:"volumeType"`

	// ImageName is the name of the image to use if the volumeType is "image"
	// ImageName can be in the format "namespace/name" or just "name" if the object is in the same namespace as the HarvesterMachine.
	// +optional
	ImageName string `json:"imageName,omitempty"`

	// StorageClass is the name of the storage class to be used if the volumeType is "storageClass"
	StorageClass string `json:"storageClass,omitempty"`

	// VolumeSize is the desired size of the volume. This satisfies to standard Kubernetes *resource.Quantity syntax.
	// Examples: 40.5Gi, 30M, etc. are valid
	// +optional
	VolumeSize *resource.Quantity `json:"volumeSize,omitempty"`

	// BootOrder is an integer that determines the order of priority of volumes for booting the VM.
	// If absent, the sequence with which volumes appear in the manifest will be used.
	// +optional
	BootOrder int `json:"bootOrder,omitempty"`
}

func (*Volume) DeepCopy

func (in *Volume) DeepCopy() *Volume

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

func (*Volume) DeepCopyInto

func (in *Volume) DeepCopyInto(out *Volume)

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

type VolumeType

type VolumeType string

VolumeType is an enum string. It can only take the values: "storageClass" or "image". +kubebuilder:Validation:Enum:=storageClass,image

Jump to

Keyboard shortcuts

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