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: ResourceTypeResource 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: ImageSpecContainer image specification
resources: ResourcesSpecResource 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-nameor$S:@service/secret-name
command: CommandSpecCommand override (entrypoint, args, workdir)
network: NetworkSpecNetwork configuration
endpoints: Vec<EndpointSpec>Endpoint definitions (proxy bindings)
scale: ScaleSpecScaling configuration
depends: Vec<DependsSpec>Dependency specifications
health: HealthSpecHealth check configuration
init: InitSpecInit actions (pre-start lifecycle steps)
errors: ErrorsSpecError 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: boolRun container in privileged mode (all capabilities + all devices)
node_mode: NodeModeNode allocation mode (shared, dedicated, exclusive)
node_selector: Option<NodeSelector>Node selection constraints (required/preferred labels)
service_type: ServiceTypeService type (standard, wasm_http, job)
wasm_http: Option<WasmHttpConfig>WASM HTTP configuration (only used when service_type is WasmHttp)
host_network: boolUse 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
impl Clone for ServiceSpec
Source§fn clone(&self) -> ServiceSpec
fn clone(&self) -> ServiceSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more