Documentation ¶
Index ¶
- Constants
- func AddCgroupAnnotation(ctx context.Context, g generate.Generator, ...) (string, error)
- func ConvertImage(from *storage.ImageResult) *pb.Image
- func Listen(network, address string) (net.Listener, error)
- type Namespace
- type SecretData
- type Server
- func (s *Server) Attach(ctx context.Context, req *pb.AttachRequest) (resp *pb.AttachResponse, err error)
- func (s *Server) ContainerStats(ctx context.Context, req *pb.ContainerStatsRequest) (resp *pb.ContainerStatsResponse, err error)
- func (s *Server) ContainerStatus(ctx context.Context, req *pb.ContainerStatusRequest) (resp *pb.ContainerStatusResponse, err error)
- func (s *Server) CreateContainer(ctx context.Context, req *pb.CreateContainerRequest) (res *pb.CreateContainerResponse, err error)
- func (s *Server) CreateMetricsEndpoint() (*http.ServeMux, error)
- func (s *Server) Exec(ctx context.Context, req *pb.ExecRequest) (resp *pb.ExecResponse, err error)
- func (s *Server) ExecSync(ctx context.Context, req *pb.ExecSyncRequest) (resp *pb.ExecSyncResponse, err error)
- func (s *Server) GetInfoMux() *bone.Mux
- func (s *Server) ImageFsInfo(ctx context.Context, req *pb.ImageFsInfoRequest) (resp *pb.ImageFsInfoResponse, err error)
- func (s *Server) ImageStatus(ctx context.Context, req *pb.ImageStatusRequest) (resp *pb.ImageStatusResponse, err error)
- func (s *Server) ListContainerStats(ctx context.Context, req *pb.ListContainerStatsRequest) (resp *pb.ListContainerStatsResponse, err error)
- func (s *Server) ListContainers(ctx context.Context, req *pb.ListContainersRequest) (resp *pb.ListContainersResponse, err error)
- func (s *Server) ListImages(ctx context.Context, req *pb.ListImagesRequest) (resp *pb.ListImagesResponse, err error)
- func (s *Server) ListPodSandbox(ctx context.Context, req *pb.ListPodSandboxRequest) (resp *pb.ListPodSandboxResponse, err error)
- func (s *Server) MonitorsCloseChan() chan struct{}
- func (s *Server) PodSandboxStatus(ctx context.Context, req *pb.PodSandboxStatusRequest) (resp *pb.PodSandboxStatusResponse, err error)
- func (s *Server) PortForward(ctx context.Context, req *pb.PortForwardRequest) (resp *pb.PortForwardResponse, err error)
- func (s *Server) PullImage(ctx context.Context, req *pb.PullImageRequest) (resp *pb.PullImageResponse, err error)
- func (s *Server) ReloadRegistries(file string) error
- func (s *Server) RemoveContainer(ctx context.Context, req *pb.RemoveContainerRequest) (resp *pb.RemoveContainerResponse, err error)
- func (s *Server) RemoveImage(ctx context.Context, req *pb.RemoveImageRequest) (resp *pb.RemoveImageResponse, err error)
- func (s *Server) RemovePodSandbox(ctx context.Context, req *pb.RemovePodSandboxRequest) (resp *pb.RemovePodSandboxResponse, err error)
- func (s *Server) ReopenContainerLog(ctx context.Context, req *pb.ReopenContainerLogRequest) (resp *pb.ReopenContainerLogResponse, err error)
- func (s *Server) ReserveContainerIDandName(sandboxMetadata *pb.PodSandboxMetadata, config *pb.ContainerConfig) (id, name string, err error)
- func (s *Server) ReservePodIDAndName(config *pb.PodSandboxConfig) (id, name string, err error)
- func (s *Server) ReserveSandboxContainerIDAndName(config *pb.PodSandboxConfig) (name string, err error)
- func (s *Server) RunPodSandbox(ctx context.Context, req *pb.RunPodSandboxRequest) (resp *pb.RunPodSandboxResponse, err error)
- func (s *Server) Shutdown(ctx context.Context) error
- func (s *Server) StartConfigWatcher(fileName string, reloadFunc func(string) error) (chan os.Signal, error)
- func (s *Server) StartContainer(ctx context.Context, req *pb.StartContainerRequest) (resp *pb.StartContainerResponse, err error)
- func (s *Server) StartExitMonitor()
- func (s *Server) Status(ctx context.Context, req *pb.StatusRequest) (resp *pb.StatusResponse, err error)
- func (s *Server) StopContainer(ctx context.Context, req *pb.StopContainerRequest) (resp *pb.StopContainerResponse, err error)
- func (s *Server) StopMonitors()
- func (s *Server) StopPodSandbox(ctx context.Context, req *pb.StopPodSandboxRequest) (resp *pb.StopPodSandboxResponse, err error)
- func (s *Server) StopStreamServer() error
- func (s *Server) StreamingServerCloseChan() chan struct{}
- func (s *Server) UpdateContainerResources(ctx context.Context, req *pb.UpdateContainerResourcesRequest) (resp *pb.UpdateContainerResourcesResponse, err error)
- func (s *Server) UpdateRuntimeConfig(ctx context.Context, req *pb.UpdateRuntimeConfigRequest) (resp *pb.UpdateRuntimeConfigResponse, err error)
- func (s *Server) Version(ctx context.Context, req *pb.VersionRequest) (resp *pb.VersionResponse, err error)
- type StreamService
Constants ¶
const ( InspectConfigEndpoint = "/config" InspectContainersEndpoint = "/containers" InspectInfoEndpoint = "/info" )
const ( // PodInfraOOMAdj is the value that we set for oom score adj for // the pod infra container. // TODO: Remove this const once this value is provided over CRI // See https://github.com/kubernetes/kubernetes/issues/47938 PodInfraOOMAdj int = -998 PodInfraCPUshares = 2 )
const ( // IpcNamespace is the Linux IPC namespace IpcNamespace = Namespace("ipc") // NetNamespace is the network namespace NetNamespace = Namespace("net") // UnknownNamespace is the zero value if no namespace is known UnknownNamespace = Namespace("") )
Variables ¶
This section is empty.
Functions ¶
func AddCgroupAnnotation ¶ added in v1.15.0
func ConvertImage ¶ added in v1.13.10
func ConvertImage(from *storage.ImageResult) *pb.Image
Types ¶
type Namespace ¶ added in v1.12.0
type Namespace string
Namespace represents a kernel namespace name.
type SecretData ¶ added in v1.0.0
SecretData info
func (SecretData) SaveTo ¶ added in v1.0.0
func (s SecretData) SaveTo(dir string) error
SaveTo saves secret data to given directory
type Server ¶
type Server struct { *lib.ContainerServer // contains filtered or unexported fields }
Server implements the RuntimeService and ImageService
func New ¶
func New( ctx context.Context, systemContext *types.SystemContext, configPath string, configIface libconfig.Iface, ) (*Server, error)
New creates a new Server with the provided context, systemContext, configPath and configuration
func (*Server) Attach ¶
func (s *Server) Attach(ctx context.Context, req *pb.AttachRequest) (resp *pb.AttachResponse, err error)
Attach prepares a streaming endpoint to attach to a running container.
func (*Server) ContainerStats ¶ added in v1.0.0
func (s *Server) ContainerStats(ctx context.Context, req *pb.ContainerStatsRequest) (resp *pb.ContainerStatsResponse, err error)
ContainerStats returns stats of the container. If the container does not exist, the call returns an error.
func (*Server) ContainerStatus ¶
func (s *Server) ContainerStatus(ctx context.Context, req *pb.ContainerStatusRequest) (resp *pb.ContainerStatusResponse, err error)
ContainerStatus returns status of the container.
func (*Server) CreateContainer ¶
func (s *Server) CreateContainer(ctx context.Context, req *pb.CreateContainerRequest) (res *pb.CreateContainerResponse, err error)
CreateContainer creates a new container in specified PodSandbox
func (*Server) CreateMetricsEndpoint ¶ added in v1.0.0
CreateMetricsEndpoint creates a /metrics endpoint for prometheus monitoring
func (*Server) Exec ¶
func (s *Server) Exec(ctx context.Context, req *pb.ExecRequest) (resp *pb.ExecResponse, err error)
Exec prepares a streaming endpoint to execute a command in the container.
func (*Server) ExecSync ¶
func (s *Server) ExecSync(ctx context.Context, req *pb.ExecSyncRequest) (resp *pb.ExecSyncResponse, err error)
ExecSync runs a command in a container synchronously.
func (*Server) GetInfoMux ¶ added in v1.0.0
GetInfoMux returns the mux used to serve info requests
func (*Server) ImageFsInfo ¶ added in v1.0.0
func (s *Server) ImageFsInfo(ctx context.Context, req *pb.ImageFsInfoRequest) (resp *pb.ImageFsInfoResponse, err error)
ImageFsInfo returns information of the filesystem that is used to store images.
func (*Server) ImageStatus ¶
func (s *Server) ImageStatus(ctx context.Context, req *pb.ImageStatusRequest) (resp *pb.ImageStatusResponse, err error)
ImageStatus returns the status of the image.
func (*Server) ListContainerStats ¶ added in v1.0.0
func (s *Server) ListContainerStats(ctx context.Context, req *pb.ListContainerStatsRequest) (resp *pb.ListContainerStatsResponse, err error)
ListContainerStats returns stats of all running containers.
func (*Server) ListContainers ¶
func (s *Server) ListContainers(ctx context.Context, req *pb.ListContainersRequest) (resp *pb.ListContainersResponse, err error)
ListContainers lists all containers by filters.
func (*Server) ListImages ¶
func (s *Server) ListImages(ctx context.Context, req *pb.ListImagesRequest) (resp *pb.ListImagesResponse, err error)
ListImages lists existing images.
func (*Server) ListPodSandbox ¶
func (s *Server) ListPodSandbox(ctx context.Context, req *pb.ListPodSandboxRequest) (resp *pb.ListPodSandboxResponse, err error)
ListPodSandbox returns a list of SandBoxes.
func (*Server) MonitorsCloseChan ¶ added in v1.10.0
func (s *Server) MonitorsCloseChan() chan struct{}
MonitorsCloseChan returns the close chan for the exit monitor
func (*Server) PodSandboxStatus ¶
func (s *Server) PodSandboxStatus(ctx context.Context, req *pb.PodSandboxStatusRequest) (resp *pb.PodSandboxStatusResponse, err error)
PodSandboxStatus returns the Status of the PodSandbox.
func (*Server) PortForward ¶
func (s *Server) PortForward(ctx context.Context, req *pb.PortForwardRequest) (resp *pb.PortForwardResponse, err error)
PortForward prepares a streaming endpoint to forward ports from a PodSandbox.
func (*Server) PullImage ¶
func (s *Server) PullImage(ctx context.Context, req *pb.PullImageRequest) (resp *pb.PullImageResponse, err error)
PullImage pulls a image with authentication config.
func (*Server) ReloadRegistries ¶ added in v1.16.0
ReloadRegistries reloads the registry configuration from the servers `SystemContext`. The method errors in case of any update failure.
func (*Server) RemoveContainer ¶
func (s *Server) RemoveContainer(ctx context.Context, req *pb.RemoveContainerRequest) (resp *pb.RemoveContainerResponse, err error)
RemoveContainer removes the container. If the container is running, the container should be force removed.
func (*Server) RemoveImage ¶
func (s *Server) RemoveImage(ctx context.Context, req *pb.RemoveImageRequest) (resp *pb.RemoveImageResponse, err error)
RemoveImage removes the image.
func (*Server) RemovePodSandbox ¶
func (s *Server) RemovePodSandbox(ctx context.Context, req *pb.RemovePodSandboxRequest) (resp *pb.RemovePodSandboxResponse, err error)
RemovePodSandbox deletes the sandbox. If there are any running containers in the sandbox, they should be force deleted.
func (*Server) ReopenContainerLog ¶ added in v1.10.0
func (s *Server) ReopenContainerLog(ctx context.Context, req *pb.ReopenContainerLogRequest) (resp *pb.ReopenContainerLogResponse, err error)
ReopenContainerLog reopens the containers log file
func (*Server) ReserveContainerIDandName ¶ added in v1.15.0
func (s *Server) ReserveContainerIDandName(sandboxMetadata *pb.PodSandboxMetadata, config *pb.ContainerConfig) (id, name string, err error)
func (*Server) ReservePodIDAndName ¶ added in v1.15.0
func (s *Server) ReservePodIDAndName(config *pb.PodSandboxConfig) (id, name string, err error)
func (*Server) ReserveSandboxContainerIDAndName ¶ added in v1.15.0
func (s *Server) ReserveSandboxContainerIDAndName(config *pb.PodSandboxConfig) (name string, err error)
func (*Server) RunPodSandbox ¶
func (s *Server) RunPodSandbox(ctx context.Context, req *pb.RunPodSandboxRequest) (resp *pb.RunPodSandboxResponse, err error)
RunPodSandbox creates and runs a pod-level sandbox.
func (*Server) Shutdown ¶ added in v1.0.0
Shutdown attempts to shut down the server's storage cleanly
func (*Server) StartConfigWatcher ¶ added in v1.15.0
func (s *Server) StartConfigWatcher( fileName string, reloadFunc func(string) error, ) (chan os.Signal, error)
StartConfigWatcher starts a new watching go routine for the provided `fileName` and `reloadFunc`. The method errors if the given fileName does not exist or is not accessible.
func (*Server) StartContainer ¶
func (s *Server) StartContainer(ctx context.Context, req *pb.StartContainerRequest) (resp *pb.StartContainerResponse, err error)
StartContainer starts the container.
func (*Server) StartExitMonitor ¶ added in v1.0.0
func (s *Server) StartExitMonitor()
StartExitMonitor start a routine that monitors container exits and updates the container status
func (*Server) Status ¶
func (s *Server) Status(ctx context.Context, req *pb.StatusRequest) (resp *pb.StatusResponse, err error)
Status returns the status of the runtime
func (*Server) StopContainer ¶
func (s *Server) StopContainer(ctx context.Context, req *pb.StopContainerRequest) (resp *pb.StopContainerResponse, err error)
StopContainer stops a running container with a grace period (i.e., timeout).
func (*Server) StopMonitors ¶ added in v1.10.0
func (s *Server) StopMonitors()
StopMonitors stops all the monitors
func (*Server) StopPodSandbox ¶
func (s *Server) StopPodSandbox(ctx context.Context, req *pb.StopPodSandboxRequest) (resp *pb.StopPodSandboxResponse, err error)
StopPodSandbox stops the sandbox. If there are any running containers in the sandbox, they should be force terminated.
func (*Server) StopStreamServer ¶ added in v1.0.0
StopStreamServer stops the stream server
func (*Server) StreamingServerCloseChan ¶ added in v1.0.0
func (s *Server) StreamingServerCloseChan() chan struct{}
StreamingServerCloseChan returns the close channel for the streaming server
func (*Server) UpdateContainerResources ¶ added in v1.8.0
func (s *Server) UpdateContainerResources(ctx context.Context, req *pb.UpdateContainerResourcesRequest) (resp *pb.UpdateContainerResourcesResponse, err error)
UpdateContainerResources updates ContainerConfig of the container.
func (*Server) UpdateRuntimeConfig ¶
func (s *Server) UpdateRuntimeConfig(ctx context.Context, req *pb.UpdateRuntimeConfigRequest) (resp *pb.UpdateRuntimeConfigResponse, err error)
UpdateRuntimeConfig updates the configuration of a running container.
func (*Server) Version ¶
func (s *Server) Version(ctx context.Context, req *pb.VersionRequest) (resp *pb.VersionResponse, err error)
Version returns the runtime name, runtime version and runtime API version
type StreamService ¶ added in v1.15.0
StreamService implements streaming.Runtime.
func (StreamService) Attach ¶ added in v1.15.0
func (ss StreamService) Attach(containerID string, inputStream io.Reader, outputStream, errorStream io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize) error
Attach endpoint for streaming.Runtime
func (StreamService) Exec ¶ added in v1.15.0
func (ss StreamService) Exec(containerID string, cmd []string, stdin io.Reader, stdout, stderr io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize) error
Exec endpoint for streaming.Runtime
func (StreamService) PortForward ¶ added in v1.15.0
func (ss StreamService) PortForward(podSandboxID string, port int32, stream io.ReadWriteCloser) error
Source Files ¶
- container_attach.go
- container_create.go
- container_create_linux.go
- container_exec.go
- container_execsync.go
- container_list.go
- container_portforward.go
- container_remove.go
- container_reopen_log.go
- container_start.go
- container_stats.go
- container_stats_list.go
- container_status.go
- container_stop.go
- container_update_resources.go
- container_updateruntimeconfig.go
- image_fs_info.go
- image_list.go
- image_pull.go
- image_remove.go
- image_status.go
- inspect.go
- label_linux.go
- listen_unix.go
- naming.go
- rootless.go
- runtime_status.go
- sandbox_list.go
- sandbox_network.go
- sandbox_remove.go
- sandbox_run.go
- sandbox_run_linux.go
- sandbox_status.go
- sandbox_stop.go
- sandbox_stop_linux.go
- secrets.go
- server.go
- utils.go
- version.go