»scaling Stanza

Placementjob -> group

The scaling stanza allows configuring scaling options for a task group, for the purpose of supporting external autoscalers like the Nomad Autoscaler and scaling via the Nomad UI. This stanza is not supported within jobs of type system.

job "example" {
  datacenters = ["dc1"]
  group "cache" {
    task "redis" {
      driver = "docker"
      config {
        image = "redis:3.2"
      }
    }
    scaling {
      enabled = true
      min = 0
      max = 10
      policy {
      }
    }
  }
}

»scaling Parameters

  • min - (int: nil) - The minimum acceptable count for the task group. This should be honored by the external autoscaler. It will also be honored by Nomad during job updates and scaling operations. Defaults to the specified task group count.

  • max - (int: <required>) - The maximum acceptable count for the task group. This should be honored by the external autoscaler. It will also be honored by Nomad during job updates and scaling operations.

  • enabled - (bool: false) - Whether the scaling policy is enabled. This is intended to allow temporarily disabling an autoscaling policy, and should be honored by the external autoscaler.

  • policy - (map<string|...>: nil) - The autoscaling policy. This is opaque to Nomad, consumed and parsed only by the external autoscaler. Therefore, its contents are specific to the autoscaler; see autoscaler documentation.