Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultScaleInWorkerQueueDuration define the duration to scale in the workers. DefaultScaleInWorkerQueueDuration = time.Hour * 3 ScaleInQueueThreshold = 0.75 ControllerFinalizer = "cloudshell.cloudtty.io/worker-pool" ErrNotWorker = errors.New("There is no worker in pool") )
Functions ¶
func SplitWorkerKey ¶
SplitWorkerKey returns the namespace, name, image that WorkerKeyFunc encoded into key.
packing/unpacking won't be necessary.
func WorkerKeyFunc ¶
Types ¶
type Request ¶
type Request struct { Cloudshell string Namespace string Image string CloudShellQueue workqueue.RateLimitingInterface }
Request represents a request to borrow a worker from worker pool. if the delay is true, the cloudshell queue must not be empty, because when the worker is running, it needs to inform the controller.
type WorkerPool ¶
func New ¶
func New(client client.Client, coreWorkerLimit, maxWorkerLimit int, podInformer informercorev1.PodInformer) *WorkerPool
func (*WorkerPool) CreateServiceFor ¶ added in v0.6.0
func (*WorkerPool) Run ¶
func (w *WorkerPool) Run(stopCh <-chan struct{})
Click to show internal directories.
Click to hide internal directories.