terraform-aws-gitlab-runner icon indicating copy to clipboard operation
terraform-aws-gitlab-runner copied to clipboard

Spot instances over multiple AWS Availability Zones

Open guillemtp opened this issue 4 years ago • 6 comments
trafficstars

Hi!

Is there any option to configure the same GitLab Runner agent to use multiple AWS AZ on spot instances?

Thanks

guillemtp avatar May 17 '21 08:05 guillemtp

Yes, just provide a subnet for each zone, instances should be started (guess random) over your zones.

npalm avatar May 26 '21 20:05 npalm

In which module attribute should be defined?

The attribute subnet_id_runners is only for one subnet.

guillemtp avatar May 27 '21 10:05 guillemtp

I don't think this is possible at the moment: https://docs.gitlab.com/runner/configuration/runner_autoscale_aws/#:~:text=If%20not%20specified%2C%20the%20availability%20zone%20is%20a%2C%20it%20needs%20to%20be%20set%20to%20the%20same%20availability%20zone%20as%20the%20specified%20subnet%2C%20for%20example%20when%20the%20zone%20is%20eu-west-1b%20it%20has%20to%20be%20amazonec2-zone%3Db

ghost avatar Jun 01 '21 17:06 ghost

As a workaround you could spin up runners in different AZs. It's almost the same.

kayman-mk avatar Jul 03 '21 09:07 kayman-mk

I guess it is not a good idea to have one agent feeding runners in different AZs. What if the agent fails? You won't have access to the runners any longer. So better spin up one agent + runners per AZ. Thus deploy this module several times and change the subnet id in the import parameters.

We use this setup and if one AZ fails your runners in the other AZs are still available.

kayman-mk avatar Oct 14 '21 07:10 kayman-mk

Also having 2 deployments

npalm avatar Nov 10 '21 22:11 npalm

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days.

github-actions[bot] avatar Jan 01 '23 03:01 github-actions[bot]

This issue was closed because it has been stalled for 15 days with no activity.

github-actions[bot] avatar Jan 17 '23 02:01 github-actions[bot]