This Elastic Agent Plugin for Amazon's EC2 Container Service allows for flexible use of EC2 instances (with support for ECS Docker containers) thereby optimizing utilization and reducing the cost of your GoCD agent infrastructure. It will also take care of scaling up and scaling down of EC2 instances in the most efficient way.
This elastic agent plugin will help optimize the cost of running your builds on AWS by managing the cluster resources. It will create a container instance as and when required and will terminate the idle container instances based on the termination policy that you choose. This will eliminate the need of constantly running AWS EC2 instances as GoCD agents.
Refer to the installation section available here.
Refer to the pre-requisites and configuration sections to configure this plugin.
In order to manage the AWS ECS cluster, the plugin makes multiple API calls to AWS ECS on your behalf. Using the credentials, the plugin will authorize itself to AWS.
You can configure AWS credentials in many ways. The plugin will look for the credentials in following order:
- Environment variables
- You can provide
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
, orAWS_ACCESS_KEY
andAWS_SECRET_KEY
- You can provide
- Java system properties
- You can provide
aws.accessKeyId
andaws.secretKey
- You can provide
- If your GoCD server is running on an EC2 instance brought up with an IAMInstanceProfile, then, the IAMInstanceProfile will be picked as the credentials provider.
We recommend that you provide AWS credentials using one of the above methods, but you can also configure Access Key Id
and Secret Key Id
on the ECS cluster profile settings page.
Running windows containers is supported from the plugin version 5.0.0
onwards.
Currently, that option is not supported by ECS API.
No, privileged mode is not supported for Windows.
Yes, configuring plugin for different environments is supported using cluster profiles from plugin version 6.0.0
and onwards.
The plugin currently does not capture any data to calculate the savings. AWS provides a Spot Instance Savings Summary page to get this information. Alternatively, you can also subscribe to the Spot Instance Data Feed to get this information from AWS.
You might have multiple GoCD servers with cluster profiles pointing to the same ECS cluster with the same name. This would cause the plugin of one GoCD server to terminate pods started by the plugin in the other GoCD servers, since those pods won't register with the former. Make sure you use different cluster names for each of your running server instances.