pub struct ServiceConfig<'a> {
    pub image: String,
    pub init_container_image: Option<String>,
    pub args: &'a (dyn Fn(&BTreeMap<String, String>) -> Vec<String> + Send + Sync),
    pub ports: Vec<ServicePort>,
    pub memory_limit: Option<MemoryLimit>,
    pub cpu_limit: Option<CpuLimit>,
    pub scale: u16,
    pub labels: BTreeMap<String, String>,
    pub availability_zone: Option<String>,
    pub anti_affinity: Option<Vec<LabelSelector>>,
}
Expand description

Describes the desired state of a service.

Fields§

§image: String

An opaque identifier for the executable or container image to run.

Often names a container on Docker Hub or a path on the local machine.

§init_container_image: Option<String>

For the Kubernetes orchestrator, this is an init container to configure for the pod running the service.

§args: &'a (dyn Fn(&BTreeMap<String, String>) -> Vec<String> + Send + Sync)

A function that generates the arguments for each process of the service given the assigned listen addresses for each named port.

§ports: Vec<ServicePort>

Ports to expose.

§memory_limit: Option<MemoryLimit>

An optional limit on the memory that the service can use.

§cpu_limit: Option<CpuLimit>

An optional limit on the CPU that the service can use.

§scale: u16

The number of copies of this service to run.

§labels: BTreeMap<String, String>

Arbitrary key–value pairs to attach to the service in the orchestrator backend.

The orchestrator backend may apply a prefix to the key if appropriate.

§availability_zone: Option<String>

The availability zone the service should be run in. If no availability zone is specified, the orchestrator is free to choose one.

§anti_affinity: Option<Vec<LabelSelector>>

A set of label selectors declaring anti-affinity. If all such selectors match for a given service, this service should not be co-scheduled on a machine with that service.

The orchestrator backend may or may not actually implement anti-affinity functionality.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

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.

Converts to this type from a reference to the input type.
Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Attaches the current Context to this type, returning a WithContext wrapper. Read more
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.

Wrap the input message T in a tonic::Request
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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