github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/website/content/docs/job-specification/scaling.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: scaling Stanza - Job Specification
     4  sidebar_title: scaling
     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  and scaling via the Nomad UI. This stanza is not supported within jobs of type `system`.
    15  
    16  ```hcl
    17  job "example" {
    18    datacenters = ["dc1"]
    19    group "cache" {
    20      task "redis" {
    21        driver = "docker"
    22        config {
    23          image = "redis:3.2"
    24        }
    25      }
    26      scaling {
    27        enabled = true
    28        min = 0
    29        max = 10
    30        policy {
    31        }
    32      }
    33    }
    34  }
    35  ```
    36  
    37  ## `scaling` Parameters
    38  
    39  - `min` - <code>(int: nil)</code> - The minimum acceptable count for the task group.
    40    This should be honored by the external autoscaler. It will also be honored by Nomad
    41    during job updates and scaling operations. Defaults to the specified task group [count][].
    42  
    43  - `max` - <code>(int: &lt;required&gt;)</code> - The maximum acceptable count for the task group.
    44    This should be honored by the external autoscaler. It will also be honored by Nomad
    45    during job updates and scaling operations.
    46  
    47  - `enabled` - <code>(bool: false)</code> - Whether the scaling policy is enabled.
    48    This is intended to allow temporarily disabling an autoscaling policy, and should be
    49    honored by the external autoscaler.
    50  
    51  - `policy` - <code>(map<string|...>: nil)</code> - The autoscaling policy. This is
    52    opaque to Nomad, consumed and parsed only by the external autoscaler. Therefore,
    53    its contents are specific to the autoscaler; see autoscaler documentation.
    54  
    55  [count]: /docs/job-specification/group#count 'Nomad Task Group specification'