gce-graceful-shutdown

command module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2020 License: Unlicense Imports: 12 Imported by: 0

README

Google Compute Engine Graceful Shutdown

This tool monitors an Instance Group for changes. The moment the given Instance Template is no longer part of the monitored Instance Group, on-shutdown is run. Afterwards the Instance is deleted via an API call.

It does not currently trigger if:

  • Instance is deleted
  • Instance is restarted
  • Instance is re-created during autohealing

Motivation

Google Shutdown Scripts are unreliable and only run for 60-90s max.

Usage

./gce-graceful-shutdown -on-shutdown 'docker stop --time 30 my-container' -timeout 30s 
Variable Description
-creds Path to Google Service Account Credentials. Defaults to Application Credentials.
-on-shutdown Required Command to run when instance is about to be deleted.
-timeout Time to wait for -on-shutdown to finish. Default 10m.
-project Manually set Google Project.
-region Manually set Region.
-zone Manually set Zone.
-instance-group Manually set Instance Group.
-instance-template Manually set Instance Template.
-instance Manually set Instance.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL