manager

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CRIContainerFilterToContainerFilter

func CRIContainerFilterToContainerFilter(in *kubeapi.ContainerFilter) *types.ContainerFilter

CRIContainerFilterToContainerFilter converts CRI ContainerFilter to ContainerFilter.

func CRIContainerStatsFilterToVMStatsFilter

func CRIContainerStatsFilterToVMStatsFilter(in *kubeapi.ContainerStatsFilter) *types.VMStatsFilter

CRIContainerStatsFilterToVMStatsFilter converts CRI ContainerStatsFilter to VMStatsFilter.

func CRIPodSandboxConfigToPodSandboxConfig

func CRIPodSandboxConfigToPodSandboxConfig(in *kubeapi.PodSandboxConfig) *types.PodSandboxConfig

CRIPodSandboxConfigToPodSandboxConfig converts CRI PodSandboxConfig to PodSandboxConfig.

func CRIPodSandboxFilterToPodSandboxFilter

func CRIPodSandboxFilterToPodSandboxFilter(in *kubeapi.PodSandboxFilter) *types.PodSandboxFilter

CRIPodSandboxFilterToPodSandboxFilter converts CRI PodSandboxFilter to PodSandboxFilter.

func ContainerInfoToCRIContainer

func ContainerInfoToCRIContainer(in *types.ContainerInfo) *kubeapi.Container

ContainerInfoToCRIContainer converts ContainerInfo to CRI Container

func ContainerInfoToCRIContainerStatus

func ContainerInfoToCRIContainerStatus(in *types.ContainerInfo) *kubeapi.ContainerStatus

ContainerInfoToCRIContainerStatus convers ContainerInfo to CRI ContainerStatus.

func GetVMConfig

GetVMConfig translates CRI CreateContainerRequest and CNI info to a VMConfig.

func PodSandboxInfoToCRIPodSandbox

func PodSandboxInfoToCRIPodSandbox(in *types.PodSandboxInfo) *kubeapi.PodSandbox

PodSandboxInfoToCRIPodSandbox converts PodSandboxInfo to CRI PodSandbox.

func PodSandboxInfoToCRIPodSandboxStatus

func PodSandboxInfoToCRIPodSandboxStatus(in *types.PodSandboxInfo) *kubeapi.PodSandboxStatus

PodSandboxInfoToCRIPodSandboxStatus converts PodSandboxInfo to CRI PodSandboxStatus.

func VMStatsToCRIContainerStats

func VMStatsToCRIContainerStats(vs types.VMStats, mountpoint string) *kubeapi.ContainerStats

VMStatsToCRIContainerStats converts internal representation of vm/container stats to corresponding kubeapi type object

Types

type GCHandler

type GCHandler interface {
	GC() error
}

GCHandler performs GC when a container is deleted.

type Server

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

Server wraps a gRPC server and provides listener setup and request logging.

func NewServer

func NewServer() *Server

NewServer creates a new Server.

func (*Server) Register

func (s *Server) Register(runtimeService kubeapi.RuntimeServiceServer, imageService kubeapi.ImageServiceServer)

Register registers CRI Runtime and Image services

func (*Server) Serve

func (s *Server) Serve(addr string) error

Serve set up a listener on unix socket, than it passes that listener to main loop of grpc server which handles CRI calls.

func (*Server) Stop

func (s *Server) Stop()

Stop halts the manager.

type StreamServer

type StreamServer interface {
	GetAttach(req *kubeapi.AttachRequest) (*kubeapi.AttachResponse, error)
	GetPortForward(req *kubeapi.PortForwardRequest) (*kubeapi.PortForwardResponse, error)
}

StreamServer denotes a server that handles Attach and PortForward requests.

type VirtletImageService

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

VirtletImageService handles CRI image service calls.

func NewVirtletImageService

func NewVirtletImageService(imageStore image.Store, imageTranslator image.Translator, clock clockwork.Clock) *VirtletImageService

NewVirtletImageService returns a new instance of VirtletImageService.

func (*VirtletImageService) ImageFsInfo

ImageFsInfo returns an info about filesystem used by images service

func (*VirtletImageService) ImageStatus

