Documentation ¶
Overview ¶
Responsible for creating all resources for a lab. Pods, services, networks, etc.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KubeLab ¶
type KubeLab struct { Namespace *corev1.Namespace CreateRequest *LessonScheduleRequest // The request that originally resulted in this KubeLab Networks map[string]*crd.NetworkAttachmentDefinition Pods map[string]*corev1.Pod Services map[string]*corev1.Service LabConnections map[string]string NetPolicy *netv1.NetworkPolicy }
KubeLab is the collection of kubernetes resources that makes up a lab instance
func (*KubeLab) ToLiveLesson ¶
func (kl *KubeLab) ToLiveLesson() *pb.LiveLesson
ToLiveLesson exports a KubeLab as a generic LiveLesson so the API can use it
type LessonScheduleRequest ¶
type LessonScheduleRequest struct { LessonDef *def.LessonDefinition Operation OperationType Uuid string Session string Stage int32 }
type LessonScheduleResult ¶
type LessonScheduleResult struct { Success bool Stage int32 LessonDef *def.LessonDefinition Operation OperationType Message string KubeLab *KubeLab Uuid string Session string GCLessons []string }
type LessonScheduler ¶
type LessonScheduler struct { KubeConfig *rest.Config Requests chan *LessonScheduleRequest Results chan *LessonScheduleResult LessonDefs map[int32]*def.LessonDefinition SyringeConfig *config.SyringeConfig }
func (*LessonScheduler) Start ¶
func (ls *LessonScheduler) 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 OperationType ¶
type OperationType int32
var ( OperationType_CREATE OperationType = 0 OperationType_DELETE OperationType = 1 OperationType_MODIFY OperationType = 2 OperationType_BOOP OperationType = 3 OperationType_GC OperationType = 4 )
Click to show internal directories.
Click to hide internal directories.