Provision the infrastructure
We will use terraform to create some devices in Equinix.
Configure
Create a new local directory and change into it:
mkdir lm-equinix
cd lm-equinixGenerate an API key for both Equinix and Tailscale.
Create a new SSH key pair:
ssh-keygen -t ed25519 -f lm-key -N ""Connect your local machine to Tailscale:
For Linux users:
sudo tailscale up --accept-routesFor other OS users:
sudo tailscale upInstall the Equinix CLI tool.
Find an Equinix metro with sufficient capacity.
metal capacity getMake note of the
FACILITYandPLANwhich has anormalavailabity level. In my case I will choose:| am6 | c3.small.x86 | normal |Write the following to a
main.tffile:Contents
Edit these fields in your
main.tf:metal_auth_token: your API token for Equinix Metalorg_id: Your Equinix org id.project_name: The name of the project to create.public_key: The contents of the.pubfile you created earlier.metro: The metro of the facility you chose from your capacity check earlier. In my case I chose facilityam6, so my metro will beam.server_type: The plan available in your chosen metro. In my case this isc3.small.x86.ts_auth_key: Your Tailscale auth key.private_key_path: The full path to the private key you generated earlier.
Apply
Once your variables are configured, apply the plan:
terraform init
terraform plan
terraform apply
This make take a few minutes.
Once the apply is complete, take a note of the following outputs:
network_hub_ipmicrovm_host_ips
Approve the subnet routes
Once your network-hub host is provisioned, navigate to your Tailscale dash, and
locate your network-hub machine which should have come online in your network. Select
the machine.
On the machine page, click Review under the 'Subnets' section, and toggle your range to 'enabled'.
This bit is easy to overlook or forget, so I am highlighting here for extra clarity!
Test
To verify the flintlockd services are ready to accept requests, you can use either fl or
hammertime to perform simple queries against the microvm_host_ips returned
by the terraform:
hammertime list -a <address>:9090
fl microvm get --host <address>:9090