Nomad Application Autoscaling Issue

Hi .
I would like to configure Nomad Application Autoscaling so I have configured autoscaler. In Job.nomad I added scaling stanza but when running job.nomad it makes an error “invalid key: scaling” . Nomad version is v1.2.3.
My job.nomad looks like the following.

job “myjob” {
datacenters = [“dc1”,“test-dc1”]
spread {
attribute = “${node.unique.id}”
weight = 100
}

group “mygroup” {
count = 1

scaling {
enabled = true
min = 1
max = 4
policy {
cooldown = “5s”
evaluation_interval = “2s”
check “avg_cpu” {
source = “nomad-apm”
query = “avg_cpu-allocated”
query_window = “5s”
strategy “target-value” {
target = 70
}
}
check “avg_memory” {
source = “nomad-apm”
query = “avg_memory-allocated”
query_window = “5s”
strategy “target-value” {
target = 70
}
}
}
}

network {
port “http” { to = 8080 }
}

ephemeral_disk {
migrate = true
size = 101
sticky = true
}

update {
max_parallel = 1
canary = 1
min_healthy_time = “30s”
healthy_deadline = “5m”
auto_revert = true
auto_promote = true
}

restart {
interval = “30m”
attempts = 2
delay = “15s”
mode = “fail”
}

task “mytask” {
driver = “docker”
config {
image = “openjdk:11.0.10-jdk”

ports = [
“http”
]
}

resources {
memory = 900
cpu = 300
}

service {
name = “myservice”
port = “http”
check {
name = “alive”
type = “http”
port = “http”
path = “/health”
interval = “10s”
timeout = “1s”
method = “GET”
}

}

}

}
}

Hi @jeyhun.khalilov,

I just tested a the job you posted which registered correctly with Nomad along with the desired scaling policy. How is the job being deployed against the cluster and what version of any tool are you using?

Thanks,
jrasell and the Nomad team

Hi @jrasell

Thank you for response. I solved the problem. Actually the problem was with nomad version of gitlab runner because it was 0.10.2. After upgrade everything was ok.