provisioning

package
v0.34.12 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNodePoolsNotFound = errors.New("no nodepools found")

Functions

func NewNodeController added in v0.34.0

func NewNodeController(kubeClient client.Client, provisioner *Provisioner, recorder events.Recorder) operatorcontroller.Controller

NewNodeController constructs a controller instance

func NewPodController added in v0.34.0

func NewPodController(kubeClient client.Client, provisioner *Provisioner, recorder events.Recorder) operatorcontroller.Controller

NewPodController constructs a controller instance

func WithReason

func WithReason(reason string) func(LaunchOptions) LaunchOptions

Types

type Batcher

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

Batcher separates a stream of Trigger() calls into windowed slices. The window is dynamic and will be extended if additional items are added up to a maximum batch duration.

func NewBatcher

func NewBatcher() *Batcher

NewBatcher is a constructor for the Batcher

func (*Batcher) Trigger

func (b *Batcher) Trigger()

Trigger causes the batcher to start a batching window, or extend the current batching window if it hasn't reached the maximum length.

func (*Batcher) Wait

func (b *Batcher) Wait(ctx context.Context) bool

Wait starts a batching window and continues waiting as long as it continues receiving triggers within the idleDuration, up to the maxDuration

type LaunchOptions

type LaunchOptions struct {
	RecordPodNomination bool
	Reason              string
}

LaunchOptions are the set of options that can be used to trigger certain actions and configuration during scheduling

func RecordPodNomination

func RecordPodNomination(o LaunchOptions) LaunchOptions

RecordPodNomination causes nominate pod events to be recorded against the node.

type NodeController added in v0.34.0

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

NodeController for the resource

func (*NodeController) Builder added in v0.34.0

func (*NodeController) Name added in v0.34.0

func (*NodeController) Name() string

func (*NodeController) Reconcile added in v0.34.0

func (c *NodeController) Reconcile(_ context.Context, n *v1.Node) (reconcile.Result, error)

Reconcile the resource

type PodController added in v0.34.0

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

PodController for the resource

func (*PodController) Builder added in v0.34.0

func (*PodController) Name added in v0.34.0

func (*PodController) Name() string

func (*PodController) Reconcile added in v0.34.0

func (c *PodController) Reconcile(_ context.Context, p *v1.Pod) (reconcile.Result, error)

Reconcile the resource

type Provisioner

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

Provisioner waits for enqueued pods, batches them, creates capacity and binds the pods to the capacity.

func NewProvisioner

func NewProvisioner(kubeClient client.Client, recorder events.Recorder,
	cloudProvider cloudprovider.CloudProvider, cluster *state.Cluster,
) *Provisioner

func (*Provisioner) Builder

func (*Provisioner) Create

func (*Provisioner) CreateNodeClaims

func (p *Provisioner) CreateNodeClaims(ctx context.Context, nodeClaims []*scheduler.NodeClaim, opts ...functional.Option[LaunchOptions]) ([]string, error)

CreateNodeClaims launches nodes passed into the function in parallel. It returns a slice of the successfully created node names as well as a multierr of any errors that occurred while launching nodes

func (*Provisioner) GetPendingPods

func (p *Provisioner) GetPendingPods(ctx context.Context) ([]*v1.Pod, error)

func (*Provisioner) Name

func (p *Provisioner) Name() string

func (*Provisioner) NewScheduler

func (p *Provisioner) NewScheduler(ctx context.Context, pods []*v1.Pod, stateNodes []*state.StateNode, opts scheduler.SchedulerOptions) (*scheduler.Scheduler, error)

func (*Provisioner) Reconcile

func (p *Provisioner) Reconcile(ctx context.Context, _ reconcile.Request) (result reconcile.Result, err error)

func (*Provisioner) Schedule

func (p *Provisioner) Schedule(ctx context.Context) (scheduler.Results, error)

func (*Provisioner) Trigger

func (p *Provisioner) Trigger()

func (*Provisioner) Validate

func (p *Provisioner) Validate(ctx context.Context, pod *v1.Pod) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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