scheduler

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AgentContainerName = "agent"
)

Variables

This section is empty.

Functions

func New added in v0.3.0

func New(logger *zap.Logger, client kubernetes.Interface, cfg api.Config) *worker

func NewInformerFactory added in v0.3.0

func NewInformerFactory(k8s kubernetes.Interface, tags []string) (informers.SharedInformerFactory, error)

returns an informer factory configured to watch resources (pods, jobs) created by the scheduler

func NewJobWrapper added in v0.4.0

func NewJobWrapper(logger *zap.Logger, job *monitor.Job, config api.Config) *jobWrapper

func NewPodCompletionWatcher added in v0.3.0

func NewPodCompletionWatcher(logger *zap.Logger, k8s kubernetes.Interface) *completionsWatcher

Types

type KubernetesPlugin

type KubernetesPlugin struct {
	PodSpec    *corev1.PodSpec
	GitEnvFrom []corev1.EnvFromSource
	Sidecars   []corev1.Container `json:"sidecars,omitempty"`
	Metadata   Metadata
}

type MaxInFlightLimiter added in v0.3.0

type MaxInFlightLimiter struct {
	MaxInFlight int
	// contains filtered or unexported fields
}

func NewLimiter added in v0.3.0

func NewLimiter(logger *zap.Logger, scheduler monitor.JobHandler, maxInFlight int) *MaxInFlightLimiter

func (*MaxInFlightLimiter) Create added in v0.3.0

func (l *MaxInFlightLimiter) Create(ctx context.Context, job *monitor.Job) error

func (*MaxInFlightLimiter) InFlight added in v0.4.0

func (l *MaxInFlightLimiter) InFlight() int

func (*MaxInFlightLimiter) OnAdd added in v0.3.0

func (l *MaxInFlightLimiter) OnAdd(obj interface{})

load jobs at controller startup/restart

func (*MaxInFlightLimiter) OnDelete added in v0.3.0

func (l *MaxInFlightLimiter) OnDelete(obj interface{})

if jobs are deleted before they complete, ensure we remove them from inFlight

func (*MaxInFlightLimiter) OnUpdate added in v0.3.0

func (l *MaxInFlightLimiter) OnUpdate(_, obj interface{})

if a job is still running, add it to inFlight, otherwise try to remove it

func (*MaxInFlightLimiter) RegisterInformer added in v0.3.0

func (l *MaxInFlightLimiter) RegisterInformer(ctx context.Context, factory informers.SharedInformerFactory) error

Creates a Jobs informer, registers the handler on it, and waits for cache sync

type Metadata added in v0.4.0

type Metadata struct {
	Annotations map[string]string
	Labels      map[string]string
}

Jump to

Keyboard shortcuts

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