Skip to main content

ServiceSpec

Struct ServiceSpec 

Source
pub struct ServiceSpec {
Show 22 fields pub rtype: ResourceType, pub schedule: Option<String>, pub image: ImageSpec, pub resources: ResourcesSpec, pub env: HashMap<String, String>, pub command: CommandSpec, pub network: NetworkSpec, pub endpoints: Vec<EndpointSpec>, pub scale: ScaleSpec, pub depends: Vec<DependsSpec>, pub health: HealthSpec, pub init: InitSpec, pub errors: ErrorsSpec, pub devices: Vec<DeviceSpec>, pub storage: Vec<StorageSpec>, pub capabilities: Vec<String>, pub privileged: bool, pub node_mode: NodeMode, pub node_selector: Option<NodeSelector>, pub service_type: ServiceType, pub wasm_http: Option<WasmHttpConfig>, pub host_network: bool,
}
Expand description

Per-service specification

Fields§

§rtype: ResourceType

Resource type (service, job, cron)

§schedule: Option<String>

Cron schedule expression (only for rtype: cron) Uses 7-field cron syntax: “sec min hour day-of-month month day-of-week year” Examples:

  • “0 0 0 * * * *” (daily at midnight)
  • “0 */5 * * * * *” (every 5 minutes)
  • “0 0 12 * * MON-FRI *” (weekdays at noon)
§image: ImageSpec

Container image specification

§resources: ResourcesSpec

Resource limits

§env: HashMap<String, String>

Environment variables for the service

Values can be:

  • Plain strings: "value"
  • Host env refs: $E:VAR_NAME
  • Secret refs: $S:secret-name or $S:@service/secret-name
§command: CommandSpec

Command override (entrypoint, args, workdir)

§network: NetworkSpec

Network configuration

§endpoints: Vec<EndpointSpec>

Endpoint definitions (proxy bindings)

§scale: ScaleSpec

Scaling configuration

§depends: Vec<DependsSpec>

Dependency specifications

§health: HealthSpec

Health check configuration

§init: InitSpec

Init actions (pre-start lifecycle steps)

§errors: ErrorsSpec

Error handling policies

§devices: Vec<DeviceSpec>

Device passthrough (e.g., /dev/kvm for VMs)

§storage: Vec<StorageSpec>

Storage mounts for the container

§capabilities: Vec<String>

Linux capabilities to add (e.g., SYS_ADMIN, NET_ADMIN)

§privileged: bool

Run container in privileged mode (all capabilities + all devices)

§node_mode: NodeMode

Node allocation mode (shared, dedicated, exclusive)

§node_selector: Option<NodeSelector>

Node selection constraints (required/preferred labels)

§service_type: ServiceType

Service type (standard, wasm_http, job)

§wasm_http: Option<WasmHttpConfig>

WASM HTTP configuration (only used when service_type is WasmHttp)

§host_network: bool

Use host networking (container shares host network namespace)

When true, the container will NOT get its own network namespace. This is set programmatically via the --host-network CLI flag, not in YAML specs.

Trait Implementations§

Source§

impl Clone for ServiceSpec

Source§

fn clone(&self) -> ServiceSpec

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ServiceSpec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ServiceSpec

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ServiceSpec

Source§

fn eq(&self, other: &ServiceSpec) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for ServiceSpec

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Validate for ServiceSpec

Source§

impl<'v_a> ValidateArgs<'v_a> for ServiceSpec

Source§

impl StructuralPartialEq for ServiceSpec

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,