worker

package
v1.42.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ResourceGPU is the GPU resource. It should be a non-negative integer.
	ResourceGPU v1.ResourceName = "gpu"
	// VolumeTypeScratch is the gcp SCRATCH volume type
	VolumeTypeScratch = "SCRATCH"
)

Variables

View Source
var (
	// AllowedTypesIops are the volume types for which iops can be configured
	AllowedTypesIops = []string{persistentDiskExtreme, hyperDiskExtreme, hyperDiskBalanced}
	// AllowedTypesThroughput are the volume types for which throughput can be configured
	AllowedTypesThroughput = []string{hyperDiskThroughput, hyperDiskBalanced}
)
View Source
var (
	// DefaultAddOptions are the default AddOptions for AddToManager.
	DefaultAddOptions = AddOptions{}
)
View Source
var InitializeCapacity = initializeCapacity

InitializeCapacity is a handle to make the function accessible to the tests.

Functions

func AddToManager

func AddToManager(ctx context.Context, mgr manager.Manager) error

AddToManager adds a controller with the default Options.

func AddToManagerWithOptions

func AddToManagerWithOptions(ctx context.Context, mgr manager.Manager, opts AddOptions) error

AddToManagerWithOptions adds a controller with the given Options to the given manager. The opts.Reconciler is being set with a newly instantiated actuator.

func NewActuator

func NewActuator(mgr manager.Manager, gardenCluster cluster.Cluster) worker.Actuator

NewActuator creates a new Actuator that updates the status of the handled WorkerPoolConfigs.

func NewWorkerDelegate

func NewWorkerDelegate(
	client client.Client,
	scheme *runtime.Scheme,

	seedChartApplier gardener.ChartApplier,
	serverVersion string,

	worker *extensionsv1alpha1.Worker,
	cluster *extensionscontroller.Cluster,
) (genericactuator.WorkerDelegate, error)

NewWorkerDelegate creates a new context for a worker reconciliation.

func SanitizeGcpLabel added in v1.7.0

func SanitizeGcpLabel(label string) string

SanitizeGcpLabel will sanitize the label base on the gcp label Restrictions

func SanitizeGcpLabelValue added in v1.7.0

func SanitizeGcpLabelValue(value string) string

SanitizeGcpLabelValue will sanitize the value base on the gcp label Restrictions

Types

type AddOptions

type AddOptions struct {
	// GardenCluster is the garden cluster object.
	GardenCluster cluster.Cluster
	// Controller are the controller.Options.
	Controller controller.Options
	// IgnoreOperationAnnotation specifies whether to ignore the operation annotation or not.
	IgnoreOperationAnnotation bool
	// ExtensionClass defines the extension class this extension is responsible for.
	ExtensionClass extensionsv1alpha1.ExtensionClass
}

AddOptions are options to apply when adding the GCP worker controller to the manager.

type WorkerDelegate added in v1.42.0

type WorkerDelegate struct {
	// contains filtered or unexported fields
}

WorkerDelegate handles the reconciliation of worker resources

func (*WorkerDelegate) CleanupMachineDependencies added in v1.42.0

func (w *WorkerDelegate) CleanupMachineDependencies(_ context.Context) error

CleanupMachineDependencies implements genericactuator.WorkerDelegate.

func (*WorkerDelegate) DeployMachineClasses added in v1.42.0

func (w *WorkerDelegate) DeployMachineClasses(ctx context.Context) error

DeployMachineClasses generates and creates the GCP specific machine classes.

func (*WorkerDelegate) DeployMachineDependencies added in v1.42.0

func (w *WorkerDelegate) DeployMachineDependencies(_ context.Context) error

DeployMachineDependencies implements genericactuator.WorkerDelegate.

func (*WorkerDelegate) GenerateMachineDeployments added in v1.42.0

func (w *WorkerDelegate) GenerateMachineDeployments(ctx context.Context) (worker.MachineDeployments, error)

GenerateMachineDeployments generates the configuration for the desired machine deployments.

func (*WorkerDelegate) GetMachineClasses added in v1.42.0

func (w *WorkerDelegate) GetMachineClasses() []map[string]any

GetMachineClasses returns the slice of machine classes contained inside the worker delegate. Introduced for Unit-testing.

func (*WorkerDelegate) MachineClass added in v1.42.0

func (w *WorkerDelegate) MachineClass() client.Object

MachineClass yields a newly initialized machine class object.

func (*WorkerDelegate) MachineClassKind added in v1.42.0

func (w *WorkerDelegate) MachineClassKind() string

MachineClassKind yields the name of the machine class kind used by GCP provider.

func (*WorkerDelegate) MachineClassList added in v1.42.0

func (w *WorkerDelegate) MachineClassList() client.ObjectList

MachineClassList yields a newly initialized MachineClassList object.

func (*WorkerDelegate) PostDeleteHook added in v1.42.0

func (w *WorkerDelegate) PostDeleteHook(_ context.Context) error

PostDeleteHook implements genericactuator.WorkerDelegate.

func (*WorkerDelegate) PostReconcileHook added in v1.42.0

func (w *WorkerDelegate) PostReconcileHook(_ context.Context) error

PostReconcileHook implements genericactuator.WorkerDelegate.

func (*WorkerDelegate) PreDeleteHook added in v1.42.0

func (w *WorkerDelegate) PreDeleteHook(_ context.Context) error

PreDeleteHook implements genericactuator.WorkerDelegate.

func (*WorkerDelegate) PreReconcileHook added in v1.42.0

func (w *WorkerDelegate) PreReconcileHook(_ context.Context) error

PreReconcileHook implements genericactuator.WorkerDelegate.

func (*WorkerDelegate) UpdateMachineImagesStatus added in v1.42.0

func (w *WorkerDelegate) UpdateMachineImagesStatus(ctx context.Context) error

UpdateMachineImagesStatus updates the machine image status with the used machine images for the `Worker` resource.

Jump to

Keyboard shortcuts

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