controller

package
v0.0.0-...-1764fb8 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2019 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const MsgUnschedulable = "Failed to schedule shoot"

MsgUnschedulable is the Message for the Event on a Shoot that the Scheduler creates in case it cannot schedule the Shoot to any Seed

Variables

This section is empty.

Functions

func UpdateShootToBeScheduledOntoSeed

func UpdateShootToBeScheduledOntoSeed(ctx context.Context, shoot *gardenv1beta1.Shoot, seed *gardenv1beta1.Seed, executeSchedulingRequest executeSchedulingRequest) error

UpdateShootToBeScheduledOntoSeed sets the seed name where the shoot should be scheduled on. Then it executes the actual update call to the API server. The call is capsuled to allow for easier testing.

Types

type AlreadyScheduledError

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

AlreadyScheduledError is an error to indicate that a shoot has already a seed assigned when trying to update it.

func (*AlreadyScheduledError) Error

func (e *AlreadyScheduledError) Error() string

type SchedulerController

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

SchedulerController controls Seeds.

func NewGardenerScheduler

func NewGardenerScheduler(k8sGardenClient kubernetes.Interface, gardenInformerFactory gardeninformers.SharedInformerFactory, config *config.SchedulerConfiguration, recorder record.EventRecorder) *SchedulerController

NewGardenerScheduler takes a Kubernetes client for the Garden clusters <k8sGardenClient>, a <sharedInformerFactory>, a struct containing the scheduler configuration and a <recorder> for event recording. It creates a new NewGardenerScheduler.

func (*SchedulerController) CollectMetrics

func (c *SchedulerController) CollectMetrics(ch chan<- prometheus.Metric)

CollectMetrics implements gardenmetrics.ControllerMetricsCollector interface

func (*SchedulerController) Run

Run runs the SchedulerController until the given stop channel can be read from.

func (*SchedulerController) RunningWorkers

func (c *SchedulerController) RunningWorkers() int

RunningWorkers returns the number of running workers.

type SchedulerInterface

type SchedulerInterface interface {
	// ScheduleShoot implements the control logic for Shoot Scheduling (to a Seed).
	// If an implementation returns a non-nil error, the invocation will be retried respecting the RetrySyncPeriod with exponential backoff.
	ScheduleShoot(ctx context.Context, seed *gardenv1beta1.Shoot, key string) error
}

SchedulerInterface implements the control logic for updating Seeds. It is implemented as an interface to allow for extensions that provide different semantics. Currently, there is only one implementation.

func NewDefaultControl

func NewDefaultControl(k8sGardenClient kubernetes.Interface, k8sGardenInformers gardeninformers.SharedInformerFactory, recorder record.EventRecorder, config *config.SchedulerConfiguration, shootLister gardenlisters.ShootLister, seedLister gardenlisters.SeedLister) SchedulerInterface

NewDefaultControl returns a new instance of the default implementation SchedulerInterface that implements the documented semantics for Scheduling.

Jump to

Keyboard shortcuts

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