Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 24 additions & 25 deletions api/v1beta2/hcloudmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ const (

// HCloudMachineSpec defines the desired state of HCloudMachine.
type HCloudMachineSpec struct {
// ProviderID is the unique identifier as specified by the cloud provider.
// providerID is the unique identifier as specified by the cloud provider.
// +optional
ProviderID *string `json:"providerID,omitempty"`

// Type is the HCloud Machine Type for this machine. It defines the desired server type of
// type is the HCloud Machine Type for this machine. It defines the desired server type of
// server in Hetzner's Cloud API. You can use the hcloud CLI to get server names (`hcloud
// server-type list`) or on https://www.hetzner.com/cloud
//
Expand All @@ -49,29 +49,29 @@ type HCloudMachineSpec struct {
// locations.
Type HCloudMachineType `json:"type"`

// ImageName is the reference to the Machine Image from which to create the machine instance.
// imageName is the reference to the Machine Image from which to create the machine instance.
// It can reference an image uploaded to Hetzner API in two ways: either directly as the name of an image or as the label of an image.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:Optional
// +optional
ImageName string `json:"imageName,omitempty"`

// CustomProvisioner provisions the machine with a custom command instead of an HCloud image.
// customProvisioner provisions the machine with a custom command instead of an HCloud image.
// Exactly one of imageName or customProvisioner must be set.
// +optional
CustomProvisioner *HCloudCustomProvisioner `json:"customProvisioner,omitempty"`

// SSHKeys define machine-specific SSH keys and override cluster-wide SSH keys.
// sshKeys define machine-specific SSH keys and override cluster-wide SSH keys.
// +optional
// +listType=map
// +listMapKey=name
SSHKeys []SSHKey `json:"sshKeys,omitempty"`

// PlacementGroupName defines the placement group of the machine in HCloud API that must reference an existing placement group.
// placementGroupName defines the placement group of the machine in HCloud API that must reference an existing placement group.
// +optional
PlacementGroupName *string `json:"placementGroupName,omitempty"`

// PublicNetwork specifies information for public networks. It defines the specs about
// publicNetwork specifies information for public networks. It defines the specs about
// the primary IP address of the server. If both IPv4 and IPv6 are disabled, then the private network has to be enabled.
// +optional
PublicNetwork *PublicNetworkSpec `json:"publicNetwork,omitempty"`
Expand All @@ -80,11 +80,11 @@ type HCloudMachineSpec struct {
// HCloudCustomProvisioner defines the configuration for provisioning an HCloud machine with a
// custom command in the rescue system instead of creating it from an HCloud image.
type HCloudCustomProvisioner struct {
// URL gets used for installing custom node images. If customProvisioner is set, the controller
// url gets used for installing custom node images. If customProvisioner is set, the controller
// boots a new HCloud machine into rescue mode. Then the command referenced by
// Command will be copied into the rescue system and executed.
// command will be copied into the rescue system and executed.
//
// The controller uses url.ParseRequestURI (Go function) to validate the URL.
// The controller uses url.ParseRequestURI (Go function) to validate the url.
//
// It is up to the script to provision the disk of the hcloud machine accordingly. The process
// is considered successful if the last line in the output contains
Expand All @@ -97,8 +97,8 @@ type HCloudCustomProvisioner struct {
// +kubebuilder:validation:MinLength=1
URL string `json:"url"`

// Command is the basename of a command file below /shared on the controller pod which
// provisions a machine from URL. CAPH copies that command into the rescue system and
// command is the basename of a command file below /shared on the controller pod which
// provisions a machine from url. CAPH copies that command into the rescue system and
// executes it there.
// +kubebuilder:validation:MinLength=1
Command string `json:"command"`
Expand All @@ -119,52 +119,51 @@ type HCloudMachineStatus struct {
// +optional
Initialization HCloudMachineInitializationStatus `json:"initialization,omitempty,omitzero"`

// Addresses contain the server's associated addresses.
// addresses contain the server's associated addresses.
// +optional
// +listType=atomic
Addresses []clusterv1.MachineAddress `json:"addresses,omitempty"`

// Region contains the name of the HCloud location the server is running.
// region contains the name of the HCloud location the server is running.
// +optional
Region Region `json:"region,omitempty"`

// SSHKeys specifies the ssh keys that were used for provisioning the server.
// sshKeys specifies the ssh keys that were used for provisioning the server.
// +optional
// +listType=map
// +listMapKey=name
SSHKeys []SSHKey `json:"sshKeys,omitempty"`

// InstanceState is the state of the server for this machine.
// instanceState is the state of the server for this machine.
// +optional
InstanceState InstanceState `json:"instanceState,omitempty"`

// BootState indicates the current state during provisioning.
// bootState indicates the current state during provisioning.
//
// If Spec.ImageName is set the states will be:
// If spec.imageName is set the states will be:
// 1. BootingToRealOS
// 2. OperatingSystemRunning
//
// If Spec.CustomProvisioner is set the states will be:
// If spec.customProvisioner is set the states will be:
// 1. Initializing
// 2. EnablingRescue
// 3. BootingToRescue
// 4. RunningImageCommand
// 5. BootingToRealOS
// 6. OperatingSystemRunning

// +optional
BootState HCloudBootState `json:"bootState"`

// BootStateSince is the timestamp of the last change to BootState. It is used to timeout
// bootStateSince is the timestamp of the last change to bootState. It is used to timeout
// provisioning if a state takes too long.
// +optional
BootStateSince metav1.Time `json:"bootStateSince,omitzero"`

// ExternalIDs contains temporary data during the provisioning process
// externalIDs contains temporary data during the provisioning process
// +optional
ExternalIDs HCloudMachineStatusExternalIDs `json:"externalIDs,omitempty"`

// LastRemediatedAt records when the most recent successful remediation completed.
// lastRemediatedAt records when the most recent successful remediation completed.
// Used to prevent reboot loops across successive MHC incidents.
// +optional
LastRemediatedAt metav1.Time `json:"lastRemediatedAt,omitempty,omitzero"`
Expand Down Expand Up @@ -231,11 +230,11 @@ const (

// HCloudMachineStatusExternalIDs holds temporary data during the provisioning process.
type HCloudMachineStatusExternalIDs struct {
// ActionIDEnableRescueSystem is the hcloud API Action result of EnableRescueSystem.
// actionIdEnableRescueSystem is the hcloud API Action result of EnableRescueSystem.
// +optional
ActionIDEnableRescueSystem int64 `json:"actionIdEnableRescueSystem,omitzero"`

// ActionIDCreateServer is the hcloud API Action result of CreateServer.
// actionIdCreateServer is the hcloud API Action result of CreateServer.
// +optional
ActionIDCreateServer int64 `json:"actionIdCreateServer,omitzero"`
}
Expand Down
8 changes: 4 additions & 4 deletions api/v1beta2/hcloudmachinetemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ type HCloudMachineTemplateStatus struct {
// +kubebuilder:validation:MaxItems=32
Conditions []metav1.Condition `json:"conditions,omitempty"`

// Capacity defines the resource capacity for this machine.
// capacity defines the resource capacity for this machine.
// This value is used for autoscaling from zero operations as defined in:
// https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20210310-opt-in-autoscaling-from-zero.md
// +optional
Capacity corev1.ResourceList `json:"capacity,omitempty"`

// OwnerType is the type of object that owns the HCloudMachineTemplate.
// ownerType is the type of object that owns the HCloudMachineTemplate.
// +optional
OwnerType string `json:"ownerType,omitempty"`

Expand Down Expand Up @@ -183,11 +183,11 @@ type HCloudMachineTemplateList struct {

// HCloudMachineTemplateResource describes the data needed to create an HCloudMachine from a template.
type HCloudMachineTemplateResource struct {
// Standard object's metadata.
// metadata is the standard object's metadata.
// +optional
ObjectMeta clusterv1.ObjectMeta `json:"metadata,omitempty,omitzero"`

// Spec is the specification of the desired behavior of the machine.
// spec is the specification of the desired behavior of the machine.
Spec HCloudMachineSpec `json:"spec"`
}

Expand Down
8 changes: 4 additions & 4 deletions api/v1beta2/hcloudremediation_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ import (

// HCloudRemediationSpec defines the desired state of HCloudRemediation.
type HCloudRemediationSpec struct {
// Strategy field defines remediation strategy.
// strategy field defines remediation strategy.
Strategy *RemediationStrategy `json:"strategy,omitempty"`
}

// HCloudRemediationStatus defines the observed state of HCloudRemediation.
type HCloudRemediationStatus struct {
// Phase represents the current phase of machine remediation.
// phase represents the current phase of machine remediation.
// One of Running, Waiting, Deleting machine or Succeeded.
// +optional
Phase string `json:"phase,omitempty"`

// RetryCount records how many times the remediation controller has tried to
// retryCount records how many times the remediation controller has tried to
// remediate the node, for example the number of reboots.
// +optional
RetryCount *int32 `json:"retryCount,omitempty"`

// LastRemediated identifies when the host was last remediated.
// lastRemediated identifies when the host was last remediated.
// A zero value is treated as absent.
// +optional
LastRemediated metav1.Time `json:"lastRemediated,omitempty,omitzero"`
Expand Down
4 changes: 2 additions & 2 deletions api/v1beta2/hcloudremediationtemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ type HCloudRemediationTemplateSpec struct {

// HCloudRemediationTemplateResource describes the data needed to create a HCloudRemediation from a template.
type HCloudRemediationTemplateResource struct {
// Spec is the specification of the desired behavior of the HCloudRemediation.
// spec is the specification of the desired behavior of the HCloudRemediation.
Spec HCloudRemediationSpec `json:"spec"`
}

// HCloudRemediationTemplateStatus defines the observed state of HCloudRemediationTemplate.
type HCloudRemediationTemplateStatus struct {
// HCloudRemediationStatus defines the observed state of HCloudRemediation
// status defines the observed state of HCloudRemediation
Status HCloudRemediationStatus `json:"status"`
}

Expand Down
58 changes: 29 additions & 29 deletions api/v1beta2/hetznerbaremetalhost_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ const (
// the details to be specified. HardwareDetails in the host's status can be used to find the correct device.
// Currently, you can specify one disk or a raid setup.
type RootDeviceHints struct {
// WWN is a unique storage identifier used for non-raid setups. The hint
// wwn is a unique storage identifier used for non-raid setups. The hint
// must match the actual value exactly.
// +optional
WWN string `json:"wwn,omitempty"`
// Raid is used to specify multiple storage devices. It provides the controller with information
// raid is used to specify multiple storage devices. It provides the controller with information
// on which disks a raid can be established.
// +optional
Raid Raid `json:"raid,omitempty"`
Expand Down Expand Up @@ -97,7 +97,7 @@ func (rdh *RootDeviceHints) ListOfWWN() []string {

// Raid can be used instead of WWN to point to multiple storage devices.
type Raid struct {
// WWN defines a list of unique storage identifiers used for raid setups.
// wwn defines a list of unique storage identifiers used for raid setups.
WWN []string `json:"wwn,omitempty"`
}

Expand Down Expand Up @@ -207,21 +207,21 @@ type RebootAnnotationArguments struct {
// HetznerBareMetalHostConsumerReference is a reference to the HetznerBareMetalMachine
// that is using a HetznerBareMetalHost.
type HetznerBareMetalHostConsumerReference struct {
// Kind is the kind of the resource being referenced.
// kind is the kind of the resource being referenced.
// +required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=63
// +kubebuilder:validation:Pattern=`^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$`
Kind string `json:"kind,omitempty"`

// Name is the name of the resource being referenced.
// name is the name of the resource being referenced.
// +required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`
Name string `json:"name,omitempty"`

// APIGroup is the group of the resource being referenced.
// apiGroup is the group of the resource being referenced.
// +required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
Expand All @@ -231,26 +231,26 @@ type HetznerBareMetalHostConsumerReference struct {

// HetznerBareMetalHostSpec defines the desired state of HetznerBareMetalHost.
type HetznerBareMetalHostSpec struct {
// ServerID defines the ID of the server provided by Hetzner.
// serverID defines the ID of the server provided by Hetzner.
// Find it on your Hetzner robot dashboard.
ServerID int `json:"serverID"`

// RootDeviceHints provides guidance about how to choose the device for the image
// rootDeviceHints provides guidance about how to choose the device for the image
// being provisioned. They need to be specified to provision the host.
// +optional
RootDeviceHints *RootDeviceHints `json:"rootDeviceHints,omitempty"`

// ConsumerRef is a reference to the HetznerBareMetalMachine
// consumerRef is a reference to the HetznerBareMetalMachine
// that is using this host. When it is not empty, the host is considered "in use".
// +optional
ConsumerRef *HetznerBareMetalHostConsumerReference `json:"consumerRef,omitempty"`

// MaintenanceMode indicates that a machine is supposed to be deprovisioned. The CAPI Machine
// maintenanceMode indicates that a machine is supposed to be deprovisioned. The CAPI Machine
// will get the cluster.x-k8s.io/remediate-machine annotation, and CAPI will deprovision the
// machine. Additionally, the host won't be selected by any Hetzner bare metal machine.
MaintenanceMode *bool `json:"maintenanceMode,omitempty"`

// Description is a human-entered text used to help identify the host.
// description is a human-entered text used to help identify the host.
// It can be used to store some valuable information about the host.
// +optional
Description string `json:"description,omitempty"`
Expand Down Expand Up @@ -452,13 +452,13 @@ func HetznerBareMetalHostSummaryOpts() []conditions.SummaryOption {

// SSHStatus contains all status information about SSHStatus.
type SSHStatus struct {
// CurrentRescue gives information about the secret where the rescue ssh key is stored.
// currentRescue gives information about the secret where the rescue ssh key is stored.
CurrentRescue *SecretStatus `json:"currentRescue,omitempty"`
// CurrentOS gives information about the secret where the os ssh key is stored.
// currentOS gives information about the secret where the os ssh key is stored.
CurrentOS *SecretStatus `json:"currentOS,omitempty"`
// OSKey contains name and fingerprint of the in HetznerBareMetalMachine spec specified SSH key.
// osKey contains name and fingerprint of the in HetznerBareMetalMachine spec specified SSH key.
OSKey *SSHKey `json:"osKey,omitempty"`
// RescueKey contains name and fingerprint of the in HetznerCluster spec specified SSH key.
// rescueKey contains name and fingerprint of the in HetznerCluster spec specified SSH key.
RescueKey *SSHKey `json:"rescueKey,omitempty"`
}

Expand Down Expand Up @@ -506,53 +506,53 @@ type CPU struct {

// Storage describes one storage device (disk, SSD, etc.) on the host.
type Storage struct {
// The Linux device name of the disk, e.g. "/dev/sda". Note that this
// name is the Linux device name of the disk, e.g. "/dev/sda". Note that this
// may not be stable across reboots.
Name string `json:"name,omitempty"`

// SizeBytes is the size of the disk in Bytes.
// sizeBytes is the size of the disk in Bytes.
SizeBytes Capacity `json:"sizeBytes,omitempty"`

// SizeGB is the size of the disk in GB.
// sizeGB is the size of the disk in GB.
SizeGB Capacity `json:"sizeGB,omitempty"`

// Vendor is the name of the vendor of the device.
// vendor is the name of the vendor of the device.
Vendor string `json:"vendor,omitempty"`

// Model represents the Hardware model.
// model represents the Hardware model.
Model string `json:"model,omitempty"`

// SerialNumber denotes the serial number of the device.
// serialNumber denotes the serial number of the device.
SerialNumber string `json:"serialNumber,omitempty"`

// WWN defines the WWN of the device.
// wwn defines the WWN of the device.
WWN string `json:"wwn,omitempty"`

// HCTL defines the SCSI location of the device.
// hctl defines the SCSI location of the device.
HCTL string `json:"hctl,omitempty"`

// Rota defines if it's an HDD device or not.
// rota defines if it's an HDD device or not.
Rota bool `json:"rota,omitempty"`
}

// NIC describes one network interface on the host.
type NIC struct {
// The name of the network interface, e.g. "en0"
// name is the name of the network interface, e.g. "en0"
Name string `json:"name,omitempty"`

// The vendor and product IDs of the NIC, e.g. "0x8086 0x1572"
// model is the vendor and product IDs of the NIC, e.g. "0x8086 0x1572"
Model string `json:"model,omitempty"`

// The device MAC address
// mac is the device MAC address
// +kubebuilder:validation:Pattern=`[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}`
MAC string `json:"mac,omitempty"`

// The IP address of the interface. This will be an IPv4 or IPv6 address
// ip is the IP address of the interface. This will be an IPv4 or IPv6 address
// if one is present. If both IPv4 and IPv6 addresses are present in a
// dual-stack environment, two nics will be output, one with each IP.
IP string `json:"ip,omitempty"`

// The speed of the device in Gigabits per second
// speedMbps is the speed of the device in Megabits per second
SpeedMbps int `json:"speedMbps,omitempty"`
}

Expand Down
Loading
Loading