pub trait RuntimeService:
Send
+ Sync
+ 'static {
Show 29 methods
// Provided methods
fn version(
&self,
version_request: VersionRequest,
) -> impl Future<Output = Result<VersionResponse>> + Send { ... }
fn run_pod_sandbox(
&self,
run_pod_sandbox_request: RunPodSandboxRequest,
) -> impl Future<Output = Result<RunPodSandboxResponse>> + Send { ... }
fn stop_pod_sandbox(
&self,
stop_pod_sandbox_request: StopPodSandboxRequest,
) -> impl Future<Output = Result<StopPodSandboxResponse>> + Send { ... }
fn remove_pod_sandbox(
&self,
remove_pod_sandbox_request: RemovePodSandboxRequest,
) -> impl Future<Output = Result<RemovePodSandboxResponse>> + Send { ... }
fn pod_sandbox_status(
&self,
pod_sandbox_status_request: PodSandboxStatusRequest,
) -> impl Future<Output = Result<PodSandboxStatusResponse>> + Send { ... }
fn list_pod_sandbox(
&self,
list_pod_sandbox_request: ListPodSandboxRequest,
) -> impl Future<Output = Result<ListPodSandboxResponse>> + Send { ... }
fn create_container(
&self,
create_container_request: CreateContainerRequest,
) -> impl Future<Output = Result<CreateContainerResponse>> + Send { ... }
fn start_container(
&self,
start_container_request: StartContainerRequest,
) -> impl Future<Output = Result<StartContainerResponse>> + Send { ... }
fn stop_container(
&self,
stop_container_request: StopContainerRequest,
) -> impl Future<Output = Result<StopContainerResponse>> + Send { ... }
fn remove_container(
&self,
remove_container_request: RemoveContainerRequest,
) -> impl Future<Output = Result<RemoveContainerResponse>> + Send { ... }
fn list_containers(
&self,
list_containers_request: ListContainersRequest,
) -> impl Future<Output = Result<ListContainersResponse>> + Send { ... }
fn container_status(
&self,
container_status_request: ContainerStatusRequest,
) -> impl Future<Output = Result<ContainerStatusResponse>> + Send { ... }
fn update_container_resources(
&self,
update_container_resources_request: UpdateContainerResourcesRequest,
) -> impl Future<Output = Result<UpdateContainerResourcesResponse>> + Send { ... }
fn reopen_container_log(
&self,
reopen_container_log_request: ReopenContainerLogRequest,
) -> impl Future<Output = Result<ReopenContainerLogResponse>> + Send { ... }
fn exec_sync(
&self,
exec_sync_request: ExecSyncRequest,
) -> impl Future<Output = Result<ExecSyncResponse>> + Send { ... }
fn exec(
&self,
exec_request: ExecRequest,
) -> impl Future<Output = Result<ExecResponse>> + Send { ... }
fn attach(
&self,
attach_request: AttachRequest,
) -> impl Future<Output = Result<AttachResponse>> + Send { ... }
fn port_forward(
&self,
port_forward_request: PortForwardRequest,
) -> impl Future<Output = Result<PortForwardResponse>> + Send { ... }
fn container_stats(
&self,
container_stats_request: ContainerStatsRequest,
) -> impl Future<Output = Result<ContainerStatsResponse>> + Send { ... }
fn list_container_stats(
&self,
list_container_stats_request: ListContainerStatsRequest,
) -> impl Future<Output = Result<ListContainerStatsResponse>> + Send { ... }
fn pod_sandbox_stats(
&self,
pod_sandbox_stats_request: PodSandboxStatsRequest,
) -> impl Future<Output = Result<PodSandboxStatsResponse>> + Send { ... }
fn list_pod_sandbox_stats(
&self,
list_pod_sandbox_stats_request: ListPodSandboxStatsRequest,
) -> impl Future<Output = Result<ListPodSandboxStatsResponse>> + Send { ... }
fn update_runtime_config(
&self,
update_runtime_config_request: UpdateRuntimeConfigRequest,
) -> impl Future<Output = Result<UpdateRuntimeConfigResponse>> + Send { ... }
fn status(
&self,
status_request: StatusRequest,
) -> impl Future<Output = Result<StatusResponse>> + Send { ... }
fn checkpoint_container(
&self,
checkpoint_container_request: CheckpointContainerRequest,
) -> impl Future<Output = Result<CheckpointContainerResponse>> + Send { ... }
fn get_container_events(
&self,
get_events_request: GetEventsRequest,
) -> impl Stream<Item = Result<ContainerEventResponse>> + Send { ... }
fn list_metric_descriptors(
&self,
list_metric_descriptors_request: ListMetricDescriptorsRequest,
) -> impl Future<Output = Result<ListMetricDescriptorsResponse>> + Send { ... }
fn list_pod_sandbox_metrics(
&self,
list_pod_sandbox_metrics_request: ListPodSandboxMetricsRequest,
) -> impl Future<Output = Result<ListPodSandboxMetricsResponse>> + Send { ... }
fn runtime_config(
&self,
runtime_config_request: RuntimeConfigRequest,
) -> impl Future<Output = Result<RuntimeConfigResponse>> + Send { ... }
}Expand description
Runtime service defines the public APIs for remote container runtimes
Provided Methods§
Sourcefn version(
&self,
version_request: VersionRequest,
) -> impl Future<Output = Result<VersionResponse>> + Send
fn version( &self, version_request: VersionRequest, ) -> impl Future<Output = Result<VersionResponse>> + Send
Version returns the runtime name, runtime version, and runtime API version.
Sourcefn run_pod_sandbox(
&self,
run_pod_sandbox_request: RunPodSandboxRequest,
) -> impl Future<Output = Result<RunPodSandboxResponse>> + Send
fn run_pod_sandbox( &self, run_pod_sandbox_request: RunPodSandboxRequest, ) -> impl Future<Output = Result<RunPodSandboxResponse>> + Send
RunPodSandbox creates and starts a pod-level sandbox. Runtimes must ensure the sandbox is in the ready state on success.
Sourcefn stop_pod_sandbox(
&self,
stop_pod_sandbox_request: StopPodSandboxRequest,
) -> impl Future<Output = Result<StopPodSandboxResponse>> + Send
fn stop_pod_sandbox( &self, stop_pod_sandbox_request: StopPodSandboxRequest, ) -> impl Future<Output = Result<StopPodSandboxResponse>> + Send
StopPodSandbox stops any running process that is part of the sandbox and reclaims network resources (e.g., IP addresses) allocated to the sandbox. If there are any running containers in the sandbox, they must be forcibly terminated. This call is idempotent, and must not return an error if all relevant resources have already been reclaimed. kubelet will call StopPodSandbox at least once before calling RemovePodSandbox. It will also attempt to reclaim resources eagerly, as soon as a sandbox is not needed. Hence, multiple StopPodSandbox calls are expected.
Sourcefn remove_pod_sandbox(
&self,
remove_pod_sandbox_request: RemovePodSandboxRequest,
) -> impl Future<Output = Result<RemovePodSandboxResponse>> + Send
fn remove_pod_sandbox( &self, remove_pod_sandbox_request: RemovePodSandboxRequest, ) -> impl Future<Output = Result<RemovePodSandboxResponse>> + Send
RemovePodSandbox removes the sandbox. If there are any running containers in the sandbox, they must be forcibly terminated and removed. This call is idempotent, and must not return an error if the sandbox has already been removed.
Sourcefn pod_sandbox_status(
&self,
pod_sandbox_status_request: PodSandboxStatusRequest,
) -> impl Future<Output = Result<PodSandboxStatusResponse>> + Send
fn pod_sandbox_status( &self, pod_sandbox_status_request: PodSandboxStatusRequest, ) -> impl Future<Output = Result<PodSandboxStatusResponse>> + Send
PodSandboxStatus returns the status of the PodSandbox. If the PodSandbox is not present, returns an error.
Sourcefn list_pod_sandbox(
&self,
list_pod_sandbox_request: ListPodSandboxRequest,
) -> impl Future<Output = Result<ListPodSandboxResponse>> + Send
fn list_pod_sandbox( &self, list_pod_sandbox_request: ListPodSandboxRequest, ) -> impl Future<Output = Result<ListPodSandboxResponse>> + Send
ListPodSandbox returns a list of PodSandboxes.
Sourcefn create_container(
&self,
create_container_request: CreateContainerRequest,
) -> impl Future<Output = Result<CreateContainerResponse>> + Send
fn create_container( &self, create_container_request: CreateContainerRequest, ) -> impl Future<Output = Result<CreateContainerResponse>> + Send
CreateContainer creates a new container in specified PodSandbox
Sourcefn start_container(
&self,
start_container_request: StartContainerRequest,
) -> impl Future<Output = Result<StartContainerResponse>> + Send
fn start_container( &self, start_container_request: StartContainerRequest, ) -> impl Future<Output = Result<StartContainerResponse>> + Send
StartContainer starts the container.
Sourcefn stop_container(
&self,
stop_container_request: StopContainerRequest,
) -> impl Future<Output = Result<StopContainerResponse>> + Send
fn stop_container( &self, stop_container_request: StopContainerRequest, ) -> impl Future<Output = Result<StopContainerResponse>> + Send
StopContainer stops a running container with a grace period (i.e., timeout). This call is idempotent, and must not return an error if the container has already been stopped. The runtime must forcibly kill the container after the grace period is reached.
Sourcefn remove_container(
&self,
remove_container_request: RemoveContainerRequest,
) -> impl Future<Output = Result<RemoveContainerResponse>> + Send
fn remove_container( &self, remove_container_request: RemoveContainerRequest, ) -> impl Future<Output = Result<RemoveContainerResponse>> + Send
RemoveContainer removes the container. If the container is running, the container must be forcibly removed. This call is idempotent, and must not return an error if the container has already been removed.
Sourcefn list_containers(
&self,
list_containers_request: ListContainersRequest,
) -> impl Future<Output = Result<ListContainersResponse>> + Send
fn list_containers( &self, list_containers_request: ListContainersRequest, ) -> impl Future<Output = Result<ListContainersResponse>> + Send
ListContainers lists all containers by filters.
Sourcefn container_status(
&self,
container_status_request: ContainerStatusRequest,
) -> impl Future<Output = Result<ContainerStatusResponse>> + Send
fn container_status( &self, container_status_request: ContainerStatusRequest, ) -> impl Future<Output = Result<ContainerStatusResponse>> + Send
ContainerStatus returns status of the container. If the container is not present, returns an error.
Sourcefn update_container_resources(
&self,
update_container_resources_request: UpdateContainerResourcesRequest,
) -> impl Future<Output = Result<UpdateContainerResourcesResponse>> + Send
fn update_container_resources( &self, update_container_resources_request: UpdateContainerResourcesRequest, ) -> impl Future<Output = Result<UpdateContainerResourcesResponse>> + Send
UpdateContainerResources updates ContainerConfig of the container synchronously. If runtime fails to transactionally update the requested resources, an error is returned.
Sourcefn reopen_container_log(
&self,
reopen_container_log_request: ReopenContainerLogRequest,
) -> impl Future<Output = Result<ReopenContainerLogResponse>> + Send
fn reopen_container_log( &self, reopen_container_log_request: ReopenContainerLogRequest, ) -> impl Future<Output = Result<ReopenContainerLogResponse>> + Send
ReopenContainerLog asks runtime to reopen the stdout/stderr log file for the container. This is often called after the log file has been rotated. If the container is not running, container runtime can choose to either create a new log file and return nil, or return an error. Once it returns error, new container log file MUST NOT be created.
Sourcefn exec_sync(
&self,
exec_sync_request: ExecSyncRequest,
) -> impl Future<Output = Result<ExecSyncResponse>> + Send
fn exec_sync( &self, exec_sync_request: ExecSyncRequest, ) -> impl Future<Output = Result<ExecSyncResponse>> + Send
ExecSync runs a command in a container synchronously.
Sourcefn exec(
&self,
exec_request: ExecRequest,
) -> impl Future<Output = Result<ExecResponse>> + Send
fn exec( &self, exec_request: ExecRequest, ) -> impl Future<Output = Result<ExecResponse>> + Send
Exec prepares a streaming endpoint to execute a command in the container.
Sourcefn attach(
&self,
attach_request: AttachRequest,
) -> impl Future<Output = Result<AttachResponse>> + Send
fn attach( &self, attach_request: AttachRequest, ) -> impl Future<Output = Result<AttachResponse>> + Send
Attach prepares a streaming endpoint to attach to a running container.
Sourcefn port_forward(
&self,
port_forward_request: PortForwardRequest,
) -> impl Future<Output = Result<PortForwardResponse>> + Send
fn port_forward( &self, port_forward_request: PortForwardRequest, ) -> impl Future<Output = Result<PortForwardResponse>> + Send
PortForward prepares a streaming endpoint to forward ports from a PodSandbox.
Sourcefn container_stats(
&self,
container_stats_request: ContainerStatsRequest,
) -> impl Future<Output = Result<ContainerStatsResponse>> + Send
fn container_stats( &self, container_stats_request: ContainerStatsRequest, ) -> impl Future<Output = Result<ContainerStatsResponse>> + Send
ContainerStats returns stats of the container. If the container does not exist, the call returns an error.
Sourcefn list_container_stats(
&self,
list_container_stats_request: ListContainerStatsRequest,
) -> impl Future<Output = Result<ListContainerStatsResponse>> + Send
fn list_container_stats( &self, list_container_stats_request: ListContainerStatsRequest, ) -> impl Future<Output = Result<ListContainerStatsResponse>> + Send
ListContainerStats returns stats of all running containers.
Sourcefn pod_sandbox_stats(
&self,
pod_sandbox_stats_request: PodSandboxStatsRequest,
) -> impl Future<Output = Result<PodSandboxStatsResponse>> + Send
fn pod_sandbox_stats( &self, pod_sandbox_stats_request: PodSandboxStatsRequest, ) -> impl Future<Output = Result<PodSandboxStatsResponse>> + Send
PodSandboxStats returns stats of the pod sandbox. If the pod sandbox does not exist, the call returns an error.
Sourcefn list_pod_sandbox_stats(
&self,
list_pod_sandbox_stats_request: ListPodSandboxStatsRequest,
) -> impl Future<Output = Result<ListPodSandboxStatsResponse>> + Send
fn list_pod_sandbox_stats( &self, list_pod_sandbox_stats_request: ListPodSandboxStatsRequest, ) -> impl Future<Output = Result<ListPodSandboxStatsResponse>> + Send
ListPodSandboxStats returns stats of the pod sandboxes matching a filter.
Sourcefn update_runtime_config(
&self,
update_runtime_config_request: UpdateRuntimeConfigRequest,
) -> impl Future<Output = Result<UpdateRuntimeConfigResponse>> + Send
fn update_runtime_config( &self, update_runtime_config_request: UpdateRuntimeConfigRequest, ) -> impl Future<Output = Result<UpdateRuntimeConfigResponse>> + Send
UpdateRuntimeConfig updates the runtime configuration based on the given request.
Sourcefn status(
&self,
status_request: StatusRequest,
) -> impl Future<Output = Result<StatusResponse>> + Send
fn status( &self, status_request: StatusRequest, ) -> impl Future<Output = Result<StatusResponse>> + Send
Status returns the status of the runtime.
Sourcefn checkpoint_container(
&self,
checkpoint_container_request: CheckpointContainerRequest,
) -> impl Future<Output = Result<CheckpointContainerResponse>> + Send
fn checkpoint_container( &self, checkpoint_container_request: CheckpointContainerRequest, ) -> impl Future<Output = Result<CheckpointContainerResponse>> + Send
CheckpointContainer checkpoints a container
Sourcefn get_container_events(
&self,
get_events_request: GetEventsRequest,
) -> impl Stream<Item = Result<ContainerEventResponse>> + Send
fn get_container_events( &self, get_events_request: GetEventsRequest, ) -> impl Stream<Item = Result<ContainerEventResponse>> + Send
GetContainerEvents gets container events from the CRI runtime
Sourcefn list_metric_descriptors(
&self,
list_metric_descriptors_request: ListMetricDescriptorsRequest,
) -> impl Future<Output = Result<ListMetricDescriptorsResponse>> + Send
fn list_metric_descriptors( &self, list_metric_descriptors_request: ListMetricDescriptorsRequest, ) -> impl Future<Output = Result<ListMetricDescriptorsResponse>> + Send
ListMetricDescriptors gets the descriptors for the metrics that will be returned in ListPodSandboxMetrics. This list should be static at startup: either the client and server restart together when adding or removing metrics descriptors, or they should not change. Put differently, if ListPodSandboxMetrics references a name that is not described in the initial ListMetricDescriptors call, then the metric will not be broadcasted.
Sourcefn list_pod_sandbox_metrics(
&self,
list_pod_sandbox_metrics_request: ListPodSandboxMetricsRequest,
) -> impl Future<Output = Result<ListPodSandboxMetricsResponse>> + Send
fn list_pod_sandbox_metrics( &self, list_pod_sandbox_metrics_request: ListPodSandboxMetricsRequest, ) -> impl Future<Output = Result<ListPodSandboxMetricsResponse>> + Send
ListPodSandboxMetrics gets pod sandbox metrics from CRI Runtime
Sourcefn runtime_config(
&self,
runtime_config_request: RuntimeConfigRequest,
) -> impl Future<Output = Result<RuntimeConfigResponse>> + Send
fn runtime_config( &self, runtime_config_request: RuntimeConfigRequest, ) -> impl Future<Output = Result<RuntimeConfigResponse>> + Send
RuntimeConfig returns configuration information of the runtime. A couple of notes:
- The RuntimeConfigRequest object is not to be confused with the contents of UpdateRuntimeConfigRequest. The former is for having runtime tell Kubelet what to do, the latter vice versa.
- It is the expectation of the Kubelet that these fields are static for the lifecycle of the Kubelet. The Kubelet will not re-request the RuntimeConfiguration after startup, and CRI implementations should avoid updating them without a full node reboot.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.