Files
nomad/website/content/tools/autoscaling/agent/policy.mdx

55 lines
1.3 KiB
Plaintext

---
layout: docs
page_title: policy Block - Nomad Autoscaler Agent Configuration
description: >-
The "policy" block configures the Nomad Autoscaler's policy handling.
---
# `policy` Block
<Placement groups={['policy']} />
The `policy` block configures the Nomad Autoscaler's policy handling.
```hcl
policy {
dir = "/opt/nomad-autoscaler/policies"
default_cooldown = "2m"
source "nomad" {
enabled = false
}
}
```
## `policy` Parameters
- `default_cooldown` `(string: "5m")` - The default cooldown that will be applied
to all scaling policies which do not specify a cooldown period.
- `default_evaluation_interval` `(string: "10s")` - The default evaluation interval
that will be applied to all scaling policies which do not specify an evaluation
interval.
- `dir` `(string: "")` - The path to a directory used to load scaling policies.
- `source` <code>([Source](#source-parameters))</code> - Configures policy
sources. The `nomad` source is enabled by default and the `file` source is
automatically enabled if `dir` is set.
### `source` Parameters
The `source` block is used to configure scaling policies sources. Supported
sources are `file` and `nomad`.
```hcl
policy {
source "nomad" {
enabled = false
}
}
```
- `enabled` `(bool: true)` - Defines if the scaling policy source should be
enabled or disabled.