provisioning

package
v0.37.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

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 NewNodeController added in v0.34.0

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

NewNodeController constructs a controller instance

func (*NodeController) Reconcile added in v0.34.0

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

Reconcile the resource

func (*NodeController) Register added in v0.37.0

func (c *NodeController) Register(_ context.Context, m manager.Manager) error

type PodController added in v0.34.0

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

PodController for the resource

func NewPodController added in v0.34.0

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

NewPodController constructs a controller instance

func (*PodController) Reconcile added in v0.34.0

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

Reconcile the resource

func (*PodController) Register added in v0.37.0

func (c *PodController) Register(_ context.Context, m manager.Manager) error

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) 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) NewScheduler

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

func (*Provisioner) Reconcile

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

func (*Provisioner) Register added in v0.37.0

func (p *Provisioner) Register(_ context.Context, mgr manager.Manager) 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