kube-aws / kube-spot-termination-notice-handler

A Kubernetes DaemonSet to gracefully delete pods 2 minutes before an EC2 Spot Instance gets terminated
Apache License 2.0
378 stars 77 forks source link

fix issue with launchtemplates #26

Closed savar closed 5 years ago

savar commented 5 years ago

if DETACH_ASG is active and LaunchTemplates are used, the ASG name isn't detected properly as the aws command output differs:

without LaunchTemplate

$ aws --output text --region us-east-1 autoscaling describe-auto-scaling-instances --instance-ids i-abcdefg
AUTOSCALINGINSTANCES    instancegroupname.clustername.domain.name       us-east-1c HEALTHY i-abcdefg     InService       False

with LaunchTemplate

$ aws --output text --region us-east-1 autoscaling describe-auto-scaling-instances --instance-ids i-abcdefg
AUTOSCALINGINSTANCES    instancegroupname.clustername.domain.name       us-east-1c HEALTHY i-abcdefg     InService       False
LAUNCHTEMPLATE  lt-zyxw1234    instancegroupname.clustername.domain.name-19700101000000000000    1
Vlaaaaaaad commented 5 years ago

Is there anything blocking this? How is this affecting usage of the project with LaunchTemplates?

savar commented 5 years ago

I cannot say why it isn't merged but regarding your question: I am not sure if I understand it. With the change you can also use the DETACH_ASG feature if you use LaunchTemplates instead of LaunchConfigurations but without it this DETACH_ASG will simply fail as it will have not the right name of the ASG in the variable.