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
24 changes: 10 additions & 14 deletions api/v1beta1/tinkerbellmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1beta1

import (
tinkv1 "github.com/tinkerbell/tinkerbell/api/v1alpha1/tinkerbell"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand All @@ -25,18 +26,8 @@ const (
// MachineFinalizer allows ReconcileTinkerbellMachine to clean up Tinkerbell resources before
// removing it from the apiserver.
MachineFinalizer = "tinkerbellmachine.infrastructure.cluster.x-k8s.io"

// BootModeNetboot is the mode for networking booting.
BootModeNetboot BootMode = "netboot"
// BootModeISO is the mode for ISO booting. This is deprecated, use BootModeIsoboot instead.
BootModeISO BootMode = "iso"
// BootModeIsoboot is the mode for ISO booting.
BootModeIsoboot BootMode = "isoboot"
)

// BootMode defines the type of booting that will be done. i.e. netboot, iso, etc.
type BootMode string

// TinkerbellMachineSpec defines the desired state of TinkerbellMachine.
type TinkerbellMachineSpec struct {
// ImageLookupFormat is the URL naming format to use for machine images when
Expand Down Expand Up @@ -102,15 +93,20 @@ type BootOptions struct {
// MAC address is then used to retrieve hardware specific information such as
// IPAM info, custom kernel cmd line args and populate the worker ID for the tink worker/agent.
// For ex. the above format would be replaced to http://$IP:$Port/iso/<macAddress>/hook.iso
//
// BootMode must be set to "isoboot".
// +optional
// +kubebuilder:validation:Format=url
ISOURL string `json:"isoURL,omitempty"`

// BootMode is the type of booting that will be done.
// Must be one of "none", "netboot", "iso", or "isoboot".
// BootMode is the type of booting that will be done. One of "netboot", "isoboot", or "customboot".
// +optional
// +kubebuilder:validation:Enum=none;netboot;iso;isoboot
BootMode BootMode `json:"bootMode,omitempty"`
// +kubebuilder:validation:Enum=netboot;isoboot;iso;customboot
BootMode tinkv1.BootMode `json:"bootMode,omitempty"`

// CustombootConfig is the configuration for the "customboot" boot mode.
// This allows users to define custom BMC Actions.
CustombootConfig tinkv1.CustombootConfig `json:"custombootConfig,omitempty,omitzero"`
}

// HardwareAffinity defines the required and preferred hardware affinities.
Expand Down
3 changes: 2 additions & 1 deletion api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,177 @@ spec:
description: BootOptions are options that control the booting of Hardware.
properties:
bootMode:
description: |-
BootMode is the type of booting that will be done.
Must be one of "none", "netboot", "iso", or "isoboot".
description: BootMode is the type of booting that will be done.
One of "netboot", "isoboot", or "customboot".
enum:
- none
- netboot
- iso
- isoboot
- iso
- customboot
type: string
custombootConfig:
description: |-
CustombootConfig is the configuration for the "customboot" boot mode.
This allows users to define custom BMC Actions.
properties:
postActions:
description: |-
PostActions are the BMC Actions that will be run after all Workflow Actions have completed.
In most cases these Actions should get a Machine into a state where it can be powered off or rebooted and remove any mounted virtual media.
These Actions will be run only if the main Workflow Actions complete successfully.
items:
description: |-
Action represents the action to be performed.
A single task can only perform one type of action.
For example either PowerAction or OneTimeBootDeviceAction.
maxProperties: 1
properties:
bootDevice:
description: BootDevice is the device to set as the
first boot device on the Machine.
properties:
device:
description: Device is the name of the device to
set as the first boot device.
type: string
efiBoot:
description: EFIBoot indicates whether the boot
device should be set to efiboot mode.
type: boolean
persistent:
description: Persistent indicates whether the boot
device should be set persistently as the first
boot device.
type: boolean
type: object
oneTimeBootDeviceAction:
description: OneTimeBootDeviceAction represents a baseboard
management one time set boot device operation.
properties:
device:
description: |-
Devices represents the boot devices, in order for setting one time boot.
Currently only the first device in the slice is used to set one time boot.
items:
description: BootDevice represents boot device
of the Machine.
type: string
type: array
efiBoot:
description: EFIBoot instructs the machine to use
EFI boot.
type: boolean
required:
- device
type: object
powerAction:
description: PowerAction represents a baseboard management
power operation.
enum:
- "on"
- "off"
- soft
- status
- cycle
- reset
type: string
virtualMediaAction:
description: VirtualMediaAction represents a baseboard
management virtual media insert/eject.
properties:
kind:
description: Kind represents the kind of virtual
media.
type: string
mediaURL:
description: mediaURL represents the URL of the
image to be inserted into the virtual media, or
empty to eject media.
type: string
required:
- kind
type: object
type: object
type: array
preparingActions:
description: |-
PreparingActions are the BMC Actions that will be run before any Workflow Actions.
In most cases these Actions should get a Machine into a state where a Tink Agent is running.
items:
description: |-
Action represents the action to be performed.
A single task can only perform one type of action.
For example either PowerAction or OneTimeBootDeviceAction.
maxProperties: 1
properties:
bootDevice:
description: BootDevice is the device to set as the
first boot device on the Machine.
properties:
device:
description: Device is the name of the device to
set as the first boot device.
type: string
efiBoot:
description: EFIBoot indicates whether the boot
device should be set to efiboot mode.
type: boolean
persistent:
description: Persistent indicates whether the boot
device should be set persistently as the first
boot device.
type: boolean
type: object
oneTimeBootDeviceAction:
description: OneTimeBootDeviceAction represents a baseboard
management one time set boot device operation.
properties:
device:
description: |-
Devices represents the boot devices, in order for setting one time boot.
Currently only the first device in the slice is used to set one time boot.
items:
description: BootDevice represents boot device
of the Machine.
type: string
type: array
efiBoot:
description: EFIBoot instructs the machine to use
EFI boot.
type: boolean
required:
- device
type: object
powerAction:
description: PowerAction represents a baseboard management
power operation.
enum:
- "on"
- "off"
- soft
- status
- cycle
- reset
type: string
virtualMediaAction:
description: VirtualMediaAction represents a baseboard
management virtual media insert/eject.
properties:
kind:
description: Kind represents the kind of virtual
media.
type: string
mediaURL:
description: mediaURL represents the URL of the
image to be inserted into the virtual media, or
empty to eject media.
type: string
required:
- kind
type: object
type: object
type: array
type: object
isoURL:
description: |-
ISOURL is the URL of the ISO that will be one-time booted.
Expand All @@ -89,6 +251,8 @@ spec:
MAC address is then used to retrieve hardware specific information such as
IPAM info, custom kernel cmd line args and populate the worker ID for the tink worker/agent.
For ex. the above format would be replaced to http://$IP:$Port/iso/<macAddress>/hook.iso

BootMode must be set to "isoboot".
format: url
type: string
type: object
Expand Down
Loading