fix: eip race condition when updating ASG #1314
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Add a second EIP, when we decide to use EIP for the manager. This way, when we update the ASG, a free EIP is available to pick by the
aws-ec2-assign-elastic-ip
tool.This fix the rolling update, and allow for a smoother transition (instead of trying to work around the removing of the EIP association), and breaking the availability of the runner.
The caveats is that we require two EIP for this use case, but I guess it's okay, as long the user is aware of it.
Migrations required
No
Verification
Running a deployment with a runner instance using an EIP, then applying a configuration change for this (like changing the type, or an AMI update).
The second runner is starting correctly, and get an EIP associated.
Alternative
To avoid using two EIP ressources, we may add some more logic in the
template/eip.tftpl
in order to check the EIP availability, and do a switchover if it is already associated to an existing running instance. The issue is that the runner would still be unavailable in the meantime, on Gitlab side, because it will still running the rest of the cloud init script, and won't be able to keep the communication.I'm open to the discussion about this, but having two EIP is more reliable I think.