pub struct TaskGroup {Show 15 fields
pub constraints: Vec<Constraint>,
pub affinities: Vec<Affinity>,
pub spreads: Vec<Spread>,
pub count: u32,
pub meta: Option<HashMap<String, String>>,
pub migrate: MigrateStrategy,
pub name: String,
pub restart_policy: Option<RestartPolicy>,
pub reschedule_policy: Option<ReschedulePolicy>,
pub scaling: Option<Scaling>,
pub ephemeral_disk: EphemeralDisk,
pub update: UpdateStrategy,
pub tasks: Vec<Task>,
pub networks: Vec<NetworkConfig>,
pub services: Vec<Service>,
}Expand description
The task groups defined for a particular job.
Fields§
§constraints: Vec<Constraint>The placement constraints for this job. See also Constraint
affinities: Vec<Affinity>A list to define placement preferences on nodes where a job can be run. See also Affinity
spreads: Vec<Spread>A list to define allocation spread across attributes. See also Spread
count: u32Specifies the number of the task groups that should be running. Must be non-negative, defaults to one.
meta: Option<HashMap<String, String>>A key-value map that annotates the task group with metadata opaque to nomad.
migrate: MigrateStrategySpecifies a migration strategy to be applied during node drains. See also MigrateStrategy
name: StringThe name of the task group. Must be specified.
restart_policy: Option<RestartPolicy>Specifies the restart policy to be applied to tasks in this group. If omitted, a default policy for batch and non-batch jobs is used based on the job type. See also RestartPolicy
reschedule_policy: Option<ReschedulePolicy>Specifies the reschedule policy to be applied to tasks in this group. If omitted, a default policy is used for batch and service jobs. System jobs are not eligible for rescheduling. See also ReschedulePolicy
scaling: Option<Scaling>Specifies the autoscaling policy for the task group. This is primarily for supporting external autoscalers. See also Scaling
ephemeral_disk: EphemeralDiskSpecifies the group’s ephemeral disk requirements. See also EphemeralDisk
update: UpdateStrategySpecifies an update strategy to be applied to all task groups within the job. When specified both at the job level and the task group level, the update blocks are merged with the task group’s taking precedence. See also UpdateStrategy
tasks: Vec<Task>A list of Task object that are part of the task group. See also Task
networks: Vec<NetworkConfig>A list of network objects.
services: Vec<Service>A Service object represents a routable and discoverable service on the network. Nomad integrates with Consul for service discovery and it automatically registers when a task is started and de-registers it when the task transitions to the dead state. See also Service Note that this is deprecated and replaced by the services stanza at the task group level.
Trait Implementations§
Source§impl Default for TaskGroup
impl Default for TaskGroup
Source§fn default() -> Self
fn default() -> Self
Return TaskGroup { constraints: Default::default(), affinities: Default::default(), spreads: Default::default(), count: 1, meta: Default::default(), migrate: Default::default(), name: Default::default(), restart_policy: Default::default(), reschedule_policy: Default::default(), scaling: Default::default(), ephemeral_disk: Default::default(), update: Default::default(), tasks: Default::default(), networks: Default::default(), services: Default::default() }