client

package
v1.61.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProvisionWorkerNodeTemplate = "provision-worker-node"
	PartitionNumber             = "{{.partition_number}}"
	OSImageURL                  = "{{.os_image}}"
)
View Source
const DefaultPartitionNumber = "3"

DefaultPartitionNumber defines the default value for the "partition_number" field.

View Source
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

type HardwareClient struct {
	TinkerbellClient client.Client
}

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 Task

type Task struct {
	Name        string            `json:"name"`
	WorkerAddr  string            `json:"worker" yaml:"worker"`
	Actions     []Action          `json:"actions"`
	Volumes     []string          `json:"volumes,omitempty"`
	Environment map[string]string `json:"environment,omitempty"`
}

type Template

type Template struct {
	Version       string `yaml:"version"`
	Name          string `yaml:"name"`
	GlobalTimeout int64  `yaml:"global_timeout"`
	Tasks         []Task `yaml:"tasks"`
}

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.

Jump to

Keyboard shortcuts

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