Documentation ¶
Index ¶
- func CRIContainerFilterToContainerFilter(in *kubeapi.ContainerFilter) *types.ContainerFilter
- func CRIContainerStatsFilterToVMStatsFilter(in *kubeapi.ContainerStatsFilter) *types.VMStatsFilter
- func CRIPodSandboxConfigToPodSandboxConfig(in *kubeapi.PodSandboxConfig) *types.PodSandboxConfig
- func CRIPodSandboxFilterToPodSandboxFilter(in *kubeapi.PodSandboxFilter) *types.PodSandboxFilter
- func ContainerInfoToCRIContainer(in *types.ContainerInfo) *kubeapi.Container
- func ContainerInfoToCRIContainerStatus(in *types.ContainerInfo) *kubeapi.ContainerStatus
- func GetVMConfig(in *kubeapi.CreateContainerRequest, csn *network.ContainerSideNetwork) (*types.VMConfig, error)
- func PodSandboxInfoToCRIPodSandbox(in *types.PodSandboxInfo) *kubeapi.PodSandbox
- func PodSandboxInfoToCRIPodSandboxStatus(in *types.PodSandboxInfo) *kubeapi.PodSandboxStatus
- func VMStatsToCRIContainerStats(vs types.VMStats, mountpoint string) *kubeapi.ContainerStats
- type GCHandler
- type Server
- type StreamServer
- type VirtletImageService
- func (v *VirtletImageService) ImageFsInfo(ctx context.Context, in *kubeapi.ImageFsInfoRequest) (*kubeapi.ImageFsInfoResponse, error)
- func (v *VirtletImageService) ImageStatus(ctx context.Context, in *kubeapi.ImageStatusRequest) (*kubeapi.ImageStatusResponse, error)
- func (v *VirtletImageService) ListImages(ctx context.Context, in *kubeapi.ListImagesRequest) (*kubeapi.ListImagesResponse, error)
- func (v *VirtletImageService) PullImage(ctx context.Context, in *kubeapi.PullImageRequest) (*kubeapi.PullImageResponse, error)
- func (v *VirtletImageService) RemoveImage(ctx context.Context, in *kubeapi.RemoveImageRequest) (*kubeapi.RemoveImageResponse, error)
- type VirtletManager
- type VirtletRuntimeService
- func (v *VirtletRuntimeService) Attach(ctx context.Context, req *kubeapi.AttachRequest) (*kubeapi.AttachResponse, error)
- func (v *VirtletRuntimeService) ContainerStats(ctx context.Context, in *kubeapi.ContainerStatsRequest) (*kubeapi.ContainerStatsResponse, error)
- func (v *VirtletRuntimeService) ContainerStatus(ctx context.Context, in *kubeapi.ContainerStatusRequest) (*kubeapi.ContainerStatusResponse, error)
- func (v *VirtletRuntimeService) CreateContainer(ctx context.Context, in *kubeapi.CreateContainerRequest) (*kubeapi.CreateContainerResponse, error)
- func (v *VirtletRuntimeService) Exec(context.Context, *kubeapi.ExecRequest) (*kubeapi.ExecResponse, error)
- func (v *VirtletRuntimeService) ExecSync(context.Context, *kubeapi.ExecSyncRequest) (*kubeapi.ExecSyncResponse, error)
- func (v *VirtletRuntimeService) ListContainerStats(ctx context.Context, in *kubeapi.ListContainerStatsRequest) (*kubeapi.ListContainerStatsResponse, error)
- func (v *VirtletRuntimeService) ListContainers(ctx context.Context, in *kubeapi.ListContainersRequest) (*kubeapi.ListContainersResponse, error)
- func (v *VirtletRuntimeService) ListPodSandbox(ctx context.Context, in *kubeapi.ListPodSandboxRequest) (*kubeapi.ListPodSandboxResponse, error)
- func (v *VirtletRuntimeService) PodSandboxStatus(ctx context.Context, in *kubeapi.PodSandboxStatusRequest) (*kubeapi.PodSandboxStatusResponse, error)
- func (v *VirtletRuntimeService) PortForward(ctx context.Context, req *kubeapi.PortForwardRequest) (*kubeapi.PortForwardResponse, error)
- func (v *VirtletRuntimeService) RemoveContainer(ctx context.Context, in *kubeapi.RemoveContainerRequest) (*kubeapi.RemoveContainerResponse, error)
- func (v *VirtletRuntimeService) RemovePodSandbox(ctx context.Context, in *kubeapi.RemovePodSandboxRequest) (*kubeapi.RemovePodSandboxResponse, error)
- func (v *VirtletRuntimeService) ReopenContainerLog(ctx context.Context, in *kubeapi.ReopenContainerLogRequest) (*kubeapi.ReopenContainerLogResponse, error)
- func (v *VirtletRuntimeService) RunPodSandbox(ctx context.Context, in *kubeapi.RunPodSandboxRequest) (response *kubeapi.RunPodSandboxResponse, retErr error)
- func (v *VirtletRuntimeService) StartContainer(ctx context.Context, in *kubeapi.StartContainerRequest) (*kubeapi.StartContainerResponse, error)
- func (v *VirtletRuntimeService) Status(context.Context, *kubeapi.StatusRequest) (*kubeapi.StatusResponse, error)
- func (v *VirtletRuntimeService) StopContainer(ctx context.Context, in *kubeapi.StopContainerRequest) (*kubeapi.StopContainerResponse, error)
- func (v *VirtletRuntimeService) StopPodSandbox(ctx context.Context, in *kubeapi.StopPodSandboxRequest) (*kubeapi.StopPodSandboxResponse, error)
- func (v *VirtletRuntimeService) UpdateContainerResources(ctx context.Context, req *kubeapi.UpdateContainerResourcesRequest) (*kubeapi.UpdateContainerResourcesResponse, error)
- func (v *VirtletRuntimeService) UpdateRuntimeConfig(context.Context, *kubeapi.UpdateRuntimeConfigRequest) (*kubeapi.UpdateRuntimeConfigResponse, error)
- func (v *VirtletRuntimeService) Version(ctx context.Context, in *kubeapi.VersionRequest) (*kubeapi.VersionResponse, error)
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 ¶
func GetVMConfig(in *kubeapi.CreateContainerRequest, csn *network.ContainerSideNetwork) (*types.VMConfig, error)
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 (*Server) Register ¶
func (s *Server) Register(runtimeService kubeapi.RuntimeServiceServer, imageService kubeapi.ImageServiceServer)
Register registers CRI Runtime and Image services
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 ¶
func (v *VirtletImageService) ImageFsInfo(ctx context.Context, in *kubeapi.ImageFsInfoRequest) (*kubeapi.ImageFsInfoResponse, error)
ImageFsInfo returns an info about filesystem used by images service
func (*VirtletImageService) ImageStatus ¶
func (v *VirtletImageService) ImageStatus(ctx context.Context, in *kubeapi.ImageStatusRequest) (*kubeapi.ImageStatusResponse, error)
ImageStatus method implements ImageStatus from CRI.
func (*VirtletImageService) ListImages ¶
func (v *VirtletImageService) ListImages(ctx context.Context, in *kubeapi.ListImagesRequest) (*kubeapi.ListImagesResponse, error)
ListImages method implements ListImages from CRI.
func (*VirtletImageService) PullImage ¶
func (v *VirtletImageService) PullImage(ctx context.Context, in *kubeapi.PullImageRequest) (*kubeapi.PullImageResponse, error)
PullImage method implements PullImage from CRI.
func (*VirtletImageService) RemoveImage ¶
func (v *VirtletImageService) RemoveImage(ctx context.Context, in *kubeapi.RemoveImageRequest) (*kubeapi.RemoveImageResponse, error)
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 ¶
func (v *VirtletRuntimeService) Attach(ctx context.Context, req *kubeapi.AttachRequest) (*kubeapi.AttachResponse, error)
Attach calls streamer server to implement Attach functionality from CRI.
func (*VirtletRuntimeService) ContainerStats ¶
func (v *VirtletRuntimeService) ContainerStats(ctx context.Context, in *kubeapi.ContainerStatsRequest) (*kubeapi.ContainerStatsResponse, error)
ContainerStats returns cpu/memory/disk usage for particular container id
func (*VirtletRuntimeService) ContainerStatus ¶
func (v *VirtletRuntimeService) ContainerStatus(ctx context.Context, in *kubeapi.ContainerStatusRequest) (*kubeapi.ContainerStatusResponse, error)
ContainerStatus method implements ContainerStatus from CRI.
func (*VirtletRuntimeService) CreateContainer ¶
func (v *VirtletRuntimeService) CreateContainer(ctx context.Context, in *kubeapi.CreateContainerRequest) (*kubeapi.CreateContainerResponse, error)
CreateContainer method implements CreateContainer from CRI.
func (*VirtletRuntimeService) Exec ¶
func (v *VirtletRuntimeService) Exec(context.Context, *kubeapi.ExecRequest) (*kubeapi.ExecResponse, error)
Exec is a placeholder for an unimplemented CRI method.
func (*VirtletRuntimeService) ExecSync ¶
func (v *VirtletRuntimeService) ExecSync(context.Context, *kubeapi.ExecSyncRequest) (*kubeapi.ExecSyncResponse, error)
ExecSync is a placeholder for an unimplemented CRI method.
func (*VirtletRuntimeService) ListContainerStats ¶
func (v *VirtletRuntimeService) ListContainerStats(ctx context.Context, in *kubeapi.ListContainerStatsRequest) (*kubeapi.ListContainerStatsResponse, error)
ListContainerStats returns stats (same as ContainerStats) for containers selected by filter
func (*VirtletRuntimeService) ListContainers ¶
func (v *VirtletRuntimeService) ListContainers(ctx context.Context, in *kubeapi.ListContainersRequest) (*kubeapi.ListContainersResponse, error)
ListContainers method implements ListContainers from CRI.
func (*VirtletRuntimeService) ListPodSandbox ¶
func (v *VirtletRuntimeService) ListPodSandbox(ctx context.Context, in *kubeapi.ListPodSandboxRequest) (*kubeapi.ListPodSandboxResponse, error)
ListPodSandbox method implements ListPodSandbox from CRI.
func (*VirtletRuntimeService) PodSandboxStatus ¶
func (v *VirtletRuntimeService) PodSandboxStatus(ctx context.Context, in *kubeapi.PodSandboxStatusRequest) (*kubeapi.PodSandboxStatusResponse, error)
PodSandboxStatus method implements PodSandboxStatus from CRI.
func (*VirtletRuntimeService) PortForward ¶
func (v *VirtletRuntimeService) PortForward(ctx context.Context, req *kubeapi.PortForwardRequest) (*kubeapi.PortForwardResponse, error)
PortForward calls streamer server to implement PortForward functionality from CRI.
func (*VirtletRuntimeService) RemoveContainer ¶
func (v *VirtletRuntimeService) RemoveContainer(ctx context.Context, in *kubeapi.RemoveContainerRequest) (*kubeapi.RemoveContainerResponse, error)
RemoveContainer method implements RemoveContainer from CRI.
func (*VirtletRuntimeService) RemovePodSandbox ¶
func (v *VirtletRuntimeService) RemovePodSandbox(ctx context.Context, in *kubeapi.RemovePodSandboxRequest) (*kubeapi.RemovePodSandboxResponse, error)
RemovePodSandbox method implements RemovePodSandbox from CRI.
func (*VirtletRuntimeService) ReopenContainerLog ¶
func (v *VirtletRuntimeService) ReopenContainerLog(ctx context.Context, in *kubeapi.ReopenContainerLogRequest) (*kubeapi.ReopenContainerLogResponse, error)
ReopenContainerLog is a placeholder for an unimplemented CRI method.
func (*VirtletRuntimeService) RunPodSandbox ¶
func (v *VirtletRuntimeService) RunPodSandbox(ctx context.Context, in *kubeapi.RunPodSandboxRequest) (response *kubeapi.RunPodSandboxResponse, retErr error)
RunPodSandbox implements RunPodSandbox method of CRI.
func (*VirtletRuntimeService) StartContainer ¶
func (v *VirtletRuntimeService) StartContainer(ctx context.Context, in *kubeapi.StartContainerRequest) (*kubeapi.StartContainerResponse, error)
StartContainer method implements StartContainer from CRI.
func (*VirtletRuntimeService) Status ¶
func (v *VirtletRuntimeService) Status(context.Context, *kubeapi.StatusRequest) (*kubeapi.StatusResponse, error)
Status method implements Status from CRI for both types of service, Image and Runtime.
func (*VirtletRuntimeService) StopContainer ¶
func (v *VirtletRuntimeService) StopContainer(ctx context.Context, in *kubeapi.StopContainerRequest) (*kubeapi.StopContainerResponse, error)
StopContainer method implements StopContainer from CRI.
func (*VirtletRuntimeService) StopPodSandbox ¶
func (v *VirtletRuntimeService) StopPodSandbox(ctx context.Context, in *kubeapi.StopPodSandboxRequest) (*kubeapi.StopPodSandboxResponse, error)
StopPodSandbox implements StopPodSandbox method of CRI.
func (*VirtletRuntimeService) UpdateContainerResources ¶
func (v *VirtletRuntimeService) UpdateContainerResources(ctx context.Context, req *kubeapi.UpdateContainerResourcesRequest) (*kubeapi.UpdateContainerResourcesResponse, error)
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 ¶
func (v *VirtletRuntimeService) UpdateRuntimeConfig(context.Context, *kubeapi.UpdateRuntimeConfigRequest) (*kubeapi.UpdateRuntimeConfigResponse, error)
UpdateRuntimeConfig is a placeholder for an unimplemented CRI method.
func (*VirtletRuntimeService) Version ¶
func (v *VirtletRuntimeService) Version(ctx context.Context, in *kubeapi.VersionRequest) (*kubeapi.VersionResponse, error)
Version implements Version method of CRI.