-
-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add ASG lifecycle management Lambda function (#392)
This introduces an Auto Scaling Group instance termination lifecycle hook using Lambda and related resources. The Lambda function is a Python script that is triggered when the persistent runner instance in the ASG is terminated. The function receives the instance ID of the "parent" runner and queries for spawned instances that it launched to terminate. Additionally, it will check for other "orphaned" instances that have a `gitlab-runner-parent-id` tag that doesn't match an existing instance. This resolves the issue where spawned instances could be orphaned when their parent runner is terminated. This feature is disabled by default. The user data script is updated to provide the 'parent' instance ID as a tag named 'gitlab-runner-parent-id' on spawned instances. A new sub-module is provided called "terminate-workers". It is optional to use this feature, and the input variable `asg_terminate_lifecycle_hook_create` can be toggled `true` or `false` for this behavior.
- Loading branch information
Showing
12 changed files
with
638 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.