Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dispense fixed-value, pass-through, and threshold strategy plugins by default #536

Merged
merged 2 commits into from
Nov 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## UNRELEASED

IMPROVEMENTS:
* agent: Dispense `fixed-value`, `pass-through`, and `threshold` strategy plugins by default [[GH-536](https://github.com/hashicorp/nomad-autoscaler/pull/536)]
* policy: Prevent scaling cluster to zero when using the Nomad APM [[GH-534](https://github.com/hashicorp/nomad-autoscaler/pull/534)]
* scaleutils: Add combined filter to allow filtering by node class and datacenter [[GH-535](https://github.com/hashicorp/nomad-autoscaler/pull/535)]

Expand Down
11 changes: 8 additions & 3 deletions agent/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,14 @@ func Default() (*Agent, error) {
AckTimeout: defaultPolicyEvalAckTimeout,
Workers: defaultPolicyEvalWorkers,
},
APMs: []*Plugin{{Name: plugins.InternalAPMNomad, Driver: plugins.InternalAPMNomad}},
Strategies: []*Plugin{{Name: plugins.InternalStrategyTargetValue, Driver: plugins.InternalStrategyTargetValue}},
Targets: []*Plugin{{Name: plugins.InternalTargetNomad, Driver: plugins.InternalTargetNomad}},
APMs: []*Plugin{{Name: plugins.InternalAPMNomad, Driver: plugins.InternalAPMNomad}},
Strategies: []*Plugin{
{Name: plugins.InternalStrategyFixedValue, Driver: plugins.InternalStrategyFixedValue},
{Name: plugins.InternalStrategyPassThrough, Driver: plugins.InternalStrategyPassThrough},
{Name: plugins.InternalStrategyTargetValue, Driver: plugins.InternalStrategyTargetValue},
{Name: plugins.InternalStrategyThreshold, Driver: plugins.InternalStrategyThreshold},
},
Targets: []*Plugin{{Name: plugins.InternalTargetNomad, Driver: plugins.InternalTargetNomad}},
}, nil
}

Expand Down
14 changes: 13 additions & 1 deletion agent/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func Test_Default(t *testing.T) {
assert.Equal(t, defaultPolicyEvalWorkers, def.PolicyEval.Workers)
assert.Len(t, def.APMs, 1)
assert.Len(t, def.Targets, 1)
assert.Len(t, def.Strategies, 1)
assert.Len(t, def.Strategies, 4)
assert.Equal(t, 1*time.Second, def.Telemetry.CollectionInterval)
assert.False(t, def.EnableDebug, "ensure debugging is disabled by default")
}
Expand Down Expand Up @@ -247,10 +247,22 @@ func TestAgent_Merge(t *testing.T) {
},
},
Strategies: []*Plugin{
{
Name: "fixed-value",
Driver: "fixed-value",
},
{
Name: "pass-through",
Driver: "pass-through",
},
{
Name: "target-value",
Driver: "target-value",
},
{
Name: "threshold",
Driver: "threshold",
},
{
Name: "pid",
Driver: "pid",
Expand Down