jenkinsci / ec2-fleet-plugin

The EC2 Fleet plugin launches EC2 instances as worker nodes for Jenkins CI server, automatically scaling the capacity with the load.
https://plugins.jenkins.io/ec2-fleet/
Apache License 2.0
110 stars 81 forks source link

enabling scale-in protection on spot instance type asg #447

Open GogineniManojkumar opened 2 weeks ago

GogineniManojkumar commented 2 weeks ago

Issue Details

Describe the bug plugin is enabling the scale-in(newInstancesProtectedFromScaleIn) protection on ASG with spot instances. due to that asg could not able to make instance could not terminate instances.

Activity on asg: Could not scale to desired capacity because all remaining instances are protected from scale-in.

To Reproduce ec2-fleet ASG with spot instances etc.

Cloud Trail Logs "userAgent": "ec2-fleet-plugin, aws-sdk-java/1.12.633 Linux/4.14.281-212.502.amzn2.x86_64 OpenJDK_64-Bit_Server_VM/17.0.12+7-LTS java/17.0.12 groovy/2.4.21 vendor/Amazon.com_Inc. cfg/retry-mode/legacy", "requestParameters": { "autoScalingGroupName": "jenkins-slave", "minSize": 0, "maxSize": 1, "desiredCapacity": 0, "newInstancesProtectedFromScaleIn": true },

Environment Details

Plugin Version? 3.20

Jenkins Version? 2.246

Spot Fleet or ASG? ASG(spot instances)

Label based fleet? NO

Linux or Windows? Linux

GogineniManojkumar commented 2 weeks ago

@pdk27 if you can help here that would be great!

What I am looking for is I want to terminate instance idel > 5 minutes, currently it's not happening.