Skip to content

ciro-mota/dalek-linode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dalek Linode

License Linode Shell Script Github Action

Just like the Daleks, exterminate resources from your Linode account.

This project is inspired by what is aws-nuke for automatic resource removal from an cloud provider account.

⚠️ Caution!

Be aware of the risks, you should not use this script in a production account.

To reduce the range and mitigate some problems there are some safety precautions:

  1. By default only a few paid features are covered by this script: Linodes (VMs), Volumes, NodeBalancers and LKE (Kubernets cluster).

  2. Also by default, the script will check for the existence of tags with the string name prod or related tags and will ignore removing the resource that is associated with this tag.

  3. This script will not read or remove any other resources than those listed above.

💸 Use Cases

Linode charges you for the use of VMs even if they are in a powered off state and this can cause a huge cost issue for some people. So you can never simply forget to remove your instances after some testing. Including your tests with Terraform that may have failed to apply or you forgot to destroy when finished.

With this script your resources will be deleted days at a time pre-scheduled by you with the help of GitHub actions.

🚀 Installation

  • Create a Linode Personal Access Token.
  • Clone this repo.
  • Create a repository secret (Settings » Secret and variables » Actions » New repository secret) named LINODE_TOKEN and insert your Linode Personal Access Token.

💻 Usage

  • Edit the linode-nuke.yml uncommenting lines 4 and 5 and adjust the period in which you want the removal action to be performed. By default it will run daily at 3:33am.
schedule:
  - cron: "33 3 * * *"

🐳 Docker

You can also use a Docker container to run the script manually when you want.

  • Clone this repo.
  • In the Dockerfile file, edit the LINODE_CLI_TOKEN variable and insert your Linode Personal Access Token.
  • Build.
  • Exec.

🎁 Sponsoring

If you like this work, give me it a star on GitHub, and consider supporting it buying me a coffee:

PayPal