Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Scaling doesn't work when inicial number of task beyond the minimum and maximum values #130

Open
alekskar opened this issue Jan 17, 2020 · 3 comments
Assignees
Labels
area/policy-engine Issues related to the policy engine kind/bug Issues relating to bugs

Comments

@alekskar
Copy link

Describe the bug
When applying policy with interval [MinCount, MaxCount ] to existent job with count value lower than MinCount scaling out is not occurs.

To reproduce
Steps to reproduce the behavior ideally with policy and job examples.
Nomad job example

job "test1" {
	region = "us-west-2"
        datacenters = ["us-west-2"]
	type = "service"
	group "api" {
		count = 1 < -- -- -- -- -- -- -- -- -- -- --not in interval[2, 4]
		task "test" {
			driver = "docker"
			config {
				image = "nginx:latest"
				}
			resources {
				cpu = 300# MHz
				memory = 256# MB
				}
			}
		}
	}

policy {
Enabled: true,
Cooldown: 180,
MinCount: 2,
MaxCount: 4,
ScaleOutCount: 1,
ScaleInCount: 1
}

Expected behavior
Desired number of tasks becomes scalled out to 2.

Environment:

  • Sherpa server information (retrieve with sherpa system info):
NomadAddress	"http://http.nomad.service.my-dev:4646"
PolicyEngine	"Sherpa API"
StorageBackend	"Consul"
InternalAutoScalingEngine	true
StrictPolicyChecking	true
  • Sherpa CLI version (retrieve with sherpa --version):
sherpa version v0.4.1
 Date:   2020-01-17 20:02:32.946360009 +0000 UTC
Commit: d215c85
Branch: v0.4.1
State:  v0.4.1
  • Server Operating System/Architecture: Docker on Ubuntu 18
  • Sherpa server configuration parameters:
docker run -e "CONSUL_HTTP_ADDR=consul.service.my-dev:8500" -e "NOMAD_ADDR=http://http.nomad.service.my-dev:4646" -it -p 8000:8000 jrasell/sherpa server --cluster-name sherpa-test-akar --ui --bind-addr "" --storage-consul-enabled --autoscaler-enabled --policy-engine-api-enabled --log-level=debug
@iahim
Copy link

iahim commented Jan 30, 2020

This seems to be correct. If you want 2 counts by default (the minimum) why don't you start nomad job with count 2?
OR why don't you start sherpa with min 1 and max 4 ?
I think the way it is working at the moment is correct.

@jrasell
Copy link
Owner

jrasell commented Jan 30, 2020

@alekskar and @iahim thanks for the information and what you notice is correct. I have it in my backlog to fix this and relates to this tweet I sent to try and gain opinions: https://twitter.com/jrasell/status/1205786409736515584

@jrasell jrasell self-assigned this Jan 30, 2020
@jrasell jrasell added area/policy-engine Issues related to the policy engine kind/bug Issues relating to bugs labels Jan 30, 2020
@alekskar
Copy link
Author

alekskar commented Feb 9, 2020

This seems to be correct. If you want 2 counts by default (the minimum) why don't you start nomad job with count 2?
OR why don't you start sherpa with min 1 and max 4 ?
I think the way it is working at the moment is correct.

@iahim This is just about desired state. As a user I would like to be ensure that after applying scale policy autoscaller automatically adjust number of tasks to desired count within upper and lower bounds.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/policy-engine Issues related to the policy engine kind/bug Issues relating to bugs
Projects
None yet
Development

No branches or pull requests

3 participants