Target Plugins
Target Plugins determine where the resource to be autoscaled is located. All
target plugins support the dry-run
policy config parameter which allows a policy
to be evaluated, but will noop any suggested changes.
Below is a list of plugins you can use with the Nomad Autoscaler:
- Nomad Task Group
- Dynamic Application Sizing Nomad Task
- AWS AutoScaling Group
- Azure Virtual Machine Scale Set
Nomad Task Group Target
The Nomad task group target indicates the scalable resource is a Nomad job running on a Nomad cluster.
Agent Configuration Options
The Nomad target is automatically launched by the Nomad Autoscaler and so the following setup is optional.
Policy Configuration Options
If using the Nomad job specification scaling stanza to configure the scaling policy, the following section can be omitted as Nomad will populate them on job submission.
Namespace
(string: "")
- The namespace in which the job resides as defined by thenamespace
parameter within the job specification.Job
(string: "")
- The job identifier which contains the task group to scale as defined within the job specificationjob
stanza.Group
(string: "")
- The name of the task group to scale as defined in the job specificationgroup
stanza.
Dynamic Application Sizing Nomad Task Target
This functionality only exists in Nomad Autoscaler Enterprise. This is not present in the open source version of Nomad Autoscaler.
The app-sizing-nomad
target plugin reports on the current task resource value
as well as submits recommendations to Nomad via the recommendations API endpoint
based on the result of the Dynamic Application Sizing strategy calculations.
Agent Configuration Options
The app-sizing-nomad
plugin is automatically launched by Nomad Autoscaler
Enterprise and so the following setup is optional.
Policy Configuration Options
If using the Nomad job specification scaling stanza to configure the scaling policy for a task resource, the following section can be omitted as Nomad will populate them on job submission. Please also refer to the Nomad Autoscaler policy documentation for additional detail and guidance.
Region
(string: "")
- The region in which the job resides as defined by theregion
parameter within the job specification.Namespace
(string: "")
- The namespace in which the job resides as defined by thenamespace
parameter within the job specification.Job
(string: "")
- The job identifier which contains the task group to scale as defined within the job specificationjob
stanza.Group
(string: "")
- The name of the task group to scale as defined in the job specificationgroup
stanza.Task
(string: "")
- The name of the task to scale as defined in the job specificationtask
stanza.Resource
(string: "")
- The resource to scale as defined by the job specificationresource
stanza. Supports eitherCPU
orMemoryMB
.
AWS AutoScaling Group Target
The AWS ASG target plugin allows for the scaling of the Nomad cluster clients via manipulating AWS AutoScaling Groups.
Agent Configuration Options
To use the AWS ASG target plugin, the agent configuration needs to be populated with the appropriate target block. Authentication to the AWS API can be supplied in a number of ways including EC2 instance roles. It is recommended, if possible to use the Vault AWS Secrets engine for supplying access credentials to the plugin. Credentials should be injected into the configuration via a template rather than as environment variables. This ensures the credentials are passed only to the plugin, rather than being available for all plugins and the agent process.
The IAM policy required for the AWS ASG plugin to function properly is detailed below.
When using a Nomad cluster with ACLs enabled, the plugin will require an ACL token which provides the following permissions:
aws_region
(string: "us-east-1")
- The AWS region identifier to connect to and where resources should be managed.aws_access_key_id
(string: "")
- The AWS access key ID used to authenticate with the AWS API.aws_secret_access_key
(string: "")
- The AWS secret key ID used to authenticate with the AWS API.aws_session_token
(string: "")
- The AWS session token used to authenticate with the AWS API.
Policy Configuration Options
aws_asg_name
(string: <required>)
- The name of the AWS AutoScaling Group to interact with when performing scaling actions.node_class
(string: <required>)
- The Nomad client node class identifier used to group nodes into a pool of resource.node_drain_deadline
(duration: "15m")
The Nomad drain deadline to use when performing node draining actions.node_purge
(bool: "false")
A boolean flag to determine whether Nomad clients should be purged when performing scale in actions.
Azure Virtual Machine Scale Set Target
The Azure VMSS target plugin allows for the scaling of the Nomad cluster clients via manipulating Azure Virtual Machine Scale Sets.
The Azure VMSS target plugin requires Azure fingerprinting, which became available in Nomad 1.0. If you are running a previous version of Nomad you will to set a meta tag in all of your nodes.
Agent Configuration Options
To use the Azure VMSS target plugin, the agent configuration needs to be populated with the appropriate target block. Authentication to the Azure API can be supplied in a number of ways.
Virtual Machine Identities
When using virtual machine identities you will need to provide a
user-managed identity with the Contributor
role and set the subscription_id
in the Autoscaler configuration file:
Configuration file
Credentials should be injected into the configuration via a template rather than as environment variables. This ensures the credentials are passed only to the plugin, rather than being available for all plugins and the agent process. It is recommended, if possible to use the Vault Azure Secrets engine for supplying access credentials to the plugin.
tenant_id
(string: "")
- The ID of the tenant to authenticate to.client_id
(string: "")
- The app ID of the user-assigned identity in Azure Active Directory.secret_access_key
(string: "")
- The secret key ID used to authenticate with the Azure API.subscription_id
(string: "")
- The ID of the subscription to authenticate to.
Nomad ACL
When using a Nomad cluster with ACLs enabled, the plugin will require an ACL token which provides the following permissions:
Policy Configuration Options
resource_group
(string: <required>)
- The name of the Azure resource group within which the virtual machine scale set resides.vm_scale_set
(string: <required>)
- The name of the Azure virtual machine scale set to interact with when performing scaling actions.node_class
(string: <required>)
- The Nomad client node class identifier used to group nodes into a pool of resource.node_drain_deadline
(duration: "15m")
The Nomad drain deadline to use when performing node draining actions.node_purge
(bool: "false")
A boolean flag to determine whether Nomad clients should be purged when performing scale in actions.
Client meta tag
The Azure VMSS target plugin requires Nomad 1.0 for Azure fingerprinting.
Alternatively, you can set a client meta tag called
unique.platform.azure.name
with the value being the Azure VMSS node name.
This can be retrieved programatically via the
Azure Instance Metadata service.