Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattes/gce-graceful-shutdown
Gracefully shutdown long-running Google Compute Instances managed by Instance Group Managers.
https://github.com/mattes/gce-graceful-shutdown
google google-cloud google-cloud-compute google-instance-group graceful-shutdown
Last synced: about 1 month ago
JSON representation
Gracefully shutdown long-running Google Compute Instances managed by Instance Group Managers.
- Host: GitHub
- URL: https://github.com/mattes/gce-graceful-shutdown
- Owner: mattes
- License: unlicense
- Created: 2020-10-02T22:23:00.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-10-30T05:54:07.000Z (about 4 years ago)
- Last Synced: 2024-10-30T13:24:38.232Z (3 months ago)
- Topics: google, google-cloud, google-cloud-compute, google-instance-group, graceful-shutdown
- Language: Go
- Homepage:
- Size: 2.57 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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. |