scheduler

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const JobBackoff = 3

JobBackoff controls the number of times a job is retried before we consider it failed. I **believe** this is actually equal to the number of "tries", not "retries". So think of this as the number of pods you expect to see if all of them failed. https://kubernetes.io/docs/concepts/workloads/controllers/job/

Variables

This section is empty.

Functions

This section is empty.

Types

type AntidoteScheduler added in v0.6.0

type AntidoteScheduler struct {
	KubeConfig    *rest.Config
	NC            *nats.Conn
	Config        config.AntidoteConfig
	Db            db.DataManager
	HealthChecker LessonHealthChecker

	// Client for interacting with normal Kubernetes resources
	Client kubernetes.Interface

	// Client for creating CRD defintions
	ClientExt kubernetesExt.Interface

	// Client for creating instances of our network CRD
	ClientCrd kubernetesCrd.Interface

	BuildInfo map[string]string
}

AntidoteScheduler is an Antidote service that receives commands for things like creating new lesson instances, moving existing livelessons to a different stage, deleting old lessons, etc.

func (*AntidoteScheduler) PruneOrphanedNamespaces added in v0.6.0

func (s *AntidoteScheduler) PruneOrphanedNamespaces() error

PruneOrphanedNamespaces seeks out all antidote-managed namespaces, and deletes them. This will effectively reset the cluster to a state with all of the remaining infrastructure in place, but no running lessons. Antidote doesn't manage itself, or any other Antidote services.

func (*AntidoteScheduler) PurgeOldLessons added in v0.6.0

func (s *AntidoteScheduler) PurgeOldLessons(sc ot.SpanContext) ([]string, error)

PurgeOldLessons identifies any kubernetes namespaces that are operating with our antidoteId, and among those, deletes the ones that have a lastAccessed timestamp that exceeds our configured TTL. This function is meant to be run in a loop within a goroutine, at a configured interval. Returns a slice of livelesson IDs to be deleted by the caller (not handled by this function)

func (*AntidoteScheduler) PurgeOldSessions added in v0.6.0

func (s *AntidoteScheduler) PurgeOldSessions(sc ot.SpanContext) error

PurgeOldSessions cleans up old LiveSessions according to the configured LiveSessionTTL

func (*AntidoteScheduler) Start added in v0.6.0

func (s *AntidoteScheduler) Start() error

Start is meant to be run as a goroutine. The "requests" channel will wait for new requests, attempt to schedule them, and put a results message on the "results" channel when finished (success or fail)

type LessonHealthCheck added in v0.3.1

type LessonHealthCheck struct{}

LessonHealthCheck performs network tests to determine health of endpoints within a running lesson

type LessonHealthChecker added in v0.3.1

type LessonHealthChecker interface {
	// contains filtered or unexported methods
}

LessonHealthChecker describes a struct which offers a variety of reachability tests for lesson endpoints.

type NetworkCrdClient added in v0.3.1

NetworkCrdClient is an interface for the client for our custom network CRD. Allows for injection of mocks at test time.

Jump to

Keyboard shortcuts

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