pods

package
v0.0.0-...-61b0bb6 Latest Latest
Warning

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

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

Documentation

Overview

Package pods pretends to run pods. It is basically a minimal implementation of the scheduler (it nominates itself to run all pods) and the kubelet.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Printf(fmt string, args ...interface{})
}

Logger prints debugging messages.

type Manager

type Manager struct {
	// K8s is a Kubernetes clientset.
	K8s kubernetes.Interface

	// L is a log sink.
	L Logger

	// UserCode is a map of image name to the code to run when that image is requested.
	UserCode map[string]UserCode

	// NodeName is the name of the node we're pretending to be.
	NodeName string
	// contains filtered or unexported fields
}

Manager manages pods, by pretending to the apiserver that it is a node running a kubelet.

func (*Manager) Run

func (m *Manager) Run(ctx context.Context, namespace string) error

Run reads from the provided k8s apiserver and runs pending pods until the context expires.

type UserCode

type UserCode func(pod *corev1.Pod, container *corev1.Container, stopCh <-chan struct{}) error

UserCode is code that backs a container.

Jump to

Keyboard shortcuts

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