awslabs / ec2-spot-labs

Collection of tools and code examples to demonstrate best practices in using Amazon EC2 Spot Instances.
https://aws.amazon.com/ec2/spot/
Other
942 stars 319 forks source link

/meta-data/spot/ not supported anymore #23

Closed yahavb closed 5 years ago

yahavb commented 5 years ago

the daemon set returns 404 as /meta-data/spot/ is not available. I checked thru the EC2 console that Lifecycle is spot Any other ways to get interruption notices? this is what I get when I kubectl exec to the pod that runs the spot-sig.

/ # curl http://169.254.169.254/latest/meta-data/spot
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>404 - Not Found</title>
 </head>
 <body>
  <h1>404 - Not Found</h1>
 </body>
</html>
cristim commented 5 years ago

You can subscribe to the Cloudwatch events, I hope they still work.

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-interruptions.html

ivallhon commented 5 years ago

Hi @yahavb

The EC2 meta-data service returns an HTTP 404 response for http://169.254.169.254/latest/meta-data/spot until the instance is going to be interrupted.

The URLs to be polled are either http://169.254.169.254/latest/meta-data/spot/instance-action (returns the action and timestamp for termination) or http://169.254.169.254/latest/meta-data/spot/termination-time (returns termination timestamp only).

To trigger an interruption, you can use Spot Fleet as per instructions here.