k8sworkerpool

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type K8sJob

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

K8sJob represents the job to be run by a k8sWorker from the pool.

func NewK8sJob

func NewK8sJob(obj *unstructured.Unstructured, handlerFunc K8sJobHandlerFunc) *K8sJob

NewK8sJob creates a new instance of K8sJob.

type K8sJobHandlerFunc

type K8sJobHandlerFunc func(context.Context, client.Client, *unstructured.Unstructured)

K8sJobHandlerFunc is a function for running a k8s job by a k8s worker.

type K8sWorkerPool

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

K8sWorkerPool pool that creates all k8s workers and the assigns k8s jobs to available workers.

func AddK8sWorkerPool

func AddK8sWorkerPool(log logr.Logger, mgr ctrl.Manager) (*K8sWorkerPool, error)

AddK8sWorkerPool adds k8s workers pool to the manager and returns it.

func (*K8sWorkerPool) RunAsync

func (pool *K8sWorkerPool) RunAsync(job *K8sJob)

RunAsync inserts the K8sJob into the working queue.

func (*K8sWorkerPool) Start

func (pool *K8sWorkerPool) Start(ctx context.Context) error

Start function starts the k8s workers pool.

Jump to

Keyboard shortcuts

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