Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

What is the API that it uses to know that the node will be down after 30 seconds? #17

Open
ankit-arora-369 opened this issue Sep 20, 2019 · 2 comments

Comments

@ankit-arora-369
Copy link

What is the API that it uses to know that the node will be down after 30 seconds?

Can you please share the URL of the API so that we can also create a script own our own?

@egalpin
Copy link

egalpin commented Oct 15, 2019

@ankit-arora-369 I think this provides what you're after (Official Docs). Note that I have found this to work both from within a GKE node as well as within pod on a node.

curl "http://metadata.google.internal/computeMetadata/v1/instance/preempted" -H "Metadata-Flavor: Google"

Or polling request that returns only when there's a change to the value:

curl "http://metadata.google.internal/computeMetadata/v1/instance/preempted?wait_for_change=true" -H "Metadata-Flavor: Google"

@ankit-arora-369
Copy link
Author

ankit-arora-369 commented Oct 23, 2019

This doesn't work because it turns TRUE only when G3 signal is returned.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants