Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Work with Scheduled Events for Azure Linux VMs #62

Open
dgkanatsios opened this issue Nov 26, 2018 · 0 comments
Open

Work with Scheduled Events for Azure Linux VMs #62

dgkanatsios opened this issue Nov 26, 2018 · 0 comments

Comments

@dgkanatsios
Copy link
Owner

Azure provides an API to see if a VM will reboot for maintenance. Details for this API are listed here. You can try it this way:

kubectl run busybox --image=busybox --rm --restart=Never -it -- /bin/sh
wget -O- --header=Metadata:true http://169.254.169.254/metadata/scheduledevents?api-version=2017-08-01 # first call takes some time, it will probably return 200 and empty body
# go to the portal, manually click “reboot” on a VM
# after a while …
wget -O- --header=Metadata:true http://169.254.169.254/metadata/scheduledevents?api-version=2017-08-01
Connecting to 169.254.169.254 (169.254.169.254:80)
{"DocumentIncarnation":1,"Events":[{"EventId":"8A506C35-679A-4F78-9D76-C16DBE65EE6F","EventStatus":"Scheduled","EventType":"Reboot","ResourceType":"VirtualMachine","Resources":["aks-nodepool1-34166363-1"],"NotBefore":"Mon, 26 Nov 2018 10:52:34 GMT"}]}

Proposed design:

  • Create a DaemonSet with an app that calls this API and runs every X minutes
  • If there is a reboot scheduled event
  • Do a cleanup on the Pods on this Node (e.g. if it’s a game server, don’t schedule any more players/games here)
  • Cordon the Node so it’s unschedulable
  • When the reboot finishes (we should keep state in a ConfigMap?), uncordon the Node
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

1 participant