github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/website/pages/docs/job-specification/scaling.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: scaling Stanza - Job Specification
     4  sidebar_title: scaling <sup>Beta</sup>
     5  description: The "scaling" stanza allows specifying scaling policy for a task group
     6  ---
     7  
     8  # `scaling` Stanza
     9  
    10  <Placement groups={['job', 'group']} />
    11  
    12  The `scaling` stanza allows configuring scaling options for a task group, for the purpose
    13  of supporting external autoscalers like the [Nomad Autoscaler](https://github.com/hashicorp/nomad-autoscaler).
    14  
    15  ```hcl
    16  job "example" {
    17    datacenters = ["dc1"]
    18    group "cache" {
    19      task "redis" {
    20        driver = "docker"
    21        config {
    22          image = "redis:3.2"
    23        }
    24      }
    25      scaling {
    26        enabled = true
    27        min = 0
    28        max = 10
    29        policy {
    30        }
    31      }
    32    }
    33  }
    34  ```
    35  
    36  ## `scaling` Parameters
    37  
    38  - `min` - <code>(int: nil)</code> - The minimum acceptable count for the task group.
    39    This should be honored by the external autoscaler. It will also be honored by Nomad
    40    during job updates and scaling operations. Defaults to the specified task group [count][].
    41  
    42  - `max` - <code>(int: &lt;required&gt;)</code> - The maximum acceptable count for the task group.
    43    This should be honored by the external autoscaler. It will also be honored by Nomad
    44    during job updates and scaling operations.
    45  
    46  - `enabled` - <code>(bool: false)</code> - Whether the scaling policy is enabled.
    47    This is intended to allow temporarily disabling an autoscaling policy, and should be
    48    honored by the external autoscaler.
    49  
    50  - `policy` - <code>(map<string|...>: nil)</code> - The autoscaling policy. This is
    51    opaque to Nomad, consumed and parsed only by the external autoscaler. Therefore,
    52    its contents are specific to the autoscaler; see autoscaler documentation.
    53  
    54  [count]: /docs/job-specification/group/#count 'Nomad Task Group specification'