How to use Cloud-init to deploy pool servers in minutes

I created a tool that helps you to deploy a Cardano node server in minutes with no configuration. It works by generating a Cloud-init YAML file that can then be used to launch a new server instance. This does all the setup of the node while the server boots for the first time.

What is Cloud-init?

Cloud-init is the industry standard method for cloud instance initialization. It allows users to provide their own YAML template which will run on a server’s initial boot. This template can provide instructions to the server, telling it to create users, write files, and run commands.

How does it work?

The tool will generate Cloud-init YAML files based on the configuration you choose. These files are then used when initializing your block and relay servers. You simply generate a config, paste that YAML into the ‘User Data’ section when creating a new server with nearly any cloud provider, and within minutes you’ll be up and running - no need to install anything further.

Initial node installation - runs on first boot

  • Updates all packages on the server and installs a handful of useful packages like jq, rsync, curl, zip, etc.

  • Creates a user on the server named cardano. This user can login using only the SSH key you provided.

  • Writes a new SSH config which disables passwords, disables root, and changes SSH port.

  • Installs and configures fail2ban.

  • Writes aliases and environment variables to an environment file, which get loaded into bashrc for the cardano user.

  • Downloads Cardano config files from hydra.iohk.io.

  • Downloads and install cardano-node and cardano-cli binaries from hydra.iohk.io.

  • Creates cardano-node system service, enables and starts.

  • Sets initial firewall settings and enables firewall.

Once the initial node installation step is complete, cardano-node is all setup and the blockchain should be syncing. This first step takes less than 5 minutes and happens entirely in the background when the server boots.

Setup Scripts (optional)

  • Provides a few simple helpers/utility scripts for node management.

  • Provides a step-by-step walk through of setting up block and relay nodes.

  • Relay nodes will prompt for the block’s IP, then set the topology & firewall respectively, and add topology update/pull scripts.

  • Block node will prompt through registering the pool and then set topology & firewall.

No commands need to be run on either node to setup. You’ll only need to download and execute a file for each step on your cold machine (its all zipped for you).

I’m still working to improve documentation and have a few items on my ‘coming soon’ list - but I am interested in hearing any feedback and/or suggestions from experienced SPO’s and the rest of the community.

Check out this video demo, it probably does a better job showing what I am trying to explain here - Install and Setup Cardano Stake Pool Node Using Cloud-init in Less Than 15 mins - YouTube

GitHub for the script that generates the Cloud-init YAML - GitHub - gregreindel/cardano-node-cloud-init: Generate Cloud-init files for creating Cardano node servers

Web UI for generating the Cloud-init files - https://app.cardanocloudinit.com/

1 Like

It is just amazing!
Allow me some time/days to try it.

Quick question , Can we think doing the same with ansible?

I’m not familiar with ansible, but from a quick look it seems possible. It is also a YAML format, so i expect you can create something pretty similar.