ImageStatus method implements ImageStatus from CRI.

func (*VirtletImageService) ListImages

ListImages method implements ListImages from CRI.

func (*VirtletImageService) PullImage

PullImage method implements PullImage from CRI.

func (*VirtletImageService) RemoveImage

RemoveImage method implements RemoveImage from CRI.

type VirtletManager

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

VirtletManager wraps the Virtlet's Runtime and Image CRI services, as well as a gRPC server that provides access to them.

func NewVirtletManager

func NewVirtletManager(config *v1.VirtletConfig, fdManager tapmanager.FDManager, clientCfg clientcmd.ClientConfig, diagSet *diag.Set) *VirtletManager

NewVirtletManager creates a new VirtletManager.

func (*VirtletManager) Run

func (v *VirtletManager) Run() error

Run sets up the environment for the runtime and image services and starts the gRPC listener. It doesn't return until the server is stopped or an error occurs.

func (*VirtletManager) Stop

func (v *VirtletManager) Stop()

Stop stops the gRPC listener of the VirtletManager, if it's active.

type VirtletRuntimeService

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

VirtletRuntimeService handles CRI runtime service calls.

func NewVirtletRuntimeService

func NewVirtletRuntimeService(
	virtTool *libvirttools.VirtualizationTool,
	metadataStore metadata.Store,
	fdManager tapmanager.FDManager,
	streamServer StreamServer,
	gcHandler GCHandler,
	clock clockwork.Clock) *VirtletRuntimeService

NewVirtletRuntimeService returns a new instance of VirtletRuntimeService.

func (*VirtletRuntimeService) Attach

Attach calls streamer server to implement Attach functionality from CRI.

func (*VirtletRuntimeService) ContainerStats

ContainerStats returns cpu/memory/disk usage for particular container id

func (*VirtletRuntimeService) ContainerStatus

ContainerStatus method implements ContainerStatus from CRI.

func (*VirtletRuntimeService) CreateContainer

CreateContainer method implements CreateContainer from CRI.

func (*VirtletRuntimeService) Exec

Exec is a placeholder for an unimplemented CRI method.

func (*VirtletRuntimeService) ExecSync

ExecSync is a placeholder for an unimplemented CRI method.

func (*VirtletRuntimeService) ListContainerStats

ListContainerStats returns stats (same as ContainerStats) for containers selected by filter

func (*VirtletRuntimeService) ListContainers

ListContainers method implements ListContainers from CRI.

func (*VirtletRuntimeService) ListPodSandbox

ListPodSandbox method implements ListPodSandbox from CRI.

func (*VirtletRuntimeService) PodSandboxStatus

PodSandboxStatus method implements PodSandboxStatus from CRI.

func (*VirtletRuntimeService) PortForward

PortForward calls streamer server to implement PortForward functionality from CRI.

func (*VirtletRuntimeService) RemoveContainer

RemoveContainer method implements RemoveContainer from CRI.

func (*VirtletRuntimeService) RemovePodSandbox

RemovePodSandbox method implements RemovePodSandbox from CRI.

func (*VirtletRuntimeService) ReopenContainerLog

ReopenContainerLog is a placeholder for an unimplemented CRI method.

func (*VirtletRuntimeService) RunPodSandbox

RunPodSandbox implements RunPodSandbox method of CRI.

func (*VirtletRuntimeService) StartContainer

StartContainer method implements StartContainer from CRI.

func (*VirtletRuntimeService) Status

Status method implements Status from CRI for both types of service, Image and Runtime.

func (*VirtletRuntimeService) StopContainer

StopContainer method implements StopContainer from CRI.

func (*VirtletRuntimeService) StopPodSandbox

StopPodSandbox implements StopPodSandbox method of CRI.

func (*VirtletRuntimeService) UpdateContainerResources

UpdateContainerResources stores in domain on libvirt info about Cpuset for container then looks for running emulator and tries to adjust its current settings through cgroups

func (*VirtletRuntimeService) UpdateRuntimeConfig

UpdateRuntimeConfig is a placeholder for an unimplemented CRI method.

func (*VirtletRuntimeService) Version

Version implements Version method of CRI.

Jump to

Keyboard shortcuts

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