pub struct Runtime<S = NoServer> { /* private fields */ }
This is supported on crate feature runtime only.
Expand description

Provides infrastructure for running:

  • a Kubernetes controller including logging
  • a default Kubernetes client
  • signal handling and graceful shutdown
  • an admin server with readiness and liveness probe endpoints

The runtime facilitates creating watches (with and without caches) that include error handling and graceful shutdown.

Implementations

Obtains the runtime’s default Kubernetes client.

Creates a new initization handle used to block readiness

Obtains a handle to he admin server’s readiness state

Obtains a handle that can be used to instrument graceful shutdown

Wraps the given Future or Stream so that it completes when the runtime is shutdown

This is supported on features="runtime" and crate feature requeue only.

Wraps the given Future or Stream so that it completes when the runtime is shutdown

Creates a watch with the given Api

If the underlying stream encounters errors, the request is retried (potentially after a delay).

The runtime is not considered initialized until the returned stream returns at least one event.

The return stream terminates when the runtime receives a shutdown signal.

Creates a cluster-level watch on the default Kubernetes client

See Runtime::watch for more details.

Creates a namespace-level watch on the default Kubernetes client

See Runtime::watch for more details.

Creates a cached watch with the given Api

The returned Store is updated as the returned stream is polled. If the underlying stream encounters errors, the request is retried (potentially after a delay).

The runtime is not considered initialized until the returned stream returns at least one event.

The return stream terminates when the runtime receives a shutdown signal.

Creates a cached cluster-level watch on the default Kubernetes client

See Runtime::cache for more details.

Creates a cached namespace-level watch on the default Kubernetes client

See Runtime::cache for more details.

Returns the bound local address of the server

Spawns the HTTPS server with the given service. A runtime handle without the bound server configuration is returned.

The server shuts down gracefully when the runtime is shutdown.

Returns the bound local address of the server

Spawns the HTTPS server, if bound, with the given service. A runtime handle without the bound server configuration is returned.

The server shuts down gracefully when the runtime is shutdown.

Creates a runtime builder

Runs the runtime until it is shutdown

Shutdown starts when a SIGINT or SIGTERM signal is received and completes when all components have terminated gracefully or when a subsequent signal is received.

The admin server’s readiness endpoint returns success only once all watches (and other initalized components) have become ready and then returns an error after shutdown is initiated.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more