Documentation ¶
Index ¶
- Constants
- type Action
- type HardwareClient
- func (h *HardwareClient) GetHardware(ctx context.Context, hardwareRef types.NamespacedName) (*tinkv1alpha1.Hardware, error)
- func (h *HardwareClient) GetHardwareWithID(ctx context.Context, uid string) (*tinkv1alpha1.Hardware, error)
- func (h *HardwareClient) SetHardwareID(ctx context.Context, hardware *tinkv1alpha1.Hardware, newID string) error
- type Task
- type Template
- type TemplateClient
- type WorkflowClient
- func (w *WorkflowClient) CleanupWorkflows(ctx context.Context, hardwareName, namespace string) error
- func (w *WorkflowClient) CreateWorkflow(ctx context.Context, userData, templateRef, osImageURL string, ...) error
- func (w *WorkflowClient) GetWorkflow(ctx context.Context, name string, namespace string) (*tinkv1alpha1.Workflow, error)
Constants ¶
const ( ProvisionWorkerNodeTemplate = "provision-worker-node" PartitionNumber = "{{.partition_number}}" OSImageURL = "{{.os_image}}" )
const DefaultPartitionNumber = "3"
DefaultPartitionNumber defines the default value for the "partition_number" field.
const PartitionNumberAnnotation = "hardware.kubermatic.io/partition-number"
PartitionNumberAnnotation is used to specify the main partition number of the disk device.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { Name string `json:"name,omitempty"` Image string `json:"image,omitempty"` Timeout int64 `json:"timeout,omitempty"` Volumes []string `json:"volumes,omitempty"` Pid string `json:"pid,omitempty"` Environment map[string]string `json:"environment,omitempty"` Command []string `json:"command,omitempty"` }
Action represents a workflow action.
type HardwareClient ¶
HardwareClient manages Tinkerbell hardware resources across two clusters.
func NewHardwareClient ¶
func NewHardwareClient(tinkerbellClient client.Client) *HardwareClient
NewHardwareClient creates a new instance of HardwareClient.
func (*HardwareClient) GetHardware ¶
func (h *HardwareClient) GetHardware(ctx context.Context, hardwareRef types.NamespacedName) (*tinkv1alpha1.Hardware, error)
GetHardware fetches a hardware object from the Tinkerbell cluster based on the hardware reference in the machine deployment object.
func (*HardwareClient) GetHardwareWithID ¶
func (h *HardwareClient) GetHardwareWithID(ctx context.Context, uid string) (*tinkv1alpha1.Hardware, error)
func (*HardwareClient) SetHardwareID ¶
func (h *HardwareClient) SetHardwareID(ctx context.Context, hardware *tinkv1alpha1.Hardware, newID string) error
SetHardwareID sets the ID of a specified Hardware object.
type TemplateClient ¶
type TemplateClient struct {
// contains filtered or unexported fields
}
TemplateClient handles interactions with the Tinkerbell Templates in the Tinkerbell cluster.
func NewTemplateClient ¶
func NewTemplateClient(k8sClient client.Client) *TemplateClient
NewTemplateClient creates a new client for managing Tinkerbell Templates.
func (*TemplateClient) CreateTemplate ¶
func (t *TemplateClient) CreateTemplate(ctx context.Context, namespace string) error
CreateTemplate creates a Tinkerbell Template in the Kubernetes cluster.
func (*TemplateClient) Delete ¶
func (t *TemplateClient) Delete(ctx context.Context, namespacedName types.NamespacedName) error
type WorkflowClient ¶
type WorkflowClient struct {
// contains filtered or unexported fields
}
WorkflowClient handles interactions with the Tinkerbell Workflows.
func NewWorkflowClient ¶
func NewWorkflowClient(k8sClient client.Client) *WorkflowClient
NewWorkflowClient creates a new client for managing Tinkerbell workflows.
func (*WorkflowClient) CleanupWorkflows ¶
func (w *WorkflowClient) CleanupWorkflows(ctx context.Context, hardwareName, namespace string) error
CleanupWorkflows would delete all workflows that are assigned to a de-provisioned hardware, and they are in a pending state, to avoid the situation of re-running a workflow for a de-provisioned machine.
func (*WorkflowClient) CreateWorkflow ¶
func (w *WorkflowClient) CreateWorkflow(ctx context.Context, userData, templateRef, osImageURL string, hardware tink.Hardware) error
CreateWorkflow creates a new Tinkerbell Workflow resource in the cluster.
func (*WorkflowClient) GetWorkflow ¶
func (w *WorkflowClient) GetWorkflow(ctx context.Context, name string, namespace string) (*tinkv1alpha1.Workflow, error)
GetWorkflow retrieves a Tinkerbell Workflow resource from the cluster.