Skip to main content

RuntimeService

Trait RuntimeService 

Source
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§

Source

fn version( &self, version_request: VersionRequest, ) -> impl Future<Output = Result<VersionResponse>> + Send

Version returns the runtime name, runtime version, and runtime API version.

Source

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.

Source

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.

Source

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.

Source

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.

Source

fn list_pod_sandbox( &self, list_pod_sandbox_request: ListPodSandboxRequest, ) -> impl Future<Output = Result<ListPodSandboxResponse>> + Send

ListPodSandbox returns a list of PodSandboxes.

Source

fn create_container( &self, create_container_request: CreateContainerRequest, ) -> impl Future<Output = Result<CreateContainerResponse>> + Send

CreateContainer creates a new container in specified PodSandbox

Source

fn start_container( &self, start_container_request: StartContainerRequest, ) -> impl Future<Output = Result<StartContainerResponse>> + Send

StartContainer starts the container.

Source

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.

Source

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.

Source

fn list_containers( &self, list_containers_request: ListContainersRequest, ) -> impl Future<Output = Result<ListContainersResponse>> + Send

ListContainers lists all containers by filters.

Source

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.

Source

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.

Source

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.

Source

fn exec_sync( &self, exec_sync_request: ExecSyncRequest, ) -> impl Future<Output = Result<ExecSyncResponse>> + Send

ExecSync runs a command in a container synchronously.

Source

fn exec( &self, exec_request: ExecRequest, ) -> impl Future<Output = Result<ExecResponse>> + Send

Exec prepares a streaming endpoint to execute a command in the container.

Source

fn attach( &self, attach_request: AttachRequest, ) -> impl Future<Output = Result<AttachResponse>> + Send

Attach prepares a streaming endpoint to attach to a running container.

Source

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.

Source

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.

Source

fn list_container_stats( &self, list_container_stats_request: ListContainerStatsRequest, ) -> impl Future<Output = Result<ListContainerStatsResponse>> + Send

ListContainerStats returns stats of all running containers.

Source

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.

Source

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.

Source

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.

Source

fn status( &self, status_request: StatusRequest, ) -> impl Future<Output = Result<StatusResponse>> + Send

Status returns the status of the runtime.

Source

fn checkpoint_container( &self, checkpoint_container_request: CheckpointContainerRequest, ) -> impl Future<Output = Result<CheckpointContainerResponse>> + Send

CheckpointContainer checkpoints a container

Source

fn get_container_events( &self, get_events_request: GetEventsRequest, ) -> impl Stream<Item = Result<ContainerEventResponse>> + Send

GetContainerEvents gets container events from the CRI runtime

Source

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.

Source

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

Source

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.

Implementations on Foreign Types§

Source§

impl RuntimeService for Client

Source§

fn version( &self, version_request: VersionRequest, ) -> impl Future<Output = Result<VersionResponse>> + Send

Source§

fn run_pod_sandbox( &self, run_pod_sandbox_request: RunPodSandboxRequest, ) -> impl Future<Output = Result<RunPodSandboxResponse>> + Send

Source§

fn stop_pod_sandbox( &self, stop_pod_sandbox_request: StopPodSandboxRequest, ) -> impl Future<Output = Result<StopPodSandboxResponse>> + Send

Source§

fn remove_pod_sandbox( &self, remove_pod_sandbox_request: RemovePodSandboxRequest, ) -> impl Future<Output = Result<RemovePodSandboxResponse>> + Send

Source§

fn pod_sandbox_status( &self, pod_sandbox_status_request: PodSandboxStatusRequest, ) -> impl Future<Output = Result<PodSandboxStatusResponse>> + Send

Source§

fn list_pod_sandbox( &self, list_pod_sandbox_request: ListPodSandboxRequest, ) -> impl Future<Output = Result<ListPodSandboxResponse>> + Send

Source§

fn create_container( &self, create_container_request: CreateContainerRequest, ) -> impl Future<Output = Result<CreateContainerResponse>> + Send

Source§

fn start_container( &self, start_container_request: StartContainerRequest, ) -> impl Future<Output = Result<StartContainerResponse>> + Send

Source§

fn stop_container( &self, stop_container_request: StopContainerRequest, ) -> impl Future<Output = Result<StopContainerResponse>> + Send

Source§

fn remove_container( &self, remove_container_request: RemoveContainerRequest, ) -> impl Future<Output = Result<RemoveContainerResponse>> + Send

Source§

fn list_containers( &self, list_containers_request: ListContainersRequest, ) -> impl Future<Output = Result<ListContainersResponse>> + Send

Source§

fn container_status( &self, container_status_request: ContainerStatusRequest, ) -> impl Future<Output = Result<ContainerStatusResponse>> + Send

Source§

fn update_container_resources( &self, update_container_resources_request: UpdateContainerResourcesRequest, ) -> impl Future<Output = Result<UpdateContainerResourcesResponse>> + Send

Source§

fn reopen_container_log( &self, reopen_container_log_request: ReopenContainerLogRequest, ) -> impl Future<Output = Result<ReopenContainerLogResponse>> + Send

Source§

fn exec_sync( &self, exec_sync_request: ExecSyncRequest, ) -> impl Future<Output = Result<ExecSyncResponse>> + Send

Source§

fn exec( &self, exec_request: ExecRequest, ) -> impl Future<Output = Result<ExecResponse>> + Send

Source§

fn attach( &self, attach_request: AttachRequest, ) -> impl Future<Output = Result<AttachResponse>> + Send

Source§

fn port_forward( &self, port_forward_request: PortForwardRequest, ) -> impl Future<Output = Result<PortForwardResponse>> + Send

Source§

fn container_stats( &self, container_stats_request: ContainerStatsRequest, ) -> impl Future<Output = Result<ContainerStatsResponse>> + Send

Source§

fn list_container_stats( &self, list_container_stats_request: ListContainerStatsRequest, ) -> impl Future<Output = Result<ListContainerStatsResponse>> + Send

Source§

fn pod_sandbox_stats( &self, pod_sandbox_stats_request: PodSandboxStatsRequest, ) -> impl Future<Output = Result<PodSandboxStatsResponse>> + Send

Source§

fn list_pod_sandbox_stats( &self, list_pod_sandbox_stats_request: ListPodSandboxStatsRequest, ) -> impl Future<Output = Result<ListPodSandboxStatsResponse>> + Send

Source§

fn update_runtime_config( &self, update_runtime_config_request: UpdateRuntimeConfigRequest, ) -> impl Future<Output = Result<UpdateRuntimeConfigResponse>> + Send

Source§

fn status( &self, status_request: StatusRequest, ) -> impl Future<Output = Result<StatusResponse>> + Send

Source§

fn checkpoint_container( &self, checkpoint_container_request: CheckpointContainerRequest, ) -> impl Future<Output = Result<CheckpointContainerResponse>> + Send

Source§

fn get_container_events( &self, get_events_request: GetEventsRequest, ) -> impl Stream<Item = Result<ContainerEventResponse>> + Send

Source§

fn list_metric_descriptors( &self, list_metric_descriptors_request: ListMetricDescriptorsRequest, ) -> impl Future<Output = Result<ListMetricDescriptorsResponse>> + Send

Source§

fn list_pod_sandbox_metrics( &self, list_pod_sandbox_metrics_request: ListPodSandboxMetricsRequest, ) -> impl Future<Output = Result<ListPodSandboxMetricsResponse>> + Send

Source§

fn runtime_config( &self, runtime_config_request: RuntimeConfigRequest, ) -> impl Future<Output = Result<RuntimeConfigResponse>> + Send

Implementors§